Mercurial > cgi-bin > hgwebdir.cgi > VMS > VMS_Implementations > VMS_impls > VMS__MC_shared_impl
comparison VMS.h @ 132:dbfc8382d546
distributed memory allocation interface - unfinished
| author | Merten Sach <msach@mailbox.tu-berlin.de> |
|---|---|
| date | Fri, 16 Sep 2011 14:25:49 +0200 |
| parents | 24466227d8bb |
| children | a9b72021f053 |
comparison
equal
deleted
inserted
replaced
| 55:0499200fe588 | 58:e26dcf8e33b7 |
|---|---|
| 3 * Licensed under GNU General Public License version 2 | 3 * Licensed under GNU General Public License version 2 |
| 4 * | 4 * |
| 5 * Author: seanhalle@yahoo.com | 5 * Author: seanhalle@yahoo.com |
| 6 * | 6 * |
| 7 */ | 7 */ |
| 8 | |
| 9 #ifndef _VMS_H | 8 #ifndef _VMS_H |
| 10 #define _VMS_H | 9 #define _VMS_H |
| 11 #define _GNU_SOURCE | 10 #define _GNU_SOURCE |
| 12 | 11 |
| 13 #include "VMS_primitive_data_types.h" | 12 #include "VMS_primitive_data_types.h" |
| 109 | 108 |
| 110 | 109 |
| 111 //=========================================================================== | 110 //=========================================================================== |
| 112 typedef unsigned long long TSCount; | 111 typedef unsigned long long TSCount; |
| 113 | 112 |
| 114 typedef struct _SchedSlot SchedSlot; | |
| 115 typedef struct _VMSReqst VMSReqst; | 113 typedef struct _VMSReqst VMSReqst; |
| 116 typedef struct _VirtProcr VirtProcr; | |
| 117 typedef struct _InterMasterReqst InterMasterReqst; | 114 typedef struct _InterMasterReqst InterMasterReqst; |
| 118 typedef struct _IntervalProbe IntervalProbe; | 115 typedef struct _IntervalProbe IntervalProbe; |
| 119 typedef struct _GateStruc GateStruc; | 116 typedef struct _GateStruc GateStruc; |
| 120 | 117 |
| 121 | 118 |
| 213 void *pluginReq; //plugin will cast to approp type | 210 void *pluginReq; //plugin will cast to approp type |
| 214 } InterPluginReqst; | 211 } InterPluginReqst; |
| 215 | 212 |
| 216 //==================== Core data structures =================== | 213 //==================== Core data structures =================== |
| 217 | 214 |
| 218 struct _SchedSlot | |
| 219 { | |
| 220 int workIsDone; | |
| 221 int needsProcrAssigned; | |
| 222 VirtProcr *procrAssignedToSlot; | |
| 223 }; | |
| 224 //SchedSlot | |
| 225 | |
| 226 /*WARNING: re-arranging this data structure could cause VP switching | |
| 227 * assembly code to fail -- hard-codes offsets of fields | |
| 228 */ | |
| 229 struct _VirtProcr | |
| 230 { int procrID; //for debugging -- count up each time create | |
| 231 int coreAnimatedBy; | |
| 232 void *startOfStack; | |
| 233 void *stackPtr; | |
| 234 void *framePtr; | |
| 235 void *nextInstrPt; | |
| 236 | |
| 237 void *coreLoopStartPt; //allows proto-runtime to be linked later | |
| 238 void *coreLoopFramePtr; //restore before jmp back to core loop | |
| 239 void *coreLoopStackPtr; //restore before jmp back to core loop | |
| 240 | |
| 241 void *initialData; | |
| 242 | |
| 243 SchedSlot *schedSlot; | |
| 244 VMSReqst *requests; | |
| 245 | |
| 246 void *semanticData; //this livesUSE_GNU here for the life of VP | |
| 247 void *dataRetFromReq;//values returned from plugin to VP go here | |
| 248 | |
| 249 //=========== MEASUREMENT STUFF ========== | |
| 250 #ifdef MEAS__TIME_STAMP_SUSP | |
| 251 unsigned int preSuspTSCLow; | |
| 252 unsigned int postSuspTSCLow; | |
| 253 #endif | |
| 254 #ifdef MEAS__TIME_MASTER /* in VirtProcr because multiple masterVPs*/ | |
| 255 unsigned int startMasterTSCLow;USE_GNU | |
| 256 unsigned int endMasterTSCLow; | |
| 257 #endif | |
| 258 //======================================== | |
| 259 | |
| 260 float64 createPtInSecs; //have space but don't use on some configs | |
| 261 }; | |
| 262 //VirtProcr | |
| 263 | |
| 264 | |
| 265 /*Master Env is the only global variable -- has entry points for any other | 215 /*Master Env is the only global variable -- has entry points for any other |
| 266 * data needed. | 216 * data needed. |
| 267 */ | 217 */ |
| 268 typedef struct | 218 typedef struct |
| 269 { | 219 { |
| 274 VMSQueueStruc **readyToAnimateQs; | 224 VMSQueueStruc **readyToAnimateQs; |
| 275 VirtProcr **masterVPs; | 225 VirtProcr **masterVPs; |
| 276 | 226 |
| 277 void *semanticEnv; | 227 void *semanticEnv; |
| 278 void *OSEventStruc; //for future, when add I/O to BLIS | 228 void *OSEventStruc; //for future, when add I/O to BLIS |
| 279 MallocProlog *freeListHead; | |
| 280 int32 amtOfOutstandingMem; //total currently allocated | |
| 281 | 229 |
| 282 void *coreLoopReturnPt;//addr to jump to to re-enter coreLoop | 230 void *coreLoopReturnPt;//addr to jump to to re-enter coreLoop |
| 283 | 231 |
| 284 int32 setupComplete; | 232 int32 setupComplete; |
| 285 volatile int32 masterLock; | 233 volatile int32 masterLock; |
| 234 | |
| 235 MallocProlog *freeListHead[NUM_CORES]; | |
| 236 int32 amtOfOutstandingMem; //total currently allocated | |
| 286 | 237 |
| 287 int32 numMasterInARow[NUM_CORES];//detect back-to-back masterVP | 238 int32 numMasterInARow[NUM_CORES];//detect back-to-back masterVP |
| 288 GateStruc *workStealingGates[ NUM_CORES ]; //concurrent work-steal | 239 GateStruc *workStealingGates[NUM_CORES]; //concurrent work-steal |
| 289 int32 workStealingLock; | 240 int32 workStealingLock; |
| 290 | 241 |
| 291 InterMasterReqst* interMasterRequestsFor[NUM_CORES]; | 242 InterMasterReqst* interMasterRequestsFor[NUM_CORES]; |
| 292 RequestHandler interPluginReqHdlr; | 243 RequestHandler interPluginReqHdlr; |
| 293 | 244 |
| 294 int32 numProcrsCreated; //gives ordering to processor creation | 245 int32 numProcrsCreated; //gives ordering to processor creation |
| 246 | |
| 247 int32 currentMasterProcrID; | |
| 295 | 248 |
| 296 //=========== MEASUREMENT STUFF ============= | 249 //=========== MEASUREMENT STUFF ============= |
| 297 IntervalProbe **intervalProbes; | 250 IntervalProbe **intervalProbes; |
| 298 PrivDynArrayInfo *dynIntervalProbesInfo; | 251 PrivDynArrayInfo *dynIntervalProbesInfo; |
| 299 HashTable *probeNameHashTbl; | 252 HashTable *probeNameHashTbl; |
