Me@55: /* Me@55: * Copyright 2009 OpenSourceStewardshipFoundation.org Me@55: * Licensed under GNU General Public License version 2 Me@55: * Me@55: * Author: seanhalle@yahoo.com Me@55: * Me@55: */ msach@77: #ifndef _ProcrContext_H msach@77: #define _ProcrContext_H msach@76: #define _GNU_SOURCE Me@55: msach@134: typedef struct _VirtProcr VirtProcr; msach@134: typedef struct _VMSReqst VMSReqst; msach@134: typedef void (*VirtProcrFnPtr) ( void *, VirtProcr * ); //initData, animPr msach@132: msach@134: msach@134: #include "VMS_primitive_data_types.h" msach@134: #include "scheduling.h" msach@132: msach@132: /*WARNING: re-arranging this data structure could cause VP switching msach@132: * assembly code to fail -- hard-codes offsets of fields msach@132: */ msach@132: struct _VirtProcr msach@132: { int procrID; //for debugging -- count up each time create msach@132: int coreAnimatedBy; msach@132: void *startOfStack; msach@132: void *stackPtr; msach@132: void *framePtr; msach@132: void *nextInstrPt; msach@132: msach@132: void *coreLoopStartPt; //allows proto-runtime to be linked later msach@132: void *coreLoopFramePtr; //restore before jmp back to core loop msach@132: void *coreLoopStackPtr; //restore before jmp back to core loop msach@132: msach@132: void *initialData; msach@132: msach@132: SchedSlot *schedSlot; msach@132: VMSReqst *requests; msach@132: msach@132: void *semanticData; msach@132: void *dataRetFromReq; //values returned from plugin to VP go here msach@132: msach@132: //=========== MEASUREMENT STUFF ========== msach@132: #ifdef MEAS__TIME_STAMP_SUSP msach@132: unsigned int preSuspTSCLow; msach@132: unsigned int postSuspTSCLow; msach@132: #endif msach@132: #ifdef MEAS__TIME_MASTER /* in VirtProcr because multiple masterVPs*/ msach@132: unsigned int startMasterTSCLow;USE_GNU msach@132: unsigned int endMasterTSCLow; msach@132: #endif msach@132: //======================================== msach@132: msach@132: float64 createPtInSecs; //have space but don't use on some configs msach@132: }; msach@132: //VirtProcr msach@132: msach@76: void saveCoreLoopReturnAddr(void **returnAddress); msach@71: msach@71: void switchToVP(VirtProcr *nextProcr); msach@71: msach@71: void switchToCoreLoop(VirtProcr *nextProcr); msach@71: msach@71: void masterSwitchToCoreLoop(VirtProcr *nextProcr); msach@71: msach@76: void startVirtProcrFn(); msach@76: msach@137: void asmTerminateCoreLoop(VirtProcr *currPr); msach@137: msach@137: void asmTerminateCoreLoopSeq(VirtProcr *currPr); msach@78: msach@71: #define flushRegisters() \ msach@134: asm volatile ("":::"%rbx", "%r12", "%r13","%r14","%r15"); msach@71: msach@77: inline VirtProcr * msach@77: create_procr_helper( VirtProcr *newPr, VirtProcrFnPtr fnPtr, msach@77: void *initialData, void *stackLocs ); Me@55: msach@77: #endif /* _ProcrContext_H */ Me@62: