view ProcrContext.h @ 137:99343ffe1918

The shutdown now uses inter master requests
author Merten Sach <msach@mailbox.tu-berlin.de>
date Mon, 19 Sep 2011 14:15:37 +0200
parents a9b72021f053
children
line source
1 /*
2 * Copyright 2009 OpenSourceStewardshipFoundation.org
3 * Licensed under GNU General Public License version 2
4 *
5 * Author: seanhalle@yahoo.com
6 *
7 */
8 #ifndef _ProcrContext_H
9 #define _ProcrContext_H
10 #define _GNU_SOURCE
12 typedef struct _VirtProcr VirtProcr;
13 typedef struct _VMSReqst VMSReqst;
14 typedef void (*VirtProcrFnPtr) ( void *, VirtProcr * ); //initData, animPr
17 #include "VMS_primitive_data_types.h"
18 #include "scheduling.h"
20 /*WARNING: re-arranging this data structure could cause VP switching
21 * assembly code to fail -- hard-codes offsets of fields
22 */
23 struct _VirtProcr
24 { int procrID; //for debugging -- count up each time create
25 int coreAnimatedBy;
26 void *startOfStack;
27 void *stackPtr;
28 void *framePtr;
29 void *nextInstrPt;
31 void *coreLoopStartPt; //allows proto-runtime to be linked later
32 void *coreLoopFramePtr; //restore before jmp back to core loop
33 void *coreLoopStackPtr; //restore before jmp back to core loop
35 void *initialData;
37 SchedSlot *schedSlot;
38 VMSReqst *requests;
40 void *semanticData;
41 void *dataRetFromReq; //values returned from plugin to VP go here
43 //=========== MEASUREMENT STUFF ==========
44 #ifdef MEAS__TIME_STAMP_SUSP
45 unsigned int preSuspTSCLow;
46 unsigned int postSuspTSCLow;
47 #endif
48 #ifdef MEAS__TIME_MASTER /* in VirtProcr because multiple masterVPs*/
49 unsigned int startMasterTSCLow;USE_GNU
50 unsigned int endMasterTSCLow;
51 #endif
52 //========================================
54 float64 createPtInSecs; //have space but don't use on some configs
55 };
56 //VirtProcr
58 void saveCoreLoopReturnAddr(void **returnAddress);
60 void switchToVP(VirtProcr *nextProcr);
62 void switchToCoreLoop(VirtProcr *nextProcr);
64 void masterSwitchToCoreLoop(VirtProcr *nextProcr);
66 void startVirtProcrFn();
68 void asmTerminateCoreLoop(VirtProcr *currPr);
70 void asmTerminateCoreLoopSeq(VirtProcr *currPr);
72 #define flushRegisters() \
73 asm volatile ("":::"%rbx", "%r12", "%r13","%r14","%r15");
75 inline VirtProcr *
76 create_procr_helper( VirtProcr *newPr, VirtProcrFnPtr fnPtr,
77 void *initialData, void *stackLocs );
79 #endif /* _ProcrContext_H */