changeset 16:c3e6c3fda84e

Forgot to commit after had working test -- changed stack & frame ptrs in thd params to be instead in virt procr struc -- stopped working! Saving now, then going back to way had it..
author Me
date Tue, 22 Jun 2010 11:53:32 -0700
parents cb10b58404ab
children 030fceb7e9b9
files VMS.h
diffstat 1 files changed, 26 insertions(+), 15 deletions(-) [+]
line diff
     1.1 --- a/VMS.h	Tue Jun 22 11:53:23 2010 -0700
     1.2 +++ b/VMS.h	Tue Jun 22 11:53:32 2010 -0700
     1.3 @@ -23,37 +23,55 @@
     1.4  
     1.5  //#define thdAttrs NULL  //For PThreads
     1.6  
     1.7 -typedef struct _WorkUnit   WorkUnit;
     1.8 +typedef struct _SchedSlot  SchedSlot;
     1.9 +typedef struct _SlaveReqst SlaveReqst;
    1.10  typedef struct _VirtProcr  VirtProcr;
    1.11 -typedef struct _SlaveReqst SlaveReqst;
    1.12 -typedef struct _SchedSlot  SchedSlot;
    1.13  
    1.14  typedef bool8 (*SlaveScheduler)  ( SchedSlot *, void * );
    1.15  typedef void  (*RequestHandler)  ( SlaveReqst * );
    1.16  typedef void  (*VirtProcrFnPtr)  ( void *, VirtProcr * );
    1.17  typedef void  VirtProcrFn( void *, VirtProcr * );
    1.18  
    1.19 +
    1.20  typedef struct
    1.21   {
    1.22     void           *endThdPt;
    1.23     unsigned int    coreNum;
    1.24 +//   void           *framePtr;
    1.25 +//   void           *stackPtr;
    1.26   }
    1.27  ThdParams;
    1.28  
    1.29 +
    1.30  struct _SchedSlot
    1.31   {
    1.32     int         workIsDone;
    1.33     int         needsProcrAssigned;
    1.34     VirtProcr  *procrAssignedToSlot;
    1.35   };
    1.36 +//SchedSlot
    1.37 + 
    1.38  
    1.39 +struct _SlaveReqst
    1.40 + {
    1.41 +   VirtProcr   *slaveFrom;
    1.42 +   int          reqType;   //for future when have I/O and OS services
    1.43 +   void        *semReqData;
    1.44 +
    1.45 +   SlaveReqst  *nextRequest;
    1.46 + };
    1.47 +//SlaveReqst
    1.48  
    1.49  struct _VirtProcr
    1.50   { int         procrID;  //for debugging -- count up each time create
    1.51 +   int         coreAnimatedBy;
    1.52     void       *stackPtr;
    1.53     void       *framePtr;
    1.54     void       *nextInstrPt;
    1.55 +   
    1.56     void       *coreLoopStartPt;  //allows proto-runtime to be linked later
    1.57 +   void       *coreLoopFramePtr; //restore before jmp back to core loop
    1.58 +   void       *coreLoopStackPtr; //restore before jmp back to core loop
    1.59  
    1.60     void       *initialData;
    1.61  
    1.62 @@ -62,10 +80,10 @@
    1.63  
    1.64     void       *semanticData;
    1.65   };
    1.66 +//VirtProcr
    1.67  
    1.68  
    1.69 -//When optimize make a separate flat array in here for each flag in SchedSlot
    1.70 -//So that polling done flags is fast..  not sure even worth it, though..
    1.71 +
    1.72  typedef struct
    1.73   {
    1.74     SlaveScheduler   slaveScheduler;
    1.75 @@ -80,20 +98,13 @@
    1.76     VirtProcr  *masterVirtPr;
    1.77     void       *semanticEnv;
    1.78     void       *OSEventStruc;    //for future, when add I/O to BLIS
    1.79 +
    1.80 +   void       *coreLoopShutDownPt; //addr to jump to to shut down a coreLoop
    1.81   }
    1.82  MasterEnv;
    1.83  
    1.84  
    1.85 -
    1.86 -struct _SlaveReqst
    1.87 - {
    1.88 -   VirtProcr   *slaveFrom;
    1.89 -   int          reqType;   //for future when have I/O and OS services
    1.90 -   void        *semReqData;
    1.91 -
    1.92 -   SlaveReqst  *nextRequest;
    1.93 - };
    1.94 -
    1.95 +//==========================================================
    1.96  
    1.97  DWORD WINAPI coreLoop( LPVOID paramsIn );
    1.98  //void * coreLoop( void *paramsIn );  //standard PThreads fn prototype