diff SSR.h @ 29:e4de34fd220b

merged useless branch test_without_inline
author Merten Sach <msach@mailbox.tu-berlin.de>
date Thu, 22 Sep 2011 12:15:04 +0200
parents a8e41e0bfa61
children 6a367b5d9a2d
line diff
     1.1 --- a/SSR.h	Thu Nov 11 04:59:48 2010 -0800
     1.2 +++ b/SSR.h	Thu Sep 22 12:15:04 2011 +0200
     1.3 @@ -27,6 +27,25 @@
     1.4  /*Semantic layer-specific data sent inside a request from lib called in app
     1.5   * to request handler called in MasterLoop
     1.6   */
     1.7 +
     1.8 +typedef struct
     1.9 + {
    1.10 +   VirtProcr      *VPCurrentlyExecuting;
    1.11 +   PrivQueueStruc *waitingVPQ;
    1.12 + }
    1.13 +SSRTrans;
    1.14 +
    1.15 +/*WARNING: assembly hard-codes position of endInstrAddr as first field
    1.16 + */
    1.17 +typedef struct
    1.18 + {
    1.19 +   void           *endInstrAddr;
    1.20 +   int32           hasBeenStarted;
    1.21 +   int32           hasFinished;
    1.22 +   PrivQueueStruc *waitQ;
    1.23 + }
    1.24 +SSRSingleton;
    1.25 +
    1.26  enum SSRReqType
    1.27   {
    1.28     send_type = 1,
    1.29 @@ -38,7 +57,10 @@
    1.30     transfer_out,
    1.31     malloc_req,
    1.32     free_req,
    1.33 -   singleton,
    1.34 +   singleton_fn_start,
    1.35 +   singleton_fn_end,
    1.36 +   singleton_data_start,
    1.37 +   singleton_data_end,
    1.38     atomic,
    1.39     trans_start,
    1.40     trans_end
    1.41 @@ -60,7 +82,7 @@
    1.42     void              *ptrToFree;
    1.43  
    1.44     int32              singletonID;
    1.45 -   void              *endJumpPt;
    1.46 +   SSRSingleton     **singletonPtrAddr;
    1.47  
    1.48     PtrToAtomicFn      fnToExecInMaster;
    1.49     void              *dataForFn;
    1.50 @@ -72,13 +94,6 @@
    1.51  
    1.52  typedef struct
    1.53   {
    1.54 -   VirtProcr      *VPCurrentlyExecuting;
    1.55 -   PrivQueueStruc *waitingVPQ;
    1.56 - }
    1.57 -SSRTrans;
    1.58 -
    1.59 -typedef struct
    1.60 - {
    1.61     PrivQueueStruc **readyVPQs;
    1.62     HashTable       *commHashTbl;
    1.63     int32            numVirtPr;
    1.64 @@ -86,7 +101,7 @@
    1.65     int32            primitiveStartTime;
    1.66  
    1.67                         //fix limit on num with dynArray
    1.68 -   int32            singletonHasBeenExecutedFlags[NUM_STRUCS_IN_SEM_ENV];
    1.69 +   SSRSingleton     fnSingletons[NUM_STRUCS_IN_SEM_ENV];
    1.70     SSRTrans         transactionStrucs[NUM_STRUCS_IN_SEM_ENV];
    1.71   }
    1.72  SSRSemEnv;
    1.73 @@ -115,10 +130,10 @@
    1.74  int32
    1.75  SSR__giveMinWorkUnitCycles( float32 percentOverhead );
    1.76  
    1.77 -void inline
    1.78 +void
    1.79  SSR__start_primitive();
    1.80  
    1.81 -int32 inline
    1.82 +int32
    1.83  SSR__end_primitive_and_give_cycles();
    1.84  
    1.85  int32
    1.86 @@ -137,11 +152,11 @@
    1.87  
    1.88  //=======================
    1.89  
    1.90 -inline VirtProcr *
    1.91 +  VirtProcr *
    1.92  SSR__create_procr_with( VirtProcrFnPtr fnPtr, void *initData,
    1.93                            VirtProcr *creatingPr );
    1.94  
    1.95 -inline VirtProcr *
    1.96 +  VirtProcr *
    1.97  SSR__create_procr_with_affinity( VirtProcrFnPtr fnPtr,    void *initData,
    1.98                              VirtProcr *creatingPr, int32 coreToScheduleOnto);
    1.99  
   1.100 @@ -187,8 +202,16 @@
   1.101  
   1.102  //======================= Concurrency Stuff ======================
   1.103  void
   1.104 -SSR__start_singleton( int32 singletonID, void *endSingletonLabelAddr,
   1.105 -                      VirtProcr *animPr );
   1.106 +SSR__start_fn_singleton( int32 singletonID, VirtProcr *animPr );
   1.107 +
   1.108 +void
   1.109 +SSR__end_fn_singleton( int32 singletonID, VirtProcr *animPr );
   1.110 +
   1.111 +void
   1.112 +SSR__start_data_singleton( SSRSingleton **singeltonAddr, VirtProcr *animPr );
   1.113 +
   1.114 +void
   1.115 +SSR__end_data_singleton( SSRSingleton **singletonAddr, VirtProcr *animPr );
   1.116  
   1.117  void
   1.118  SSR__animate_short_fn_in_isolation( PtrToAtomicFn ptrToFnToExecInMaster,
   1.119 @@ -208,6 +231,9 @@
   1.120  VirtProcr *
   1.121  SSR__schedule_virt_procr( void *_semEnv, int coreNum );
   1.122  
   1.123 +VirtProcr*
   1.124 +SSR__create_procr_helper( VirtProcrFnPtr fnPtr, void *initData,
   1.125 +                          SSRSemEnv *semEnv,    int32 coreToScheduleOnto );
   1.126  
   1.127  #endif	/* _SSR_H */
   1.128