diff VSs.h @ 37:c8d4f6d3c7d3

hide animating VP and entry point
author Nina Engelhardt <nengel@mailbox.tu-berlin.de>
date Wed, 15 May 2013 15:25:55 +0200
parents 227db52cbd93
children a951b38d2cfc
line diff
     1.1 --- a/VSs.h	Mon Apr 15 16:41:31 2013 +0200
     1.2 +++ b/VSs.h	Wed May 15 15:25:55 2013 +0200
     1.3 @@ -39,7 +39,7 @@
     1.4  /*This header defines everything specific to the VSs semantic plug-in
     1.5   */
     1.6  typedef struct _VSsSemReq   VSsSemReq;
     1.7 -typedef void  (*VSsTaskFnPtr )   ( void *, SlaveVP *);
     1.8 +typedef void  (*VSsTaskFnPtr )   ( void * );
     1.9  typedef void  (*PtrToAtomicFn )  ( void * ); //executed atomically in master
    1.10  //===========================================================================
    1.11  
    1.12 @@ -318,7 +318,7 @@
    1.13                                                       SlaveVP *creatingThd );
    1.14  
    1.15  void
    1.16 -VSs__end_thread( SlaveVP *thdToEnd );
    1.17 +VSs__end_thread();
    1.18  
    1.19  //=======================
    1.20  
    1.21 @@ -329,69 +329,67 @@
    1.22  
    1.23  //=======================
    1.24  void
    1.25 -VSs__submit_task( VSsTaskType *taskType, void *args, SlaveVP *animSlv);
    1.26 +VSs__submit_task( VSsTaskType *taskType, void *args);
    1.27  
    1.28  int32 *
    1.29 -VSs__create_taskID_of_size( int32 numInts, SlaveVP *animSlv );
    1.30 +VSs__create_taskID_of_size( int32 numInts);
    1.31  
    1.32  void
    1.33 -VSs__submit_task_with_ID( VSsTaskType *taskType, void *args, int32 *taskID, 
    1.34 -                          SlaveVP     *animSlv);
    1.35 +VSs__submit_task_with_ID( VSsTaskType *taskType, void *args, int32 *taskID);
    1.36  
    1.37  void
    1.38 -VSs__end_task( SlaveVP *animSlv );
    1.39 +VSs__end_task();
    1.40  
    1.41  //=========================
    1.42  void
    1.43 -VSs__taskwait(SlaveVP *animSlv);
    1.44 +VSs__taskwait();
    1.45  
    1.46  void
    1.47 -VSs__taskwait_on(SlaveVP *animSlv,void* ptr);
    1.48 +VSs__taskwait_on(void* ptr);
    1.49  
    1.50  void
    1.51 -VSs__start_critical(SlaveVP *animSlv,int32 name);
    1.52 +VSs__start_critical(int32 name);
    1.53  
    1.54  void
    1.55 -VSs__end_critical(SlaveVP *animSlv,int32 name);
    1.56 +VSs__end_critical(int32 name);
    1.57  
    1.58  int32 *
    1.59 -VSs__give_self_taskID( SlaveVP *animSlv );
    1.60 +VSs__give_self_taskID();
    1.61  
    1.62  void
    1.63 -VSs__send_of_type_to( void *msg, const int32 type, int32 *receiverID,
    1.64 -                      SlaveVP *senderSlv );
    1.65 +VSs__send_of_type_to( void *msg, const int32 type, int32 *receiverID);
    1.66  
    1.67  void
    1.68 -VSs__send_from_to( void *msg, int32 *senderID, int32 *receiverID, SlaveVP *senderSlv );
    1.69 +VSs__send_from_to( void *msg, int32 *senderID, int32 *receiverID);
    1.70  
    1.71  void *
    1.72 -VSs__receive_type_to( const int32 type, int32* receiverID, SlaveVP *receiverSlv );
    1.73 +VSs__receive_type_to( const int32 type, int32* receiverID );
    1.74  
    1.75  void *
    1.76 -VSs__receive_from_to( int32 *senderID, int32 *receiverID, SlaveVP *receiverSlv );
    1.77 +VSs__receive_from_to( int32 *senderID, int32 *receiverID );
    1.78  
    1.79  //======================= Concurrency Stuff ======================
    1.80  void
    1.81 -VSs__start_fn_singleton( int32 singletonID, SlaveVP *animSlv );
    1.82 +VSs__start_fn_singleton( int32 singletonID );
    1.83  
    1.84  void
    1.85 -VSs__end_fn_singleton( int32 singletonID, SlaveVP *animSlv );
    1.86 +VSs__end_fn_singleton( int32 singletonID );
    1.87  
    1.88  void
    1.89 -VSs__start_data_singleton( VSsSingleton **singeltonAddr, SlaveVP *animSlv );
    1.90 +VSs__start_data_singleton( VSsSingleton **singeltonAddr );
    1.91  
    1.92  void
    1.93 -VSs__end_data_singleton( VSsSingleton **singletonAddr, SlaveVP *animSlv );
    1.94 +VSs__end_data_singleton( VSsSingleton **singletonAddr );
    1.95  
    1.96  void
    1.97  VSs__animate_short_fn_in_isolation( PtrToAtomicFn ptrToFnToExecInMaster,
    1.98 -                                    void *data, SlaveVP *animSlv );
    1.99 +                                    void *data );
   1.100  
   1.101  void
   1.102 -VSs__start_transaction( int32 transactionID, SlaveVP *animSlv );
   1.103 +VSs__start_transaction( int32 transactionID );
   1.104  
   1.105  void
   1.106 -VSs__end_transaction( int32 transactionID, SlaveVP *animSlv );
   1.107 +VSs__end_transaction( int32 transactionID );
   1.108  
   1.109  
   1.110  //=========================  Internal use only  =============================
   1.111 @@ -418,7 +416,7 @@
   1.112                              SlaveVP *creatingSlv, int32 coreToAssignOnto);
   1.113  
   1.114  void 
   1.115 -idle_fn(void* data, SlaveVP *animatingSlv);
   1.116 +idle_fn(void* data);
   1.117  
   1.118  void
   1.119  resume_slaveVP(SlaveVP *slave, VSsSemEnv *semEnv);
   1.120 @@ -427,5 +425,24 @@
   1.121  #include "Measurement/VSs_Measurement.h"
   1.122  
   1.123  //===========================================================================
   1.124 +
   1.125 +/* Hide entry point trick */
   1.126 +
   1.127 +typedef struct {
   1.128 +    int argc;
   1.129 +    char** argv;
   1.130 +} __main_args;
   1.131 +
   1.132 +extern int __main_ret;
   1.133 +
   1.134 +int __program_main(int argc, char** argv);
   1.135 +
   1.136 +void __entry_point(void* _args);
   1.137 +
   1.138 +int main(int argc, char** argv);
   1.139 +
   1.140 +
   1.141 +#define main __program_main
   1.142 +
   1.143  #endif	/* _VSs_H */
   1.144