comparison VMS.h @ 53:42dd44df1bb0

Init changed to only use VMS__malloc & uses VMS__malloc versions of utilities
author Me
date Mon, 01 Nov 2010 21:21:32 -0700
parents f59cfa31a579
children f8508572f3de
comparison
equal deleted inserted replaced
20:6174d99dfaab 21:c35666352d5a
63 // balance amortizing master fixed overhead vs imbalance potential 63 // balance amortizing master fixed overhead vs imbalance potential
64 #define NUM_SCHED_SLOTS 3 64 #define NUM_SCHED_SLOTS 3
65 65
66 #define MIN_WORK_UNIT_CYCLES 20000 66 #define MIN_WORK_UNIT_CYCLES 20000
67 67
68 #define READYTOANIMATE_RETRIES 10000 68 #define MASTERLOCK_RETRIES 10000
69 69
70 // stack 70 // stack
71 #define VIRT_PROCR_STACK_SIZE 0x4000 71 #define VIRT_PROCR_STACK_SIZE 0x4000
72 72
73 // memory for VMS__malloc -- 256M 73 // memory for VMS__malloc -- 256M
161 161
162 SchedSlot *schedSlot; 162 SchedSlot *schedSlot;
163 VMSReqst *requests; 163 VMSReqst *requests;
164 164
165 void *semanticData; //this lives here for the life of VP 165 void *semanticData; //this lives here for the life of VP
166 void *dataReturnedFromReq;//values returned from plugin to VP go here 166 void *dataRetFromReq;//values returned from plugin to VP go here
167 167
168 //=========== MEASUREMENT STUFF ========== 168 //=========== MEASUREMENT STUFF ==========
169 #ifdef MEAS__TIME_STAMP_SUSP 169 #ifdef MEAS__TIME_STAMP_SUSP
170 unsigned int preSuspTSCLow; 170 unsigned int preSuspTSCLow;
171 unsigned int postSuspTSCLow; 171 unsigned int postSuspTSCLow;
203 int32 numMasterInARow[NUM_CORES];//detect back-to-back masterVP 203 int32 numMasterInARow[NUM_CORES];//detect back-to-back masterVP
204 int32 numProcrsCreated; //gives ordering to processor creation 204 int32 numProcrsCreated; //gives ordering to processor creation
205 205
206 //=========== MEASUREMENT STUFF ============= 206 //=========== MEASUREMENT STUFF =============
207 IntervalProbe **intervalProbes; 207 IntervalProbe **intervalProbes;
208 DynArrayInfo *dynIntervalProbesInfo; 208 PrivDynArrayInfo *dynIntervalProbesInfo;
209 HashTable *probeNameHashTbl; 209 HashTable *probeNameHashTbl;
210 int32 masterCreateProbeID; 210 int32 masterCreateProbeID;
211 float64 createPtInSecs; 211 float64 createPtInSecs;
212 } 212 }
213 MasterEnv; 213 MasterEnv;
243 243
244 244
245 245
246 //=========================== Function Prototypes ========================= 246 //=========================== Function Prototypes =========================
247 247
248 //============== Setup and shutdown ============= 248
249 //========== Setup and shutdown ==========
249 void 250 void
250 VMS__init(); 251 VMS__init();
251 252
252 void 253 void
253 VMS__init_Seq(); 254 VMS__init_Seq();
258 void 259 void
259 VMS__start_the_work_then_wait_until_done_Seq(); 260 VMS__start_the_work_then_wait_until_done_Seq();
260 261
261 VirtProcr * 262 VirtProcr *
262 VMS__create_procr( VirtProcrFnPtr fnPtr, void *initialData ); 263 VMS__create_procr( VirtProcrFnPtr fnPtr, void *initialData );
264
265 void
266 VMS__dissipate_procr( VirtProcr *procrToDissipate );
263 267
264 //Use this to create processor inside entry point & other places outside 268 //Use this to create processor inside entry point & other places outside
265 // the VMS system boundary (IE, not run in slave nor Master) 269 // the VMS system boundary (IE, not run in slave nor Master)
266 VirtProcr * 270 VirtProcr *
267 VMS_ext__create_procr( VirtProcrFnPtr fnPtr, void *initialData ); 271 VMS_ext__create_procr( VirtProcrFnPtr fnPtr, void *initialData );
268 272
269 VirtProcr * 273 void
270 VMS__create_the_shutdown_procr(); 274 VMS_ext__dissipate_procr( VirtProcr *procrToDissipate );
271 275
272 void 276 void
273 VMS__cleanup_after_shutdown(); 277 VMS__shutdown();
278
279 void
280 VMS__cleanup_at_end_of_shutdown();
274 281
275 282
276 //============== Request Related =============== 283 //============== Request Related ===============
277 284
278 void 285 void
279 VMS__suspend_procr( VirtProcr *callingPr ); 286 VMS__suspend_procr( VirtProcr *callingPr );
280 287
281 inline void 288 inline void
282 VMS__add_sem_request( void *semReqData, VirtProcr *callingPr ); 289 VMS__add_sem_request_in_mallocd_VMSReqst( void *semReqData, VirtProcr *callingPr );
290
291 inline void
292 VMS__send_sem_request( void *semReqData, VirtProcr *callingPr );
283 293
284 void 294 void
285 VMS__send_create_procr_req( void *semReqData, VirtProcr *reqstingPr ); 295 VMS__send_create_procr_req( void *semReqData, VirtProcr *reqstingPr );
296
297 void inline
298 VMS__send_dissipate_req( VirtProcr *prToDissipate );
286 299
287 inline void 300 inline void
288 VMS__send_VMSSem_request( void *semReqData, VirtProcr *callingPr ); 301 VMS__send_VMSSem_request( void *semReqData, VirtProcr *callingPr );
289 302
290 void
291 VMS__free_request( VMSReqst *req );
292
293 void
294 VMS__remove_and_free_top_request( VirtProcr *reqstingPr );
295
296 VMSReqst * 303 VMSReqst *
297 VMS__take_next_request_out_of( VirtProcr *procrWithReq ); 304 VMS__take_next_request_out_of( VirtProcr *procrWithReq );
298 305
299 inline void * 306 inline void *
300 VMS__take_sem_reqst_from( VMSReqst *req ); 307 VMS__take_sem_reqst_from( VMSReqst *req );
301 // 308
302 //VMSReqst * 309
303 //VMS__take_top_request_from( VirtProcr *reqstingPr ); 310
304 // 311 //======================== STATS ======================
305 //inline int 312
306 //VMS__isSemanticReqst( VMSReqst *req ); 313 //===== RDTSC wrapper =====
307 //
308 //inline int
309 //VMS__isDissipateReqst( VMSReqst *req );
310 //
311 //inline int
312 //VMS__isCreateReqst( VMSReqst *req );
313
314 //==========================
315
316 void inline
317 VMS__dissipate_procr( VirtProcr *prToDissipate );
318
319 void
320 VMS__handle_dissipate_reqst( VirtProcr *procrToDissipate );
321
322
323
324 //===================== RDTSC wrapper ==================
325 314
326 #define saveTimeStampCountInto(low, high) \ 315 #define saveTimeStampCountInto(low, high) \
327 asm volatile("RDTSC; \ 316 asm volatile("RDTSC; \
328 movl %%eax, %0; \ 317 movl %%eax, %0; \
329 movl %%edx, %1;" \ 318 movl %%edx, %1;" \
337 movl %%eax, %0;" \ 326 movl %%eax, %0;" \
338 /* outputs */ : "=m" (low) \ 327 /* outputs */ : "=m" (low) \
339 /* inputs */ : \ 328 /* inputs */ : \
340 /* clobber */ : "%eax", "%edx" \ 329 /* clobber */ : "%eax", "%edx" \
341 ); 330 );
342 331 //=====
343 //======================== STATS ======================
344 332
345 #include "probes.h" 333 #include "probes.h"
346 334
347 #endif /* _VMS_H */ 335 #endif /* _VMS_H */
348 336