comparison src/gearsTools/lib/Gears/Context/Template/XV6.pm @ 360:3d7e1c9a852e

...
author anatofuz
date Fri, 26 Jun 2020 15:30:42 +0900
parents d2389a757323
children 650fac123133
comparison
equal deleted inserted replaced
359:87a28b02c88f 360:3d7e1c9a852e
129 sub emit_start_context { 129 sub emit_start_context {
130 my ($class, $out) = @_; 130 my ($class, $out) = @_;
131 my $str = << 'EOFEOF'; 131 my $str = << 'EOFEOF';
132 #define NDIRECT 12 //fs.h 132 #define NDIRECT 12 //fs.h
133 133
134 #define NPROC 64
135
134 136
135 struct Context { 137 struct Context {
136 enum Code next; 138 enum Code next;
137 struct Worker* worker; 139 struct Worker* worker;
138 struct TaskManager* taskManager; 140 struct TaskManager* taskManager;
139 int codeNum; 141 int codeNum;
142
143 struct Context* kernel_context;
144 struct proc* proc;
145
146
147
140 __code (**code) (struct Context*); 148 __code (**code) (struct Context*);
141 union Data **data; 149 union Data **data;
142 void* heapStart; 150 void* heapStart;
143 void* heap; 151 void* heap;
144 long heapLimit; 152 long heapLimit;
160 #endif 168 #endif
161 /* multi dimension parameter */ 169 /* multi dimension parameter */
162 int iterate; 170 int iterate;
163 struct Iterator* iterator; 171 struct Iterator* iterator;
164 enum Code before; 172 enum Code before;
173
165 }; 174 };
175
176 typedef struct KernelContext {
177 struct Context Context;
178 __code (*syscalls[10]) (void);
179 struct Context* proc_contexts[NPROC];
180 struct proc* now_proc;
181 } KernelContext;
166 182
167 #include "spinlock.h" 183 #include "spinlock.h"
168 typedef int Int; 184 typedef int Int;
169 #ifndef USE_CUDAWorker 185 #ifndef USE_CUDAWorker
170 typedef unsigned long long CUdeviceptr; 186 typedef unsigned long long CUdeviceptr;