Mercurial > cgi-bin > hgwebdir.cgi > VMS > VMS_Implementations > VMS_impls > VMS__MC_shared_impl
changeset 235:ecbf6992dab4 Common_Ancestor
debugging -- made master lock padding arch indep -- changed schedSlot to animSlot
| author | Some Random Person <seanhalle@yahoo.com> |
|---|---|
| date | Fri, 16 Mar 2012 23:40:55 -0700 |
| parents | 0ee1a3c8972d |
| children | d9053472d0db |
| files | AnimationMaster.c CoreController.c Defines/VMS_defs__turn_on_and_off.h Hardware_Dependent/VMS__primitives_asm.s Services_Offered_by_VMS/Debugging/DEBUG__macros.h Services_Offered_by_VMS/Measurement_and_Stats/probes.c VMS.h VMS__int.c VMS__startup_and_shutdown.c |
| diffstat | 9 files changed, 111 insertions(+), 93 deletions(-) [+] |
line diff
1.1 --- a/AnimationMaster.c Fri Mar 16 10:43:15 2012 -0700 1.2 +++ b/AnimationMaster.c Fri Mar 16 23:40:55 2012 -0700 1.3 @@ -12,14 +12,6 @@ 1.4 #include "VMS.h" 1.5 1.6 1.7 -//========================= Local Fn Prototypes ============================= 1.8 -void inline 1.9 -stealWorkInto( SchedSlot *currSlot, VMSQueueStruc *readyToAnimateQ, 1.10 - SlaveVP *masterVP ); 1.11 - 1.12 -//=========================================================================== 1.13 - 1.14 - 1.15 1.16 /*The animationMaster embodies most of the animator of the language. The 1.17 * animator is what emodies the behavior of language constructs. 1.18 @@ -129,7 +121,7 @@ 1.19 { 1.20 //Used while scanning and filling animation slots 1.21 int32 slotIdx, numSlotsFilled; 1.22 - SchedSlot *currSlot, **schedSlots; 1.23 + AnimSlot *currSlot, **animSlots; 1.24 SlaveVP *assignedSlaveVP; //the slave chosen by the assigner 1.25 1.26 //Local copies, for performance 1.27 @@ -143,7 +135,7 @@ 1.28 masterEnv = (MasterEnv*)_VMSMasterEnv; 1.29 1.30 thisCoresIdx = masterVP->coreAnimatedBy; 1.31 - schedSlots = masterEnv->allSchedSlots[thisCoresIdx]; 1.32 + animSlots = masterEnv->allAnimSlots[thisCoresIdx]; 1.33 1.34 requestHandler = masterEnv->requestHandler; 1.35 slaveAssigner = masterEnv->slaveAssigner; 1.36 @@ -159,7 +151,7 @@ 1.37 numSlotsFilled = 0; 1.38 for( slotIdx = 0; slotIdx < NUM_SCHED_SLOTS; slotIdx++) 1.39 { 1.40 - currSlot = schedSlots[ slotIdx ]; 1.41 + currSlot = animSlots[ slotIdx ]; 1.42 1.43 //Check if newly-done slave in slot, which will need request handld 1.44 if( currSlot->workIsDone ) 1.45 @@ -183,7 +175,7 @@ 1.46 //put the chosen slave into slot, and adjust flags and state 1.47 if( assignedSlaveVP != NULL ) 1.48 { currSlot->slaveAssignedToSlot = assignedSlaveVP; 1.49 - assignedSlaveVP->schedSlotAssignedTo = currSlot; 1.50 + assignedSlaveVP->animSlotAssignedTo = currSlot; 1.51 currSlot->needsSlaveAssigned = FALSE; 1.52 numSlotsFilled += 1; 1.53 } 1.54 @@ -194,6 +186,7 @@ 1.55 1.56 masterSwitchToCoreCtlr( masterVP ); 1.57 flushRegisters(); 1.58 + DEBUG__printf(FALSE,"came back after switch to core -- so lock released!"); 1.59 }//while(1) 1.60 } 1.61
2.1 --- a/CoreController.c Fri Mar 16 10:43:15 2012 -0700 2.2 +++ b/CoreController.c Fri Mar 16 23:40:55 2012 -0700 2.3 @@ -72,7 +72,7 @@ 2.4 int32 thisCoresIdx; 2.5 int32 numRepetitionsWithNoWork; 2.6 SlaveVP *currVP; 2.7 - SchedSlot *currSlot, **schedSlots; 2.8 + AnimSlot *currSlot, **animSlots; 2.9 int32 currSlotIdx; 2.10 volatile int32 *addrOfMasterLock; //thing pointed to is volatile, not ptr 2.11 SlaveVP *thisCoresMasterVP; 2.12 @@ -94,7 +94,7 @@ 2.13 //Assembly that saves addr of label of return instr -- label in assmbly 2.14 recordCoreCtlrReturnLabelAddr((void**)&(_VMSMasterEnv->coreCtlrReturnPt)); 2.15 2.16 - schedSlots = _VMSMasterEnv->allSchedSlots[thisCoresIdx]; 2.17 + animSlots = _VMSMasterEnv->allAnimSlots[thisCoresIdx]; 2.18 currSlotIdx = 0; //start at slot 0, go up until one empty, then do master 2.19 numRepetitionsWithNoWork = 0; 2.20 addrOfMasterLock = &(_VMSMasterEnv->masterLock); 2.21 @@ -117,6 +117,8 @@ 2.22 { pthread_cond_wait( &suspendCond, &suspendLock ); 2.23 } 2.24 pthread_mutex_unlock( &suspendLock ); 2.25 + 2.26 + DEBUG__printf1(TRUE, "started coreCtrlr", thisCoresIdx ); 2.27 2.28 //====================== The Core Controller ====================== 2.29 while(1) //An endless loop is just one way of doing the control structure 2.30 @@ -131,10 +133,9 @@ 2.31 // switchToSlv() call. Then control loops back to here. 2.32 //Alternatively, the VP suspend primitive could just not bother 2.33 // returning from switchToSlv, and instead jmp directly to here. 2.34 - DEBUG_Print1(TRUE, "started coreCtrl", thisCoresIdx ); 2.35 2.36 if( currSlotIdx >= NUM_SCHED_SLOTS ) goto switchToMaster; 2.37 - currSlot = schedSlots[ currSlotIdx ]; 2.38 + currSlot = animSlots[ currSlotIdx ]; 2.39 2.40 if( ! currSlot->needsSlaveAssigned ) //slot does have slave assigned 2.41 { numRepetitionsWithNoWork = 0; //reset back2back master count 2.42 @@ -274,13 +275,13 @@ 2.43 int32 thisCoresIdx; 2.44 int32 numRepetitionsWithNoWork; 2.45 SlaveVP *currVP; 2.46 - SchedSlot *currSlot, **schedSlots; 2.47 + AnimSlot *currSlot, **animSlots; 2.48 int32 currSlotIdx; 2.49 int32 *addrOfMasterLock; 2.50 SlaveVP *thisCoresMasterVP; 2.51 2.52 //=============== Initializations =================== 2.53 - schedSlots = _VMSMasterEnv->allSchedSlots[thisCoresIdx]; 2.54 + animSlots = _VMSMasterEnv->allAnimSlots[thisCoresIdx]; 2.55 currSlotIdx = 0; //start at slot 0, go up until one empty, then do master 2.56 numRepetitionsWithNoWork = 0; 2.57 addrOfMasterLock = &(_VMSMasterEnv->masterLock); 2.58 @@ -296,7 +297,7 @@ 2.59 while(1) 2.60 { 2.61 if( currSlotIdx >= NUM_SCHED_SLOTS ) goto switchToMaster; 2.62 - currSlot = schedSlots[ currSlotIdx ]; 2.63 + currSlot = animSlots[ currSlotIdx ]; 2.64 2.65 if( ! currSlot->needsSlaveAssigned ) //slot does have slave assigned 2.66 { numRepetitionsWithNoWork = 0; //reset B2B master count
3.1 --- a/Defines/VMS_defs__turn_on_and_off.h Fri Mar 16 10:43:15 2012 -0700 3.2 +++ b/Defines/VMS_defs__turn_on_and_off.h Fri Mar 16 23:40:55 2012 -0700 3.3 @@ -21,7 +21,7 @@ 3.4 /*turns on the probe-instrumentation in the application -- when not 3.5 * defined, the calls to the probe functions turn into comments 3.6 */ 3.7 -//#define DEBUG__TURN_ON_DEBUG_PRINT 3.8 +#define DEBUG__TURN_ON_DEBUG_PRINT 3.9 3.10 /*These defines turn types of bug messages on and off 3.11 */
4.1 --- a/Hardware_Dependent/VMS__primitives_asm.s Fri Mar 16 10:43:15 2012 -0700 4.2 +++ b/Hardware_Dependent/VMS__primitives_asm.s Fri Mar 16 23:40:55 2012 -0700 4.3 @@ -32,7 +32,7 @@ 4.4 * 4.5 * _VMSMasterEnv offsets: 4.6 * 0x00 coreCtlrReturnPt 4.7 - * 0x08 masterLock 4.8 + * 0x100 masterLock 4.9 */ 4.10 .globl switchToSlv 4.11 switchToSlv: 4.12 @@ -57,7 +57,7 @@ 4.13 * 4.14 * _VMSMasterEnv offsets: 4.15 * 0x00 coreCtlrReturnPt 4.16 - * 0x08 masterLock 4.17 + * 0x100 masterLock 4.18 */ 4.19 .globl switchToCoreCtlr 4.20 switchToCoreCtlr: 4.21 @@ -87,7 +87,7 @@ 4.22 * 4.23 * _VMSMasterEnv offsets: 4.24 * 0x00 coreCtlrReturnPt 4.25 - * 0x08 masterLock 4.26 + * 0x100 masterLock 4.27 */ 4.28 .globl masterSwitchToCoreCtlr 4.29 masterSwitchToCoreCtlr: 4.30 @@ -100,7 +100,7 @@ 4.31 movq $_VMSMasterEnv, %rcx 4.32 movq (%rcx), %rcx #_VMSMasterEnv is pointer to struct 4.33 movq 0x00(%rcx), %rax #get CoreCtlr return pt 4.34 - movl $0x0 , 0x100(%rcx) #release lock 4.35 + movl $0x0 , 0x100(%rcx) #release lock 4.36 jmp *%rax #jmp to CoreCtlr 4.37 MasterReturn: 4.38 ret 4.39 @@ -123,7 +123,7 @@ 4.40 * 4.41 * _VMSMasterEnv offsets: 4.42 * 0x00 coreCtlrReturnPt 4.43 - * 0x08 masterLock 4.44 + * 0x100 masterLock 4.45 */ 4.46 .globl asmTerminateCoreCtlr 4.47 asmTerminateCoreCtlr: #SlaveVP ptr is in %rdi
5.1 --- a/Services_Offered_by_VMS/Debugging/DEBUG__macros.h Fri Mar 16 10:43:15 2012 -0700 5.2 +++ b/Services_Offered_by_VMS/Debugging/DEBUG__macros.h Fri Mar 16 23:40:55 2012 -0700 5.3 @@ -13,16 +13,37 @@ 5.4 /* 5.5 */ 5.6 #ifdef DEBUG__TURN_ON_DEBUG_PRINT 5.7 - #define DEBUG_Print( bool, msg) \ 5.8 - if( bool){ printf(msg); fflush(stdin);} 5.9 - #define DEBUG_Print1( bool, msg, param) \ 5.10 - if(bool){printf(msg, param); fflush(stdin);} 5.11 - #define DEBUG_Print2( bool, msg, p1, p2) \ 5.12 - if(bool) {printf(msg, p1, p2); fflush(stdin);} 5.13 + #define DEBUG__printf( bool, msg) \ 5.14 + do{\ 5.15 + if(bool)\ 5.16 + { printf(msg);\ 5.17 + printf(" | function: %s\n", __FUNCTION__);\ 5.18 + fflush(stdin);\ 5.19 + }\ 5.20 + }while(0);/*macro magic to isolate var-names*/ 5.21 + 5.22 + #define DEBUG__printf1( bool, msg, param) \ 5.23 + do{\ 5.24 + if(bool)\ 5.25 + { printf(msg, param);\ 5.26 + printf(" | function: %s\n", __FUNCTION__);\ 5.27 + fflush(stdin);\ 5.28 + }\ 5.29 + }while(0);/*macro magic to isolate var-names*/ 5.30 + 5.31 + #define DEBUG__printf2( bool, msg, p1, p2) \ 5.32 + do{\ 5.33 + if(bool)\ 5.34 + { printf(msg, p1, p2); \ 5.35 + printf(" | function: %s\n", __FUNCTION__);\ 5.36 + fflush(stdin);\ 5.37 + }\ 5.38 + }while(0);/*macro magic to isolate var-names*/ 5.39 + 5.40 #else 5.41 - #define DEBUG_Print( bool, msg) 5.42 - #define DEBUG_Print1( bool, msg, param) 5.43 - #define DEBUG_Print2( bool, msg, p1, p2) 5.44 + #define DEBUG__printf( bool, msg) 5.45 + #define DEBUG__printf1( bool, msg, param) 5.46 + #define DEBUG__printf2( bool, msg, p1, p2) 5.47 #endif 5.48 5.49 //============================= ERROR MSGs ============================
6.1 --- a/Services_Offered_by_VMS/Measurement_and_Stats/probes.c Fri Mar 16 10:43:15 2012 -0700 6.2 +++ b/Services_Offered_by_VMS/Measurement_and_Stats/probes.c Fri Mar 16 23:40:55 2012 -0700 6.3 @@ -199,7 +199,7 @@ 6.4 VMS_impl__record_interval_start_in_probe( int32 probeID ) 6.5 { IntervalProbe *probe; 6.6 6.7 - DEBUG_Print( dbgProbes, "record start of interval\n" ) 6.8 + DEBUG__printf( dbgProbes, "record start of interval" ) 6.9 probe = _VMSMasterEnv->intervalProbes[ probeID ]; 6.10 6.11 //record *start* point as last thing, after lookup 6.12 @@ -253,7 +253,7 @@ 6.13 6.14 #endif 6.15 6.16 - DEBUG_Print( dbgProbes, "record end of interval\n" ) 6.17 + DEBUG__printf( dbgProbes, "record end of interval" ) 6.18 } 6.19 6.20
7.1 --- a/VMS.h Fri Mar 16 10:43:15 2012 -0700 7.2 +++ b/VMS.h Fri Mar 16 23:40:55 2012 -0700 7.3 @@ -31,14 +31,14 @@ 7.4 // 7.5 typedef unsigned long long TSCount; 7.6 7.7 -typedef struct _SchedSlot SchedSlot; 7.8 +typedef struct _AnimSlot AnimSlot; 7.9 typedef struct _VMSReqst VMSReqst; 7.10 typedef struct _SlaveVP SlaveVP; 7.11 typedef struct _MasterVP MasterVP; 7.12 typedef struct _IntervalProbe IntervalProbe; 7.13 7.14 7.15 -typedef SlaveVP *(*SlaveAssigner) ( void *, SchedSlot*); //semEnv, slot for HW info 7.16 +typedef SlaveVP *(*SlaveAssigner) ( void *, AnimSlot*); //semEnv, slot for HW info 7.17 typedef void (*RequestHandler) ( SlaveVP *, void * ); //prWReqst, semEnv 7.18 typedef void (*TopLevelFnPtr) ( void *, SlaveVP * ); //initData, animSlv 7.19 typedef void TopLevelFn ( void *, SlaveVP * ); //initData, animSlv 7.20 @@ -96,7 +96,7 @@ 7.21 } 7.22 SlotPerfInfo; 7.23 7.24 -struct _SchedSlot 7.25 +struct _AnimSlot 7.26 { 7.27 int workIsDone; 7.28 int needsSlaveAssigned; 7.29 @@ -106,7 +106,7 @@ 7.30 int coreOfSlot; 7.31 SlotPerfInfo *perfInfo; //used by assigner to pick best slave for core 7.32 }; 7.33 -//SchedSlot 7.34 +//AnimSlot 7.35 7.36 enum VPtype { 7.37 Slave = 1, //default 7.38 @@ -126,26 +126,27 @@ 7.39 void *coreCtlrStackPtr; //restore before jmp back to core controller 7.40 7.41 //============ below this, no fields are used in asm ============= 7.42 - int slaveID; //each slave given a globally unique ID 7.43 - int coreAnimatedBy; 7.44 + 7.45 + int slaveID; //each slave given a globally unique ID 7.46 + int coreAnimatedBy; 7.47 void *startOfStack; //used to free, and to point slave to Fn 7.48 + enum VPtype typeOfVP; //Slave vs Master vs Shutdown.. 7.49 + int assignCount; //Each assign is for one work-unit, so IDs it 7.50 + //note, a scheduling decision is uniquely identified by the triple: 7.51 + // <slaveID, coreAnimatedBy, assignCount> -- used in record & replay 7.52 7.53 //for comm -- between master and coreCtlr & btwn wrapper lib and plugin 7.54 - SchedSlot *schedSlotAssignedTo; 7.55 + AnimSlot *animSlotAssignedTo; 7.56 VMSReqst *requests; //wrapper lib puts in requests, plugin takes out 7.57 void *dataRetFromReq;//Return vals from plugin to Wrapper Lib 7.58 7.59 - //Slave used as carrier for data 7.60 + //For using Slave as carrier for data 7.61 void *semanticData; //Lang saves lang-specific things in slave here 7.62 7.63 - //=========== MEASUREMENT STUFF ========== 7.64 - MEAS__Insert_Meas_Fields_into_Slave; 7.65 - //======================================== 7.66 - 7.67 - enum VPtype type; 7.68 - int numTimesAssigned; 7.69 - 7.70 - float64 createPtInSecs; //have space but don't use on some configs 7.71 + //=========== MEASUREMENT STUFF ========== 7.72 + MEAS__Insert_Meas_Fields_into_Slave; 7.73 + float64 createPtInSecs; //time VP created, in seconds 7.74 + //======================================== 7.75 }; 7.76 //SlaveVP 7.77 7.78 @@ -155,13 +156,14 @@ 7.79 typedef struct 7.80 { //The offsets of these fields are hard-coded into assembly 7.81 void *coreCtlrReturnPt; //offset of field used in asm 7.82 - int32 masterLock __align_to_cacheline__; //used in asm 7.83 - 7.84 + int8 falseSharePad1[256 - sizeof(void*)]; 7.85 + int32 masterLock; //offset of field used in asm 7.86 + int8 falseSharePad2[256 - sizeof(int32)]; 7.87 //============ below this, no fields are used in asm ============= 7.88 7.89 //Basic VMS infrastructure 7.90 SlaveVP **masterVPs; 7.91 - SchedSlot ***allSchedSlots; 7.92 + AnimSlot ***allAnimSlots; 7.93 7.94 //plugin related 7.95 SlaveAssigner slaveAssigner;
8.1 --- a/VMS__int.c Fri Mar 16 10:43:15 2012 -0700 8.2 +++ b/VMS__int.c Fri Mar 16 23:40:55 2012 -0700 8.3 @@ -78,8 +78,8 @@ 8.4 // "return" from this call. 8.5 //animatingSlv->resumeInstrPtr = &&ResumePt; 8.6 8.7 - //return ownership of the Slv and sched slot to Master virt pr 8.8 - animatingSlv->schedSlotAssignedTo->workIsDone = TRUE; 8.9 + //return ownership of the Slv and anim slot to Master virt pr 8.10 + animatingSlv->animSlotAssignedTo->workIsDone = TRUE; 8.11 8.12 MEAS__Capture_Pre_Susp_Point; 8.13 switchToCoreCtlr(animatingSlv); 8.14 @@ -137,9 +137,9 @@ 8.15 void 8.16 VMS_int__dissipate_slaveVP( SlaveVP *animatingSlv ) 8.17 { 8.18 + DEBUG__printf2(dbgRqstHdlr, "dissipate: %d, alive: %d",animatingSlv->slaveID, _VMSMasterEnv->numSlavesAlive-1); 8.19 //dis-own all locations owned by this processor, causing to be freed 8.20 // any locations that it is (was) sole owner of 8.21 - 8.22 _VMSMasterEnv->numSlavesAlive -= 1; 8.23 if( _VMSMasterEnv->numSlavesAlive == 0 ) 8.24 { //no more work, so shutdown 8.25 @@ -174,9 +174,9 @@ 8.26 newSlv->startOfStack = stackLocs; 8.27 newSlv->slaveID = _VMSMasterEnv->numSlavesCreated++; 8.28 newSlv->requests = NULL; 8.29 - newSlv->schedSlotAssignedTo = NULL; 8.30 - newSlv->type = Slave; 8.31 - newSlv->numTimesAssigned = 0; 8.32 + newSlv->animSlotAssignedTo = NULL; 8.33 + newSlv->typeOfVP = Slave; 8.34 + newSlv->assignCount = 0; 8.35 8.36 VMS_int__point_slaveVP_to_Fn( newSlv, fnPtr, dataParam ); 8.37
9.1 --- a/VMS__startup_and_shutdown.c Fri Mar 16 10:43:15 2012 -0700 9.2 +++ b/VMS__startup_and_shutdown.c Fri Mar 16 23:40:55 2012 -0700 9.3 @@ -28,8 +28,8 @@ 9.4 9.5 9.6 //=========================================================================== 9.7 -SchedSlot ** 9.8 -create_sched_slots(); 9.9 +AnimSlot ** 9.10 +create_anim_slots(); 9.11 9.12 void 9.13 create_masterEnv(); 9.14 @@ -82,7 +82,7 @@ 9.15 printf( "\n\n Running in SEQUENTIAL mode \n\n" ); 9.16 #else 9.17 create_masterEnv(); 9.18 - printf("Offset of lock in masterEnv:%d\n",offsetof(MasterEnv,masterLock)); 9.19 + DEBUG__printf1(TRUE,"Offset of lock in masterEnv: %d ", (int32)offsetof(MasterEnv,masterLock) ); 9.20 create_the_coreCtlr_OS_threads(); 9.21 #endif 9.22 } 9.23 @@ -274,7 +274,7 @@ 9.24 VMSQueueStruc **readyToAnimateQs; 9.25 int coreIdx; 9.26 SlaveVP **masterVPs; 9.27 - SchedSlot ***allSchedSlots; //ptr to array of ptrs 9.28 + AnimSlot ***allAnimSlots; //ptr to array of ptrs 9.29 9.30 9.31 //Make the master env, which holds everything else 9.32 @@ -294,7 +294,7 @@ 9.33 masterVPs = VMS_int__malloc( NUM_CORES * sizeof(SlaveVP *) ); 9.34 9.35 //One array for each core, several in array, core's masterVP scheds all 9.36 - allSchedSlots = VMS_int__malloc( NUM_CORES * sizeof(SchedSlot *) ); 9.37 + allAnimSlots = VMS_int__malloc( NUM_CORES * sizeof(AnimSlot *) ); 9.38 9.39 _VMSMasterEnv->numSlavesAlive = 0; //used to detect shut-down condition 9.40 9.41 @@ -306,12 +306,12 @@ 9.42 //Q: should give masterVP core-specific info as its init data? 9.43 masterVPs[ coreIdx ] = VMS_int__create_slaveVP( (TopLevelFnPtr)&animationMaster, (void*)masterEnv ); 9.44 masterVPs[ coreIdx ]->coreAnimatedBy = coreIdx; 9.45 - masterVPs[ coreIdx ]->type = Master; 9.46 - allSchedSlots[ coreIdx ] = create_sched_slots(); //makes for one core 9.47 + masterVPs[ coreIdx ]->typeOfVP = Master; 9.48 + allAnimSlots[ coreIdx ] = create_anim_slots(); //makes for one core 9.49 } 9.50 _VMSMasterEnv->masterVPs = masterVPs; 9.51 _VMSMasterEnv->masterLock = UNLOCKED; 9.52 - _VMSMasterEnv->allSchedSlots = allSchedSlots; 9.53 + _VMSMasterEnv->allAnimSlots = allAnimSlots; 9.54 _VMSMasterEnv->measHistsInfo = NULL; 9.55 9.56 //============================= MEASUREMENT STUFF ======================== 9.57 @@ -330,34 +330,34 @@ 9.58 //======================================================================== 9.59 } 9.60 9.61 -SchedSlot ** 9.62 -create_sched_slots() 9.63 - { SchedSlot **schedSlots; 9.64 +AnimSlot ** 9.65 +create_anim_slots() 9.66 + { AnimSlot **animSlots; 9.67 int i; 9.68 9.69 - schedSlots = VMS_int__malloc( NUM_SCHED_SLOTS * sizeof(SchedSlot *) ); 9.70 + animSlots = VMS_int__malloc( NUM_SCHED_SLOTS * sizeof(AnimSlot *) ); 9.71 9.72 for( i = 0; i < NUM_SCHED_SLOTS; i++ ) 9.73 { 9.74 - schedSlots[i] = VMS_int__malloc( sizeof(SchedSlot) ); 9.75 + animSlots[i] = VMS_int__malloc( sizeof(AnimSlot) ); 9.76 9.77 //Set state to mean "handling requests done, slot needs filling" 9.78 - schedSlots[i]->workIsDone = FALSE; 9.79 - schedSlots[i]->needsSlaveAssigned = TRUE; 9.80 - schedSlots[i]->slotIdx = i; //quick retrieval of slot pos 9.81 + animSlots[i]->workIsDone = FALSE; 9.82 + animSlots[i]->needsSlaveAssigned = TRUE; 9.83 + animSlots[i]->slotIdx = i; //quick retrieval of slot pos 9.84 } 9.85 - return schedSlots; 9.86 + return animSlots; 9.87 } 9.88 9.89 9.90 void 9.91 -freeSchedSlots( SchedSlot **schedSlots ) 9.92 +freeAnimSlots( AnimSlot **animSlots ) 9.93 { int i; 9.94 for( i = 0; i < NUM_SCHED_SLOTS; i++ ) 9.95 { 9.96 - VMS_int__free( schedSlots[i] ); 9.97 + VMS_int__free( animSlots[i] ); 9.98 } 9.99 - VMS_int__free( schedSlots ); 9.100 + VMS_int__free( animSlots ); 9.101 } 9.102 9.103 9.104 @@ -374,6 +374,7 @@ 9.105 _VMSMasterEnv->setupComplete = 0; 9.106 9.107 //initialize the cond used to make the new threads wait and sync up 9.108 + //must do this before *creating* the threads.. 9.109 pthread_mutex_init( &suspendLock, NULL ); 9.110 pthread_cond_init( &suspendCond, NULL ); 9.111 9.112 @@ -400,8 +401,8 @@ 9.113 9.114 9.115 void 9.116 -VMS_SS__register_sched_assigner( SlaveAssigner schedAssigner ) 9.117 - { _VMSMasterEnv->slaveAssigner = schedAssigner; 9.118 +VMS_SS__register_anim_assigner( SlaveAssigner animAssigner ) 9.119 + { _VMSMasterEnv->slaveAssigner = animAssigner; 9.120 } 9.121 9.122 VMS_SS__register_semantic_env( void *semanticEnv ) 9.123 @@ -456,7 +457,7 @@ 9.124 SlaveVP* shutdownVP; 9.125 9.126 shutdownVP = VMS_int__create_slaveVP( &endOSThreadFn, NULL ); 9.127 - shutdownVP->type = Shutdown; 9.128 + shutdownVP->typeOfVP = Shutdown; 9.129 9.130 return shutdownVP; 9.131 } 9.132 @@ -497,19 +498,19 @@ 9.133 VMS_SS__shutdown() 9.134 { int32 coreIdx; 9.135 SlaveVP *shutDownSlv; 9.136 - SchedSlot **schedSlots; 9.137 + AnimSlot **animSlots; 9.138 //create the shutdown processors, one for each core controller -- put them 9.139 // directly into the Q -- each core will die when gets one 9.140 for( coreIdx = 0; coreIdx < NUM_CORES; coreIdx++ ) 9.141 { //Note, this is running in the master 9.142 shutDownSlv = VMS_SS__create_shutdown_slave(); 9.143 //last slave has dissipated, so no more in slots, so write 9.144 - // shut down slave into first schedulng slot. 9.145 - schedSlots = _VMSMasterEnv->allSchedSlots[ coreIdx ]; 9.146 - schedSlots[0]->slaveAssignedToSlot = shutDownSlv; 9.147 - schedSlots[0]->needsSlaveAssigned = FALSE; 9.148 + // shut down slave into first animulng slot. 9.149 + animSlots = _VMSMasterEnv->allAnimSlots[ coreIdx ]; 9.150 + animSlots[0]->slaveAssignedToSlot = shutDownSlv; 9.151 + animSlots[0]->needsSlaveAssigned = FALSE; 9.152 shutDownSlv->coreAnimatedBy = coreIdx; 9.153 - shutDownSlv->schedSlotAssignedTo = schedSlots[ 0 ]; 9.154 + shutDownSlv->animSlotAssignedTo = animSlots[ 0 ]; 9.155 } 9.156 } 9.157 9.158 @@ -562,7 +563,7 @@ 9.159 /* 9.160 readyToAnimateQs = _VMSMasterEnv->readyToAnimateQs; 9.161 masterVPs = _VMSMasterEnv->masterVPs; 9.162 - allSchedSlots = _VMSMasterEnv->allSchedSlots; 9.163 + allAnimSlots = _VMSMasterEnv->allAnimSlots; 9.164 9.165 for( coreIdx = 0; coreIdx < NUM_CORES; coreIdx++ ) 9.166 { 9.167 @@ -570,12 +571,12 @@ 9.168 //master Slvs were created external to VMS, so use external free 9.169 VMS_int__dissipate_slaveVP( masterVPs[ coreIdx ] ); 9.170 9.171 - freeSchedSlots( allSchedSlots[ coreIdx ] ); 9.172 + freeAnimSlots( allAnimSlots[ coreIdx ] ); 9.173 } 9.174 9.175 VMS_int__free( _VMSMasterEnv->readyToAnimateQs ); 9.176 VMS_int__free( _VMSMasterEnv->masterVPs ); 9.177 - VMS_int__free( _VMSMasterEnv->allSchedSlots ); 9.178 + VMS_int__free( _VMSMasterEnv->allAnimSlots ); 9.179 9.180 //============================= MEASUREMENT STUFF ======================== 9.181 #ifdef PROBES__TURN_ON_STATS_PROBES
