annotate ProcrContext.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 521c75d64cef
children a9b72021f053
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@132 12 #include "VMS.h"
msach@132 13
msach@132 14 typedef struct _SchedSlot SchedSlot;
msach@132 15 typedef struct _VirtProcr VirtProcr;
msach@132 16
msach@132 17 /*WARNING: re-arranging this data structure could cause VP switching
msach@132 18 * assembly code to fail -- hard-codes offsets of fields
msach@132 19 */
msach@132 20 struct _VirtProcr
msach@132 21 { int procrID; //for debugging -- count up each time create
msach@132 22 int coreAnimatedBy;
msach@132 23 void *startOfStack;
msach@132 24 void *stackPtr;
msach@132 25 void *framePtr;
msach@132 26 void *nextInstrPt;
msach@132 27
msach@132 28 void *coreLoopStartPt; //allows proto-runtime to be linked later
msach@132 29 void *coreLoopFramePtr; //restore before jmp back to core loop
msach@132 30 void *coreLoopStackPtr; //restore before jmp back to core loop
msach@132 31
msach@132 32 void *initialData;
msach@132 33
msach@132 34 SchedSlot *schedSlot;
msach@132 35 VMSReqst *requests;
msach@132 36
msach@132 37 void *semanticData;
msach@132 38 void *dataRetFromReq; //values returned from plugin to VP go here
msach@132 39
msach@132 40 //=========== MEASUREMENT STUFF ==========
msach@132 41 #ifdef MEAS__TIME_STAMP_SUSP
msach@132 42 unsigned int preSuspTSCLow;
msach@132 43 unsigned int postSuspTSCLow;
msach@132 44 #endif
msach@132 45 #ifdef MEAS__TIME_MASTER /* in VirtProcr because multiple masterVPs*/
msach@132 46 unsigned int startMasterTSCLow;USE_GNU
msach@132 47 unsigned int endMasterTSCLow;
msach@132 48 #endif
msach@132 49 //========================================
msach@132 50
msach@132 51 float64 createPtInSecs; //have space but don't use on some configs
msach@132 52 };
msach@132 53 //VirtProcr
msach@132 54
msach@132 55 struct _SchedSlot
msach@132 56 {
msach@132 57 int workIsDone;
msach@132 58 int needsProcrAssigned;
msach@132 59 VirtProcr *procrAssignedToSlot;
msach@132 60 };
msach@132 61
msach@76 62 void saveCoreLoopReturnAddr(void **returnAddress);
msach@71 63
msach@71 64 void switchToVP(VirtProcr *nextProcr);
msach@71 65
msach@71 66 void switchToCoreLoop(VirtProcr *nextProcr);
msach@71 67
msach@71 68 void masterSwitchToCoreLoop(VirtProcr *nextProcr);
msach@71 69
msach@76 70 void startVirtProcrFn();
msach@76 71
msach@78 72 void *asmTerminateCoreLoop(VirtProcr *currPr);
msach@78 73
msach@71 74 #define flushRegisters() \
msach@76 75 asm volatile ("":::"%rbx", "%r12", "%r13","%r14","%r15")
msach@71 76
msach@77 77 inline VirtProcr *
msach@77 78 create_procr_helper( VirtProcr *newPr, VirtProcrFnPtr fnPtr,
msach@77 79 void *initialData, void *stackLocs );
Me@55 80
msach@77 81 #endif /* _ProcrContext_H */
Me@62 82