annotate ProcrContext.h @ 135:0b49fd35afc1

distributed free working -app sends a VMSSemReqst to his Master which send a request to a different Master -Master send the request directly -The request structure is freed by the sender, when the request was handled There are still problems on shutdown. The shutdownVPs are all allocated by one Master which is likly to be terminated
author Merten Sach <msach@mailbox.tu-berlin.de>
date Fri, 16 Sep 2011 20:08:28 +0200
parents dbfc8382d546
children 99343ffe1918
rev   line source
Me@55 1 /*
Me@55 2 * Copyright 2009 OpenSourceStewardshipFoundation.org
Me@55 3 * Licensed under GNU General Public License version 2
Me@55 4 *
Me@55 5 * Author: seanhalle@yahoo.com
Me@55 6 *
Me@55 7 */
msach@77 8 #ifndef _ProcrContext_H
msach@77 9 #define _ProcrContext_H
msach@76 10 #define _GNU_SOURCE
Me@55 11
msach@134 12 typedef struct _VirtProcr VirtProcr;
msach@134 13 typedef struct _VMSReqst VMSReqst;
msach@134 14 typedef void (*VirtProcrFnPtr) ( void *, VirtProcr * ); //initData, animPr
msach@132 15
msach@134 16
msach@134 17 #include "VMS_primitive_data_types.h"
msach@134 18 #include "scheduling.h"
msach@132 19
msach@132 20 /*WARNING: re-arranging this data structure could cause VP switching
msach@132 21 * assembly code to fail -- hard-codes offsets of fields
msach@132 22 */
msach@132 23 struct _VirtProcr
msach@132 24 { int procrID; //for debugging -- count up each time create
msach@132 25 int coreAnimatedBy;
msach@132 26 void *startOfStack;
msach@132 27 void *stackPtr;
msach@132 28 void *framePtr;
msach@132 29 void *nextInstrPt;
msach@132 30
msach@132 31 void *coreLoopStartPt; //allows proto-runtime to be linked later
msach@132 32 void *coreLoopFramePtr; //restore before jmp back to core loop
msach@132 33 void *coreLoopStackPtr; //restore before jmp back to core loop
msach@132 34
msach@132 35 void *initialData;
msach@132 36
msach@132 37 SchedSlot *schedSlot;
msach@132 38 VMSReqst *requests;
msach@132 39
msach@132 40 void *semanticData;
msach@132 41 void *dataRetFromReq; //values returned from plugin to VP go here
msach@132 42
msach@132 43 //=========== MEASUREMENT STUFF ==========
msach@132 44 #ifdef MEAS__TIME_STAMP_SUSP
msach@132 45 unsigned int preSuspTSCLow;
msach@132 46 unsigned int postSuspTSCLow;
msach@132 47 #endif
msach@132 48 #ifdef MEAS__TIME_MASTER /* in VirtProcr because multiple masterVPs*/
msach@132 49 unsigned int startMasterTSCLow;USE_GNU
msach@132 50 unsigned int endMasterTSCLow;
msach@132 51 #endif
msach@132 52 //========================================
msach@132 53
msach@132 54 float64 createPtInSecs; //have space but don't use on some configs
msach@132 55 };
msach@132 56 //VirtProcr
msach@132 57
msach@76 58 void saveCoreLoopReturnAddr(void **returnAddress);
msach@71 59
msach@71 60 void switchToVP(VirtProcr *nextProcr);
msach@71 61
msach@71 62 void switchToCoreLoop(VirtProcr *nextProcr);
msach@71 63
msach@71 64 void masterSwitchToCoreLoop(VirtProcr *nextProcr);
msach@71 65
msach@76 66 void startVirtProcrFn();
msach@76 67
msach@78 68 void *asmTerminateCoreLoop(VirtProcr *currPr);
msach@78 69
msach@71 70 #define flushRegisters() \
msach@134 71 asm volatile ("":::"%rbx", "%r12", "%r13","%r14","%r15");
msach@71 72
msach@77 73 inline VirtProcr *
msach@77 74 create_procr_helper( VirtProcr *newPr, VirtProcrFnPtr fnPtr,
msach@77 75 void *initialData, void *stackLocs );
Me@55 76
msach@77 77 #endif /* _ProcrContext_H */
Me@62 78