seanhalle@260: /* seanhalle@270: * Copyright 2012 OpenSourceResearchInstitute.org seanhalle@260: * Licensed under GNU General Public License version 2 seanhalle@260: * seanhalle@260: * Author: seanhalle@yahoo.com seanhalle@260: * seanhalle@260: */ seanhalle@260: seanhalle@260: #ifndef _PR_H seanhalle@260: #define _PR_H seanhalle@260: #define _GNU_SOURCE seanhalle@260: seanhalle@260: #include "DynArray/DynArray.h" seanhalle@260: #include "Hash_impl/PrivateHash.h" seanhalle@260: #include "Histogram/Histogram.h" seanhalle@260: #include "Queue_impl/PrivateQueue.h" seanhalle@260: seanhalle@260: #include "PR_primitive_data_types.h" seanhalle@260: #include "Services_Offered_by_PR/Memory_Handling/vmalloc.h" seanhalle@260: seanhalle@260: #include seanhalle@260: #include seanhalle@260: seanhalle@260: //================= Defines: included from separate files ================= seanhalle@260: // seanhalle@260: // Note: ALL defines are in other files, none are in here seanhalle@260: // seanhalle@260: #include "Defines/PR_defs.h" seanhalle@260: seanhalle@260: seanhalle@260: //================================ Typedefs ================================= seanhalle@260: // seanhalle@268: #include "PR__structs.h" seanhalle@260: seanhalle@260: //============================ HW Dependent Fns ================================ seanhalle@260: seanhalle@260: #include "HW_Dependent_Primitives/PR__HW_measurement.h" seanhalle@260: #include "HW_Dependent_Primitives/PR__primitives.h" seanhalle@260: seanhalle@260: seanhalle@260: //============================= Global Vars ================================ seanhalle@260: seanhalle@268: volatile TopEnv *_PRTopEnv __align_to_cacheline__; seanhalle@260: seanhalle@260: //these are global, but only used for startup and shutdown seanhalle@260: pthread_t coreCtlrThdHandles[ NUM_CORES ]; //pthread's virt-procr state seanhalle@260: ThdParams *coreCtlrThdParams [ NUM_CORES ]; seanhalle@260: seanhalle@260: pthread_mutex_t suspendLock; seanhalle@260: pthread_cond_t suspendCond; seanhalle@260: seanhalle@260: //========================= Function Prototypes =========================== seanhalle@260: /* MEANING OF WL PI SS int PROS seanhalle@260: * These indicate which places the function is safe to use. They stand for: seanhalle@260: * seanhalle@260: * WL Wrapper Library -- wrapper lib code should only use these seanhalle@260: * PI Plugin -- plugin code should only use these seanhalle@260: * SS Startup and Shutdown -- designates these relate to startup & shutdown seanhalle@268: * int32internal to PR -- should not be used in wrapper lib or plugin seanhalle@260: * PROS means "OS functions for applications to use" seanhalle@260: * seanhalle@260: * PR_int__ functions touch internal PR data structs and are only safe seanhalle@260: * to be used inside the master lock. However, occasionally, they appear seanhalle@260: * in wrapper-lib or plugin code. In those cases, very careful analysis seanhalle@260: * has been done to be sure no concurrency issues could arise. seanhalle@260: * seanhalle@260: * PR_WL__ functions are all safe for use outside the master lock. seanhalle@260: * seanhalle@268: * PR_OS are only safe for applications to use -- they're like a second seanhalle@260: * language mixed in -- but they can't be used inside plugin code, and seanhalle@260: * aren't meant for use in wrapper libraries, because they are themselves seanhalle@260: * wrapper-library calls! seanhalle@260: */ seanhalle@260: seanhalle@270: inline bool32 masterFunction( AnimSlot *slot ); seanhalle@270: seanhalle@268: //============== include internally used fn prototypes ================ seanhalle@260: seanhalle@268: //include fn prototypes used internally in the proto-runtime implementation seanhalle@268: #include "PR__int.h" seanhalle@260: seanhalle@268: //include fn prototypes used by plugin seanhalle@268: #include "PR__PI.h" seanhalle@260: seanhalle@268: //include fn prototype used by wrapper library seanhalle@268: #include "PR__WL.h" seanhalle@260: seanhalle@268: //================================= seanhalle@273: #define implement_me() printf("Unimpl Fn: \n%s \n%s : %d\n", __FILE__, __FUNCTION__, __LINE__) seanhalle@268: //#define fix_me printf("Fix me at: \n%s \n%s : %s\n", __FILE__, __FUNCTION__, __LINE__) seanhalle@260: seanhalle@260: seanhalle@268: //========================= Services ======================= seanhalle@272: #include "Services_Offered_by_PR/Measurement_and_Stats/probes.h" seanhalle@272: #include "Services_Offered_by_PR/Services_Language/PRServ.h" seanhalle@268: //#include "Services_Offered_by_PR/Services_Language/libPRServ.h" seanhalle@260: seanhalle@260: //================================================ seanhalle@260: #endif /* _PR_H */ seanhalle@260: