comparison VMS.h @ 24:2b161e1a50ee

1st working version -- as far as can tell due to SEH bugs
author Me
date Wed, 07 Jul 2010 13:15:54 -0700
parents aa634ef7cc35
children c556193f7211
comparison
equal deleted inserted replaced
5:8ab601559d7d 6:6e535b1d3f58
27 #define SUCCESS 0 27 #define SUCCESS 0
28 28
29 //#define thdAttrs NULL //For PThreads 29 //#define thdAttrs NULL //For PThreads
30 30
31 typedef struct _SchedSlot SchedSlot; 31 typedef struct _SchedSlot SchedSlot;
32 typedef struct _SlaveReqst VMSReqst; 32 typedef struct _VMSReqst VMSReqst;
33 typedef struct _VirtProcr VirtProcr; 33 typedef struct _VirtProcr VirtProcr;
34 34
35 typedef VirtProcr * (*SlaveScheduler) ( void * ); //semEnv 35 typedef VirtProcr * (*SlaveScheduler) ( void * ); //semEnv
36 typedef void (*RequestHandler) ( VirtProcr *, void * ); //prWReqst, semEnv 36 typedef void (*RequestHandler) ( VirtProcr *, void * ); //prWReqst, semEnv
37 typedef void (*VirtProcrFnPtr) ( void *, VirtProcr * ); //initData, animPr 37 typedef void (*VirtProcrFnPtr) ( void *, VirtProcr * ); //initData, animPr
57 57
58 enum ReqstType 58 enum ReqstType
59 { 59 {
60 semantic = 1, 60 semantic = 1,
61 dissipate, 61 dissipate,
62 regCreated,
62 IO 63 IO
63 }; 64 };
64 65
65 struct _SlaveReqst 66 struct _VMSReqst
66 { 67 {
67 // VirtProcr *virtProcrFrom; 68 // VirtProcr *virtProcrFrom;
68 enum ReqstType reqType; //used for dissipate and in future for IO requests 69 enum ReqstType reqType;//used for dissipate and in future for IO requests
69 void *semReqData; 70 void *semReqData;
70 71
71 VMSReqst *nextReqst; 72 VMSReqst *nextReqst;
72 }; 73 };
73 //SlaveReqst 74 //VMSReqst
74 75
75 struct _VirtProcr 76 struct _VirtProcr
76 { int procrID; //for debugging -- count up each time create 77 { int procrID; //for debugging -- count up each time create
77 int coreAnimatedBy; 78 int coreAnimatedBy;
78 void *startOfStack; 79 void *startOfStack;
140 //========================== 141 //==========================
141 void 142 void
142 VMS__init(); 143 VMS__init();
143 144
144 void 145 void
145 VMS__start(); 146 VMS__start_the_work_then_wait_until_done();
146 147
147 VirtProcr * 148 VirtProcr *
148 VMS__create_procr( VirtProcrFnPtr fnPtr, void *initialData ); 149 VMS__create_procr( VirtProcrFnPtr fnPtr, void *initialData );
149 150
150 VirtProcr * 151 VirtProcr *
151 VMS__create_the_shutdown_procr(); 152 VMS__create_the_shutdown_procr();
152 153
154 //==========================
153 inline void 155 inline void
154 VMS__send_sem_request( void *semReqData, VirtProcr *callingPr ); 156 VMS__add_sem_request( void *semReqData, VirtProcr *callingPr );
155 157
156 void 158 void
157 VMS__send_dissipate_request( VirtProcr *procrToDissipate ); 159 VMS__send_register_new_procr_request( VirtProcr *newPrToRegister,
160 VirtProcr *reqstingPr );
161
162 void
163 VMS__free_request( VMSReqst *req );
158 164
159 void 165 void
160 VMS__remove_and_free_top_request( VirtProcr *reqstingPr ); 166 VMS__remove_and_free_top_request( VirtProcr *reqstingPr );
167
168 VMSReqst *
169 VMS__take_top_request_from( VirtProcr *reqstingPr );
170
171 inline void *
172 VMS__take_sem_reqst_from( VMSReqst *req );
173
174 inline int
175 VMS__isSemanticReqst( VMSReqst *req );
176
177 inline int
178 VMS__isDissipateReqst( VMSReqst *req );
179
180 inline int
181 VMS__isCreateReqst( VMSReqst *req );
182
183 //==========================
161 184
162 void 185 void
163 VMS__suspend_procr( VirtProcr *callingPr ); 186 VMS__suspend_procr( VirtProcr *callingPr );
164 187
165 void 188 void