changeset 3:26458f2b5c23 Dev_libs

started dividing up PR__common.h and PR__common_structs.h versus what's in PR.h
author Sean Halle <seanhalle@yahoo.com>
date Sun, 21 Jul 2013 13:41:59 -0700
parents e2db79e48144
children ee229dfdc891
files PR__WL.h PR__common.h PR__common_structs.h
diffstat 3 files changed, 49 insertions(+), 67 deletions(-) [+]
line diff
     1.1 --- a/PR__WL.h	Fri Jul 19 12:09:34 2013 -0700
     1.2 +++ b/PR__WL.h	Sun Jul 21 13:41:59 2013 -0700
     1.3 @@ -6,12 +6,18 @@
     1.4   * 
     1.5   */
     1.6  
     1.7 + 
     1.8 + 
     1.9 +/* This header defines the PR functions available to the language's
    1.10 + *  wrapper library.
    1.11 + */
    1.12 + 
    1.13  #ifndef _PR__WL_H
    1.14  #define	_PR__WL_H
    1.15  #define _GNU_SOURCE
    1.16  
    1.17 -#include "PR_primitive_data_types.h"
    1.18 -#include "PR__structs.h"
    1.19 +#include "PR__common/PR__primitive_data_types.h"
    1.20 +#include "PR__common/PR__common_structs.h"
    1.21  //=========================  Function Prototypes  ===========================
    1.22  /* MEANING OF   WL  PI  SS  int PROS
    1.23   * These indicate which places the function is safe to use.  They stand for:
     2.1 --- a/PR__common.h	Fri Jul 19 12:09:34 2013 -0700
     2.2 +++ b/PR__common.h	Sun Jul 21 13:41:59 2013 -0700
     2.3 @@ -10,80 +10,57 @@
     2.4  #define	_PR_H
     2.5  #define _GNU_SOURCE
     2.6  
     2.7 -#include "DynArray/DynArray.h"
     2.8 -#include "Hash_impl/PrivateHash.h"
     2.9 -#include "Histogram/Histogram.h"
    2.10 -#include "Queue_impl/PrivateQueue.h"
    2.11 +//#include "DynArray/DynArray.h"
    2.12 +//#include "Hash_impl/PrivateHash.h"
    2.13 +//#include "Histogram/Histogram.h"
    2.14 +//#include "Queue_impl/PrivateQueue.h"
    2.15  
    2.16 -#include "PR_primitive_data_types.h"
    2.17 -#include "Services_Offered_by_PR/Memory_Handling/vmalloc.h"
    2.18 +#include "PR__primitive_data_types.h"
    2.19 +#include "PR__common_structs.h"
    2.20 +//#include "Services_Offered_by_PR/Memory_Handling/vmalloc.h"
    2.21  
    2.22 -#include <pthread.h>
    2.23 -#include <sys/time.h>
    2.24 +//#include <pthread.h>
    2.25 +//#include <sys/time.h>
    2.26  
    2.27  //=================  Defines: included from separate files  =================
    2.28  //
    2.29  // Note: ALL defines are in other files, none are in here
    2.30  //
    2.31 -#include "Defines/PR_defs.h"
    2.32 +//#include "Defines/PR_defs.h"
    2.33  
    2.34  
    2.35  //================================ Typedefs =================================
    2.36  //
    2.37 -#include "PR__structs.h"
    2.38 +//#include "PR__structs.h"
    2.39  
    2.40  //============================ HW Dependent Fns ================================
    2.41  
    2.42 -#include "HW_Dependent_Primitives/PR__HW_measurement.h"
    2.43 -#include "HW_Dependent_Primitives/PR__primitives.h"
    2.44 +//#include "HW_Dependent_Primitives/PR__HW_measurement.h"
    2.45 +//#include "HW_Dependent_Primitives/PR__primitives.h"
    2.46  
    2.47  
    2.48  //=============================  Global Vars ================================
    2.49  
    2.50 -volatile TopEnv      *_PRTopEnv __align_to_cacheline__;
    2.51 +//volatile TopEnv      *_PRTopEnv __align_to_cacheline__;
    2.52  
    2.53     //these are global, but only used for startup and shutdown
    2.54 -pthread_t       coreCtlrThdHandles[ NUM_CORES ]; //pthread's virt-procr state
    2.55 -ThdParams      *coreCtlrThdParams [ NUM_CORES ];
    2.56 +//pthread_t       coreCtlrThdHandles[ NUM_CORES ]; //pthread's virt-procr state
    2.57 +//ThdParams      *coreCtlrThdParams [ NUM_CORES ];
    2.58  
    2.59 -pthread_mutex_t suspendLock;
    2.60 -pthread_cond_t  suspendCond;
    2.61 +//pthread_mutex_t suspendLock;
    2.62 +//pthread_cond_t  suspendCond;
    2.63  
    2.64 -//=========================  Function Prototypes  ===========================
    2.65 -/* MEANING OF   WL  PI  SS  int PROS
    2.66 - * These indicate which places the function is safe to use.  They stand for:
    2.67 - * 
    2.68 - * WL   Wrapper Library -- wrapper lib code should only use these
    2.69 - * PI   Plugin          -- plugin code should only use these
    2.70 - * SS   Startup and Shutdown -- designates these relate to startup & shutdown
    2.71 - * int32internal to PR -- should not be used in wrapper lib or plugin
    2.72 - * PROS means "OS functions for applications to use"
    2.73 - * 
    2.74 - * PR_int__ functions touch internal PR data structs and are only safe
    2.75 - *  to be used inside the master lock.  However, occasionally, they appear
    2.76 - * in wrapper-lib or plugin code.  In those cases, very careful analysis
    2.77 - * has been done to be sure no concurrency issues could arise.
    2.78 - * 
    2.79 - * PR_WL__ functions are all safe for use outside the master lock.
    2.80 - * 
    2.81 - * PR_OS are only safe for applications to use -- they're like a second
    2.82 - * language mixed in -- but they can't be used inside plugin code, and
    2.83 - * aren't meant for use in wrapper libraries, because they are themselves
    2.84 - * wrapper-library calls!
    2.85 - */
    2.86 -
    2.87 -inline bool32 masterFunction( AnimSlot  *slot );
    2.88  
    2.89  //============== include internally used fn prototypes ================
    2.90  
    2.91  //include fn prototypes used internally in the proto-runtime implementation
    2.92 -#include "PR__int.h"
    2.93 +//#include "PR__int.h"
    2.94  
    2.95  //include fn prototypes used by plugin
    2.96 -#include "PR__PI.h"
    2.97 +//#include "PR__PI.h"
    2.98  
    2.99  //include fn prototype used by wrapper library
   2.100 -#include "PR__WL.h"
   2.101 +//#include "PR__WL.h"
   2.102  
   2.103  //=================================
   2.104  #define implement_me() printf("Unimpl Fn: \n%s \n%s : %d\n", __FILE__, __FUNCTION__, __LINE__)
   2.105 @@ -91,8 +68,8 @@
   2.106  
   2.107  
   2.108  //========================= Services =======================
   2.109 -#include "Services_Offered_by_PR/Measurement_and_Stats/probes.h"
   2.110 -#include "Services_Offered_by_PR/Services_Language/PRServ.h"
   2.111 +//#include "Services_Offered_by_PR/Measurement_and_Stats/probes.h"
   2.112 +//#include "Services_Offered_by_PR/Services_Language/PRServ.h"
   2.113  //#include  "Services_Offered_by_PR/Services_Language/libPRServ.h"
   2.114  
   2.115  //================================================
     3.1 --- a/PR__common_structs.h	Fri Jul 19 12:09:34 2013 -0700
     3.2 +++ b/PR__common_structs.h	Sun Jul 21 13:41:59 2013 -0700
     3.3 @@ -10,10 +10,8 @@
     3.4  #define	_PR__structs_H
     3.5  #define _GNU_SOURCE
     3.6  
     3.7 -#include "PR_primitive_data_types.h"
     3.8 -
     3.9 -#include <pthread.h>
    3.10 -#include <sys/time.h>
    3.11 +//#include <pthread.h>
    3.12 +//#include <sys/time.h>
    3.13  
    3.14  
    3.15  //================================ Typedefs =================================
    3.16 @@ -21,19 +19,19 @@
    3.17  //=
    3.18  #define ZERO 0
    3.19  
    3.20 -typedef unsigned long long    TSCount;
    3.21 +//typedef unsigned long long    TSCount;
    3.22  
    3.23 -typedef struct _AnimSlot      AnimSlot;
    3.24 -typedef struct _PRReqst       PRReqst;
    3.25 +//typedef struct _AnimSlot      AnimSlot;
    3.26 +//typedef struct _PRReqst       PRReqst;
    3.27  typedef struct _SlaveVP       SlaveVP;
    3.28 -typedef struct _MasterVP      MasterVP;
    3.29 +//typedef struct _MasterVP      MasterVP;
    3.30  typedef struct _IntervalProbe IntervalProbe;
    3.31 -typedef struct _PRLangEnv     PRLangEnv;  //a prolog
    3.32 +//typedef struct _PRLangEnv     PRLangEnv;  //a prolog
    3.33  typedef struct _PRMetaTask    PRMetaTask; //a prolog
    3.34 -typedef struct _PRLangData    PRLangData; //a prolog
    3.35 -typedef struct _PRCollElem    PRCollElem; //generic form of the prologs
    3.36 +//typedef struct _PRLangData    PRLangData; //a prolog
    3.37 +//typedef struct _PRCollElem    PRCollElem; //generic form of the prologs
    3.38  
    3.39 -typedef bool32   (*SlaveAssigner)  ( void *, AnimSlot* ); //langEnv, slot for HW info
    3.40 +//typedef bool32   (*SlaveAssigner)  ( void *, AnimSlot* ); //langEnv, slot for HW info
    3.41  typedef void     (*RequestHandler) ( void *, SlaveVP *, void * ); //req, slv, langEnv
    3.42  typedef void    *(*CreateHandler)  ( void *, SlaveVP *, void * ); //req, slv, langEnv
    3.43  typedef void     (*LangShutdownHdlr) ( void * ); //langEnv
    3.44 @@ -41,19 +39,19 @@
    3.45  typedef void     (*LangDataFreer)    ( void * ); //lang data to free
    3.46  typedef void    *(*LangMetaTaskCreator)( SlaveVP * );  //when slave has no meta task for magic num 
    3.47  typedef void     (*LangMetaTaskFreer)  ( void * ); //lang meta task to free
    3.48 -typedef void     (*MakeSlaveReadyFn)   ( SlaveVP *, void * ); //slave and langEnv
    3.49 -typedef void     (*MakeTaskReadyFn)    ( void *, void * ); //langTask and langEnv
    3.50 +//typedef void     (*MakeSlaveReadyFn)   ( SlaveVP *, void * ); //slave and langEnv
    3.51 +//typedef void     (*MakeTaskReadyFn)    ( void *, void * ); //langTask and langEnv
    3.52  typedef void     (*BirthFnPtr)  ( void *, SlaveVP * ); //initData, animSlv
    3.53  typedef void       BirthFn      ( void *, SlaveVP * ); //initData, animSlv
    3.54 -typedef void     (*ResumeSlvFnPtr) ( SlaveVP *, void * );
    3.55 +//typedef void     (*ResumeSlvFnPtr) ( SlaveVP *, void * );
    3.56        //=========== MEASUREMENT STUFF ==========
    3.57 -        MEAS__Insert_Counter_Handler
    3.58 +//        MEAS__Insert_Counter_Handler
    3.59        //========================================
    3.60  
    3.61  //============================ HW Dependent Fns ================================
    3.62  
    3.63 -#include "HW_Dependent_Primitives/PR__HW_measurement.h"
    3.64 -#include "HW_Dependent_Primitives/PR__primitives.h"
    3.65 +//#include "HW_Dependent_Primitives/PR__HW_measurement.h"
    3.66 +//#include "HW_Dependent_Primitives/PR__primitives.h"
    3.67  
    3.68  
    3.69  typedef struct
    3.70 @@ -70,6 +68,7 @@
    3.71   * stores information about what percent of CPU time the program is getting, 
    3.72   * 
    3.73   */
    3.74 +/*
    3.75  typedef struct
    3.76   { 
    3.77     int32     numEnvsWithWork;
    3.78 @@ -113,7 +112,7 @@
    3.79        //==========================================
    3.80   }
    3.81  PRProcess;
    3.82 -
    3.83 +*/
    3.84  
    3.85  //============= Request Related ===========
    3.86  //