diff PR.h @ 268:e5bd470b562b

Checkpoint 2 -- split up header file, and about to delete single lang version of AnimationMaster
author Sean Halle <seanhalle@yahoo.com>
date Mon, 14 Jan 2013 15:31:23 -0800
parents 608833ae2c5d
children 292393c6bef1
line diff
     1.1 --- a/PR.h	Sun Nov 04 18:39:28 2012 -0800
     1.2 +++ b/PR.h	Mon Jan 14 15:31:23 2013 -0800
     1.3 @@ -1,5 +1,5 @@
     1.4  /*
     1.5 - *  Copyright 2009 OpenSourceStewardshipFoundation.org
     1.6 + *  Copyright 2009 OpenSourceResearchInstitute.org
     1.7   *  Licensed under GNU General Public License version 2
     1.8   *
     1.9   * Author: seanhalle@yahoo.com
    1.10 @@ -30,25 +30,7 @@
    1.11  
    1.12  //================================ Typedefs =================================
    1.13  //
    1.14 -typedef unsigned long long    TSCount;
    1.15 -
    1.16 -typedef struct _AnimSlot      AnimSlot;
    1.17 -typedef struct _PRReqst       PRReqst;
    1.18 -typedef struct _SlaveVP       SlaveVP;
    1.19 -typedef struct _MasterVP      MasterVP;
    1.20 -typedef struct _IntervalProbe IntervalProbe;
    1.21 -typedef struct _PRMetaTask    PRMetaTask;
    1.22 -
    1.23 -
    1.24 -typedef SlaveVP *(*SlaveAssigner)  ( void *, AnimSlot*); //semEnv, slot for HW info
    1.25 -typedef void     (*RequestHandler) ( SlaveVP *, void * ); //prWReqst, semEnv
    1.26 -typedef void     (*IndivReqHandler)( SlaveVP *, void * ); //prWReqst, semEnv
    1.27 -typedef void     (*TopLevelFnPtr)  ( void *, SlaveVP * ); //initData, animSlv
    1.28 -typedef void       TopLevelFn      ( void *, SlaveVP * ); //initData, animSlv
    1.29 -typedef void     (*ResumeSlvFnPtr) ( SlaveVP *, void * );
    1.30 -      //=========== MEASUREMENT STUFF ==========
    1.31 -        MEAS__Insert_Counter_Handler
    1.32 -      //========================================
    1.33 +#include "PR__structs.h"
    1.34  
    1.35  //============================ HW Dependent Fns ================================
    1.36  
    1.37 @@ -56,338 +38,9 @@
    1.38  #include "HW_Dependent_Primitives/PR__primitives.h"
    1.39  
    1.40  
    1.41 -//============= Request Related ===========
    1.42 -//
    1.43 -
    1.44 -enum PRReqstType  //avoid starting enums at 0, for debug reasons
    1.45 - {
    1.46 -   TaskCreate = 1,
    1.47 -   TaskEnd,
    1.48 -   SlvCreate,
    1.49 -   SlvDissipate,
    1.50 -   Language,
    1.51 -   Service,       //To invoke a PR provided equivalent of a language request (ex: probe)
    1.52 -   Hardware,
    1.53 -   IO,
    1.54 -   OSCall
    1.55 - };
    1.56 -
    1.57 -struct _PRReqst
    1.58 - {
    1.59 -   enum PRReqstType   reqType;//used for special forms that have PR behavior
    1.60 -   void              *semReq;
    1.61 -   PRProcess         *processReqIsIn;
    1.62 -   int32              langMagicNumber;
    1.63 -   TopLevelFn         topLevelFn;
    1.64 -   void              *initData;
    1.65 -   int32             *ID;
    1.66 -   
    1.67 -      //The request handling structure is a bit messy..  for special forms, 
    1.68 -      // such as create and dissipate, the language inserts pointer to handler
    1.69 -      // fn directly into the request..  might change to this for all requests
    1.70 -   IndivReqHandler    handler; //pointer to handler fn for create, dissip, etc
    1.71 -   
    1.72 -   PRReqst *nextReqst;
    1.73 - };
    1.74 -//PRReqst
    1.75 -
    1.76 -enum PRServReqType   //These are equivalent to semantic requests, but for
    1.77 - {                    // PR's services available directly to app, like OS
    1.78 -   make_probe = 1,    // and probe services -- like a PR-wide built-in lang
    1.79 -   throw_excp,
    1.80 -   openFile,
    1.81 -   otherIO
    1.82 - };
    1.83 -
    1.84 -typedef struct
    1.85 - { enum PRServReqType   reqType;
    1.86 -   SlaveVP             *requestingSlv;
    1.87 -   char                *nameStr;  //for create probe
    1.88 -   char                *msgStr;   //for exception
    1.89 -   void                *exceptionData;
    1.90 - }
    1.91 -PRServReq;
    1.92 -
    1.93 -
    1.94 -//====================  Core data structures  ===================
    1.95 -
    1.96 -typedef struct
    1.97 - {
    1.98 -   //for future expansion
    1.99 - }
   1.100 -SlotPerfInfo;
   1.101 -
   1.102 -struct _AnimSlot
   1.103 - {
   1.104 -   int           workIsDone;
   1.105 -   int           needsWorkAssigned;
   1.106 -   SlaveVP      *slaveAssignedToSlot;
   1.107 -   
   1.108 -   int           slotIdx;  //needed by Holistic Model's data gathering
   1.109 -   int           coreSlotIsOn;
   1.110 -   SlotPerfInfo *perfInfo; //used by assigner to pick best slave for core
   1.111 - };
   1.112 -//AnimSlot
   1.113 -
   1.114 -enum VPtype 
   1.115 - { SlotTaskSlv = 1,//Slave tied to an anim slot, only animates tasks
   1.116 -   FreeTaskSlv,   //When a suspended task ends, the slave becomes this
   1.117 -   GenericSlv,     //the VP is explicitly seen in the app code, or task suspends
   1.118 -   Master,
   1.119 -   Shutdown,
   1.120 -   Idle
   1.121 - };
   1.122 - 
   1.123 -/*This structure embodies the state of a slaveVP.  It is reused for masterVP
   1.124 - * and shutdownVPs.
   1.125 - */
   1.126 -struct _SlaveVP
   1.127 - {    //The offsets of these fields are hard-coded into assembly
   1.128 -   void       *stackPtr;         //save the core's stack ptr when suspend
   1.129 -   void       *framePtr;         //save core's frame ptr when suspend
   1.130 -   void       *resumeInstrPtr;   //save core's program-counter when suspend
   1.131 -   void       *coreCtlrFramePtr; //restore before jmp back to core controller
   1.132 -   void       *coreCtlrStackPtr; //restore before jmp back to core controller
   1.133 -   
   1.134 -      //============ below this, no fields are used in asm =============
   1.135 -   
   1.136 -   void       *startOfStack;  //used to free, and to point slave to Fn
   1.137 -   PRProcess  *processSlaveIsIn;
   1.138 -   PRMetaTask *metaTask;
   1.139 -   enum VPtype typeOfVP;      //Slave vs Master vs Shutdown..
   1.140 -   int         slaveID;       //each slave given a globally unique ID
   1.141 -   int         coreAnimatedBy; 
   1.142 -   int         numTimesAssignedToASlot;   //Each assign is for one work-unit, so is an ID
   1.143 -      //note, a scheduling decision is uniquely identified by the triple:
   1.144 -      // <slaveID, coreAnimatedBy, numTimesAssignedToASlot> -- used in record & replay
   1.145 -   
   1.146 -      //for comm -- between master and coreCtlr & btwn wrapper lib and plugin
   1.147 -   AnimSlot   *animSlotAssignedTo;
   1.148 -   PRReqst    *request;      //wrapper lib puts in requests, plugin takes out
   1.149 -   void       *dataRetFromReq;//Return vals from plugin to Wrapper Lib
   1.150 -
   1.151 -      //For language specific data that needs to be in the slave
   1.152 -   void       *semanticData;  //Lang saves lang-specific things in slave here
   1.153 -
   1.154 -      //Task related stuff
   1.155 -//   bool        needsTaskAssigned;
   1.156 -   
   1.157 -        //=========== MEASUREMENT STUFF ==========
   1.158 -         MEAS__Insert_Meas_Fields_into_Slave;
   1.159 -         float64     createPtInSecs;  //time VP created, in seconds
   1.160 -        //========================================
   1.161 - };
   1.162 -//SlaveVP
   1.163 -
   1.164 - 
   1.165 -/* The one and only global variable, holds many odds and ends
   1.166 - */
   1.167 -typedef struct
   1.168 - {    //The offsets of these fields are hard-coded into assembly
   1.169 -   void            *coreCtlrReturnPt;    //offset to this field used in asm
   1.170 -   int8             falseSharePad1[256 - sizeof(void*)];
   1.171 -   int32            masterLock;          //offset to this field used in asm
   1.172 -   int8             falseSharePad2[256 - sizeof(int32)];
   1.173 -      //============ below this, no fields are used in asm =============
   1.174 -
   1.175 -      //Basic PR infrastructure
   1.176 -   SlaveVP        **masterVPs;
   1.177 -   AnimSlot      ***allAnimSlots;
   1.178 - 
   1.179 -   PRProcess      **processes;
   1.180 -   
   1.181 -//move to processEnv      //Slave creation -- global count of slaves existing, across langs and processes
   1.182 -   int32            numSlavesCreated;  //used to give unique ID to processor
   1.183 -   int32            numTasksCreated;   //to give unique ID to a task
   1.184 -
   1.185 -      //Initialization related
   1.186 -   int32            setupComplete;      //use while starting up coreCtlr
   1.187 -
   1.188 -      //Memory management related
   1.189 -   MallocArrays    *freeLists;
   1.190 -   int32            amtOfOutstandingMem;//total currently allocated
   1.191 -
   1.192 -      //Random number seeds -- random nums used in various places  
   1.193 -   uint32_t seed1;
   1.194 -   uint32_t seed2;
   1.195 -
   1.196 -   These_Prob_belong_in_PRPRocess;
   1.197 -//   SlaveVP         *slotTaskSlvs[NUM_CORES][NUM_ANIM_SLOTS];
   1.198 -//   int32            numLiveFreeTaskSlvs;
   1.199 -//   int32            numLiveThreadSlvs;
   1.200 -//   bool32          *coreIsDone;
   1.201 -//   int32            numCoresDone;
   1.202 -   
   1.203 -//   SlaveVP* idleSlv[NUM_CORES][NUM_ANIM_SLOTS];
   1.204 -//   int shutdownInitiated;
   1.205 -   
   1.206 -      //=========== MEASUREMENT STUFF =============
   1.207 -       IntervalProbe   **intervalProbes;
   1.208 -       PrivDynArrayInfo *dynIntervalProbesInfo;
   1.209 -       HashTable        *probeNameHashTbl;
   1.210 -       int32             masterCreateProbeID;
   1.211 -       float64           createPtInSecs; //real-clock time PR initialized
   1.212 -       Histogram       **measHists;
   1.213 -       PrivDynArrayInfo *measHistsInfo;
   1.214 -       MEAS__Insert_Susp_Meas_Fields_into_MasterEnv;
   1.215 -       MEAS__Insert_Master_Meas_Fields_into_MasterEnv;
   1.216 -       MEAS__Insert_Master_Lock_Meas_Fields_into_MasterEnv;
   1.217 -       MEAS__Insert_Malloc_Meas_Fields_into_MasterEnv;
   1.218 -       MEAS__Insert_Plugin_Meas_Fields_into_MasterEnv;
   1.219 -       MEAS__Insert_System_Meas_Fields_into_MasterEnv;
   1.220 -       MEAS__Insert_Counter_Meas_Fields_into_MasterEnv;
   1.221 -      //==========================================
   1.222 - }
   1.223 -MasterEnv;
   1.224 -
   1.225 -//=====================
   1.226 -typedef struct
   1.227 - { int32     langMagicNumber; //indexes into hash array of semEnvs in PRProcess
   1.228 -   PRSemEnv *chainedSemEnv;   //chains to semEnvs with same hash
   1.229 -   void     *langSemEnv;
   1.230 -   
   1.231 -   SlaveAssigner   slaveAssigner;
   1.232 -   RequestHandler  requestHdlr;
   1.233 -   
   1.234 -   RequestHandler  createTaskHdlr;
   1.235 -   RequestHandler  endTaskHdlr;
   1.236 -   RequestHandler  createSlaveHdlr;
   1.237 -   RequestHandler  dissipateSlaveHdlr;
   1.238 -   RequestHandler  semDataCreator;
   1.239 -   RequestHandler  semDataInitializer;
   1.240 -  
   1.241 -   
   1.242 -      //Track slaves created, separately for each langlet? (in each process)
   1.243 -//   int32            numSlavesCreated;  //gives ordering to processor creation
   1.244 -//   int32            numSlavesAlive;    //used to detect fail-safe shutdown
   1.245 -   
   1.246 -      //when multi-lang, master polls sem env's to find one with work in it..
   1.247 -      // in single-lang case, flag ignored, master always asks lang for work
   1.248 -   int32   hasWork;
   1.249 - }
   1.250 -PRSemEnv;
   1.251 -
   1.252 -//The semantic env of every langlet must start with these two fields, so that
   1.253 -// PR can cast the void * to this struct, in order to access these two fields
   1.254 -typedef struct
   1.255 - { int32     langMagicNumber;
   1.256 -   PRSemEnv *protoSemEnv;
   1.257 - }
   1.258 -PRLangSemEnv;
   1.259 -
   1.260 -//can cast any langlet's sem env to one of these, so PR can access values
   1.261 -typedef struct
   1.262 - { int32     langMagicNumber;
   1.263 -   PRSemEnv *protoSemEnv;
   1.264 - }
   1.265 -PRServSemEnv;
   1.266 -
   1.267 -enum PRTaskType
   1.268 - { GenericSlave = 1,
   1.269 -   SlotTask,
   1.270 -   FreeTask
   1.271 - };
   1.272 -
   1.273 -struct _PRMetaTask
   1.274 - { 
   1.275 -   PRTaskType      taskType;
   1.276 -//   RequestHandler  reqHandler;      //Lang-specific hdlr for create, end, etc
   1.277 -   int32          *taskID;          //is standard PR ID
   1.278 -   SlaveVP        *slaveAssignedTo; //no valid until task animated
   1.279 -   TopLevelFn      topLevelFn;      //This is the Fn executes as the task
   1.280 -   void           *initData;        //The data taken by the function
   1.281 -   void           *langMetaTask;
   1.282 -
   1.283 -   //NOTE: info needed for "wait" functionality is inside lang's metaTask
   1.284 - };
   1.285 -//PRMetaTask
   1.286 -
   1.287 -/*The language's meta task is cast to this struct, inside PR, then the 
   1.288 - * back pointer to protoMetaTask is set.  Keeps existence of PRMetaTask hidden
   1.289 - * from plugin -- so can change later.
   1.290 - */
   1.291 -typedef struct
   1.292 - { int32       langMagicNumber;
   1.293 -   PRMetaTask *protoMetaTask;
   1.294 - }
   1.295 -PRLangMetaTask;
   1.296 - 
   1.297 -typedef struct
   1.298 - {
   1.299 -   void (*freeFn)(void *);
   1.300 - }
   1.301 -PRSemDataTemplate;
   1.302 - 
   1.303 -typedef struct
   1.304 - {
   1.305 -   void (*recycler)(void *);
   1.306 -   void *langSemData;
   1.307 - }
   1.308 -PRSemData;
   1.309 -
   1.310 -typedef struct
   1.311 - { PRSemDataTemplate **semDatas;
   1.312 -   PRSemDataTemplate **semDatasIter;
   1.313 -   int32               numSemDatas;
   1.314 - }
   1.315 -PRSemDataHolder;
   1.316 -//=====================  Top Process level Data Strucs  ======================
   1.317 -
   1.318 -/*This structure holds all the information PR needs to manage a program.  PR
   1.319 - * stores information about what percent of CPU time the program is getting, 
   1.320 - * 
   1.321 - */
   1.322 -typedef struct
   1.323 - { 
   1.324 -   PRSemEnv semEnvs[NUM_SEM_ENVS_IN_PROCESS];    //used as a hash table
   1.325 -   PRSemEnv semEnvList[NUM_SEM_ENVS_IN_PROCESS]; //lines up the semEnvs, so can iterate through
   1.326 -   int32    numSemEnvs;     //must be less than num sem envs.. used to iterate through
   1.327 -    
   1.328 -   int32           numLiveGenericSlvs;
   1.329 -   int32           numLiveFreeTaskSlvs;
   1.330 -   int32           numLiveTasks;
   1.331 -//   bool32          coreIsDone[NUM_CORES][CACHE_LINE_SZ]; //Fixes false sharing
   1.332 -
   1.333 -   PrivQueueStruc *freeTaskSlvRecycleQ;
   1.334 -   SlaveVP         slotTaskSlvs[NUM_CORES][NUM_ANIM_SLOTS];
   1.335 -   void           *resultToReturn;
   1.336 -  
   1.337 -   SlaveVP        *seedSlv;   
   1.338 -   
   1.339 -   SlaveAssigner   overrideAssigner;
   1.340 -   
   1.341 -      //These are used to coord with OS thread waiting for process to end
   1.342 -   bool32          executionIsComplete;
   1.343 -   pthread_mutex_t doneLock;
   1.344 -   pthread_cond_t  doneCond;
   1.345 - }
   1.346 -PRProcess;
   1.347 -
   1.348 -
   1.349 -//=========================  Extra Stuff Data Strucs  =======================
   1.350 -typedef struct
   1.351 - {
   1.352 -
   1.353 - }
   1.354 -PRExcp; //exception
   1.355 -
   1.356 -//=======================  OS Thread related  ===============================
   1.357 -
   1.358 -void * coreController( void *paramsIn );  //standard PThreads fn prototype
   1.359 -void * coreCtlr_Seq( void *paramsIn );  //standard PThreads fn prototype
   1.360 -void animationMaster( void *initData, SlaveVP *masterVP );
   1.361 -
   1.362 -
   1.363 -typedef struct
   1.364 - {
   1.365 -   void           *endThdPt;
   1.366 -   unsigned int    coreNum;
   1.367 - }
   1.368 -ThdParams;
   1.369 -
   1.370  //=============================  Global Vars ================================
   1.371  
   1.372 -volatile MasterEnv      *_PRTopEnv __align_to_cacheline__;
   1.373 +volatile TopEnv      *_PRTopEnv __align_to_cacheline__;
   1.374  
   1.375     //these are global, but only used for startup and shutdown
   1.376  pthread_t       coreCtlrThdHandles[ NUM_CORES ]; //pthread's virt-procr state
   1.377 @@ -403,7 +56,7 @@
   1.378   * WL   Wrapper Library -- wrapper lib code should only use these
   1.379   * PI   Plugin          -- plugin code should only use these
   1.380   * SS   Startup and Shutdown -- designates these relate to startup & shutdown
   1.381 - * int  internal to PR -- should not be used in wrapper lib or plugin
   1.382 + * int32internal to PR -- should not be used in wrapper lib or plugin
   1.383   * PROS means "OS functions for applications to use"
   1.384   * 
   1.385   * PR_int__ functions touch internal PR data structs and are only safe
   1.386 @@ -413,184 +66,32 @@
   1.387   * 
   1.388   * PR_WL__ functions are all safe for use outside the master lock.
   1.389   * 
   1.390 - * PROS are only safe for applications to use -- they're like a second
   1.391 + * PR_OS are only safe for applications to use -- they're like a second
   1.392   * language mixed in -- but they can't be used inside plugin code, and
   1.393   * aren't meant for use in wrapper libraries, because they are themselves
   1.394   * wrapper-library calls!
   1.395   */
   1.396 -//========== Startup and shutdown ==========
   1.397 -void
   1.398 -PR__start();
   1.399  
   1.400 -SlaveVP* 
   1.401 -PR_SS__create_shutdown_slave();
   1.402 +//============== include internally used fn prototypes ================
   1.403  
   1.404 -void
   1.405 -PR_SS__shutdown();
   1.406 +//include fn prototypes used internally in the proto-runtime implementation
   1.407 +#include "PR__int.h"
   1.408  
   1.409 -void
   1.410 -PR_SS__cleanup_at_end_of_shutdown();
   1.411 +//include fn prototypes used by plugin
   1.412 +#include "PR__PI.h"
   1.413  
   1.414 -void
   1.415 -PR_SS__register_langlets_semEnv( PRSemEnv *semEnv, SlaveVP  *seedVP, int32 VSs_MAGIC_NUMBER );
   1.416 +//include fn prototype used by wrapper library
   1.417 +#include "PR__WL.h"
   1.418  
   1.419 +//=================================
   1.420 +#define implement_me printf("Unimpl Fn: \n%s \n%s : %s\n", __FILE__, __FUNCTION__, __LINE__)
   1.421 +//#define fix_me printf("Fix me at: \n%s \n%s : %s\n", __FILE__, __FUNCTION__, __LINE__)
   1.422  
   1.423 -//==============    ===============
   1.424  
   1.425 -inline SlaveVP *
   1.426 -PR_int__create_slaveVP( TopLevelFnPtr fnPtr, void *dataParam );
   1.427 -#define PR_PI__create_slaveVP PR_int__create_slaveVP
   1.428 -#define PR_WL__create_slaveVP PR_int__create_slaveVP
   1.429 -
   1.430 -inline 
   1.431 -SlaveVP *
   1.432 -PR_int__create_slot_slave();
   1.433 -
   1.434 -inline 
   1.435 -SlaveVP *
   1.436 -PR_int__create_slaveVP_helper( SlaveVP *newSlv,       TopLevelFnPtr  fnPtr,
   1.437 -                                void      *dataParam, void           *stackLocs );
   1.438 -
   1.439 -inline
   1.440 -PRMetaTask *
   1.441 -PR_int__create_generic_slave_meta_task( void *initData );
   1.442 -
   1.443 -inline
   1.444 -void
   1.445 -PR_int__reset_slaveVP_to_TopLvlFn( SlaveVP *slaveVP, TopLevelFnPtr fnPtr,
   1.446 -                              void    *dataParam);
   1.447 -
   1.448 -inline
   1.449 -void
   1.450 -PR_int__point_slaveVP_to_OneParamFn( SlaveVP *slaveVP, void *fnPtr,
   1.451 -                              void    *param);
   1.452 -
   1.453 -inline
   1.454 -void
   1.455 -PR_int__point_slaveVP_to_TwoParamFn( SlaveVP *slaveVP, void *fnPtr,
   1.456 -                              void    *param1, void *param2);
   1.457 -
   1.458 -inline
   1.459 -void
   1.460 -PR_int__dissipate_slaveVP( SlaveVP *slaveToDissipate );
   1.461 -#define PR_PI__dissipate_slaveVP PR_int__dissipate_slaveVP
   1.462 -//WL: dissipate a SlaveVP by sending a request
   1.463 -
   1.464 -inline
   1.465 -void
   1.466 -PR_int__dissipate_slaveVP_multilang( SlaveVP *slaveToDissipate );
   1.467 -
   1.468 -inline
   1.469 -void
   1.470 -PR_int__throw_exception( char *msgStr, SlaveVP *reqstSlv, PRExcp *excpData );
   1.471 -#define PR_PI__throw_exception  PR_int__throw_exception
   1.472 -void
   1.473 -PR_WL__throw_exception( char *msgStr, SlaveVP *reqstSlv,  PRExcp *excpData );
   1.474 -#define PR_App__throw_exception PR_WL__throw_exception
   1.475 -
   1.476 -inline
   1.477 -void *
   1.478 -PR_int__give_sem_env_for_slave( SlaveVP *slave, int32 magicNumber );
   1.479 -#define PR_PI__give_sem_env_for  PR_int__give_sem_env_for_slave
   1.480 -#define PR_SS__give_sem_env_for_slave  PR_int__give_sem_env_for_slave
   1.481 -//No WL version -- not safe!  if use env in WL, be sure data rd & wr is stable
   1.482 -inline
   1.483 -PRSemEnv *
   1.484 -PR_int__give_proto_sem_env_for_slave( SlaveVP *slave, int32 magicNumber );
   1.485 -#define PR_PI__give_proto_sem_env_for  PR_int__give_proto_sem_env_for_slave
   1.486 -#define PR_SS__give_proto_sem_env_for_slave  PR_int__give_proto_sem_env_for_slave
   1.487 -//No WL version -- not safe!  if use env in WL, be sure data rd & wr is stable
   1.488 -inline
   1.489 -void *
   1.490 -PR_int__give_sem_env_from_process( PRProcess *process, int32 magicNumer );
   1.491 -#define PR_PI__give_sem_env_from_process  PR_int__give_sem_env_from_process
   1.492 -#define PR_SS__give_sem_env_from_process  PR_int__give_sem_env_from_process
   1.493 -//#define PR_WL__give_sem_env_from_process  PR_int__give_sem_env_from_process
   1.494 -//No WL version -- not safe!  if use env in WL, be sure data rd & wr is stable
   1.495 -
   1.496 -inline
   1.497 -void *
   1.498 -PR_int__give_sem_data( SlaveVP *slave, int32 magicNumer );
   1.499 -#define PR_PI__give_sem_data  PR_int__give_sem_data
   1.500 -#define PR_SS__give_sem_data  PR_int__give_sem_data
   1.501 -#define PR_WL__give_sem_data  PR_int__give_sem_data
   1.502 -
   1.503 -
   1.504 -#define PR_int__give_lang_meta_task( slave, magicNumber )\
   1.505 -        slave->metaTask->langMetaTask;
   1.506 -#define PR_PI__give_lang_meta_task  PR_int__give_lang_meta_task
   1.507 -#define PR_SS__give_lang_meta_task  PR_int__give_lang_meta_task
   1.508 -#define PR_WL__give_lang_meta_task  PR_int__give_lang_meta_task
   1.509 -
   1.510 -inline
   1.511 -SlaveVP *
   1.512 -PR_PI__give_slave_assigned_to( PRLangMetaTask *langMetaTask );
   1.513 -        
   1.514 -void 
   1.515 -idle_fn(void* data, SlaveVP *animatingSlv);
   1.516 -
   1.517 -inline void
   1.518 -PR_int__get_master_lock();
   1.519 -
   1.520 -#define PR_int__release_master_lock() _PRTopEnv->masterLock = UNLOCKED
   1.521 -
   1.522 -inline uint32_t
   1.523 -PR_int__randomNumber();
   1.524 -
   1.525 -//==============  Request Related  ===============
   1.526 -
   1.527 -void
   1.528 -PR_WL__suspend_slaveVP_and_send_req( SlaveVP *callingSlv );
   1.529 -
   1.530 -inline void
   1.531 -PR_WL__add_sem_request_in_mallocd_PRReqst( void *semReqData, SlaveVP *callingSlv );
   1.532 -
   1.533 -inline void
   1.534 -PR_WL__send_sem_request( void *semReq, SlaveVP *callingSlv, int32 magicNum );
   1.535 -
   1.536 -void
   1.537 -PR_WL__send_create_slaveVP_req( void *semReqData, SlaveVP *reqstingSlv );
   1.538 -
   1.539 -void inline
   1.540 -PR_WL__send_dissipate_req( SlaveVP *prToDissipate );
   1.541 -
   1.542 -inline void
   1.543 -PR_WL__send_service_request( void *semReqData, SlaveVP *callingSlv );
   1.544 -
   1.545 -PRReqst *
   1.546 -PR_PI__take_next_request_out_of( SlaveVP *slaveWithReq );
   1.547 -//#define PR_PI__take_next_request_out_of( slave ) slave->requests
   1.548 -
   1.549 -//inline void *
   1.550 -//PR_PI__take_sem_reqst_from( PRReqst *req );
   1.551 -#define PR_PI__take_sem_reqst_from( req ) req->semReqData
   1.552 -
   1.553 -void inline
   1.554 -PR_int__handle_PRServiceReq( PRReqst *req, SlaveVP *requestingSlv, void *semEnv,
   1.555 -                       ResumeSlvFnPtr resumeSlvFnPtr );
   1.556 -
   1.557 -//======================== MEASUREMENT ======================
   1.558 -uint64
   1.559 -PR_WL__give_num_plugin_cycles();
   1.560 -uint32
   1.561 -PR_WL__give_num_plugin_animations();
   1.562 -
   1.563 -
   1.564 -//========================= Utilities =======================
   1.565 -inline char *
   1.566 -PR_int__strDup( char *str );
   1.567 -
   1.568 -
   1.569 -//=========================  PR request handlers  ========================
   1.570 -void inline
   1.571 -handleMakeProbe( PRServReq *semReq, void *semEnv, ResumeSlvFnPtr resumeFn );
   1.572 -
   1.573 -void inline
   1.574 -handleThrowException( PRServReq *semReq, void *semEnv, ResumeSlvFnPtr resumeFn );
   1.575 -//=======================================================================
   1.576 -
   1.577 -//========================= Probes =======================
   1.578 -#include "Services_Offered_by_PR/Measurement_and_Stats/probes.h"
   1.579 +//========================= Services =======================
   1.580 +//#include "Services_Offered_by_PR/Measurement_and_Stats/probes.h"
   1.581 +//#include  "Services_Offered_by_PR/Services_Language/PRServ.h"
   1.582 +//#include  "Services_Offered_by_PR/Services_Language/libPRServ.h"
   1.583  
   1.584  //================================================
   1.585  #endif	/* _PR_H */