annotate PR.h @ 287:15ee3fe10e3d

Fixed issue with meta tasks -- in slot slave, have to replace previous Also fixed give taskID, and added SS give num cores added "replace or insert into collection" so that prev meta task is replaced
author Sean Halle <seanhalle@yahoo.com>
date Thu, 05 Sep 2013 17:38:19 -0700
parents bc5030385120
children
rev   line source
seanhalle@260 1 /*
seanhalle@270 2 * Copyright 2012 OpenSourceResearchInstitute.org
seanhalle@260 3 * Licensed under GNU General Public License version 2
seanhalle@260 4 *
seanhalle@260 5 * Author: seanhalle@yahoo.com
seanhalle@260 6 *
seanhalle@260 7 */
seanhalle@260 8
seanhalle@260 9 #ifndef _PR_H
seanhalle@260 10 #define _PR_H
seanhalle@260 11 #define _GNU_SOURCE
seanhalle@260 12
seanhalle@260 13 #include "DynArray/DynArray.h"
seanhalle@260 14 #include "Hash_impl/PrivateHash.h"
seanhalle@260 15 #include "Histogram/Histogram.h"
seanhalle@260 16 #include "Queue_impl/PrivateQueue.h"
seanhalle@260 17
seanhalle@260 18 #include "PR_primitive_data_types.h"
seanhalle@260 19 #include "Services_Offered_by_PR/Memory_Handling/vmalloc.h"
seanhalle@260 20
seanhalle@260 21 #include <pthread.h>
seanhalle@260 22 #include <sys/time.h>
seanhalle@260 23
seanhalle@260 24 //================= Defines: included from separate files =================
seanhalle@260 25 //
seanhalle@260 26 // Note: ALL defines are in other files, none are in here
seanhalle@260 27 //
seanhalle@260 28 #include "Defines/PR_defs.h"
seanhalle@260 29
seanhalle@260 30
seanhalle@260 31 //================================ Typedefs =================================
seanhalle@260 32 //
seanhalle@268 33 #include "PR__structs.h"
seanhalle@260 34
seanhalle@260 35 //============================ HW Dependent Fns ================================
seanhalle@260 36
seanhalle@260 37 #include "HW_Dependent_Primitives/PR__HW_measurement.h"
seanhalle@260 38 #include "HW_Dependent_Primitives/PR__primitives.h"
seanhalle@260 39
seanhalle@260 40
seanhalle@260 41 //============================= Global Vars ================================
seanhalle@260 42
seanhalle@268 43 volatile TopEnv *_PRTopEnv __align_to_cacheline__;
seanhalle@260 44
seanhalle@260 45 //these are global, but only used for startup and shutdown
seanhalle@260 46 pthread_t coreCtlrThdHandles[ NUM_CORES ]; //pthread's virt-procr state
seanhalle@260 47 ThdParams *coreCtlrThdParams [ NUM_CORES ];
seanhalle@260 48
seanhalle@260 49 pthread_mutex_t suspendLock;
seanhalle@260 50 pthread_cond_t suspendCond;
seanhalle@260 51
seanhalle@260 52 //========================= Function Prototypes ===========================
seanhalle@260 53 /* MEANING OF WL PI SS int PROS
seanhalle@260 54 * These indicate which places the function is safe to use. They stand for:
seanhalle@260 55 *
seanhalle@260 56 * WL Wrapper Library -- wrapper lib code should only use these
seanhalle@260 57 * PI Plugin -- plugin code should only use these
seanhalle@260 58 * SS Startup and Shutdown -- designates these relate to startup & shutdown
seanhalle@268 59 * int32internal to PR -- should not be used in wrapper lib or plugin
seanhalle@260 60 * PROS means "OS functions for applications to use"
seanhalle@260 61 *
seanhalle@260 62 * PR_int__ functions touch internal PR data structs and are only safe
seanhalle@260 63 * to be used inside the master lock. However, occasionally, they appear
seanhalle@260 64 * in wrapper-lib or plugin code. In those cases, very careful analysis
seanhalle@260 65 * has been done to be sure no concurrency issues could arise.
seanhalle@260 66 *
seanhalle@260 67 * PR_WL__ functions are all safe for use outside the master lock.
seanhalle@260 68 *
seanhalle@268 69 * PR_OS are only safe for applications to use -- they're like a second
seanhalle@260 70 * language mixed in -- but they can't be used inside plugin code, and
seanhalle@260 71 * aren't meant for use in wrapper libraries, because they are themselves
seanhalle@260 72 * wrapper-library calls!
seanhalle@260 73 */
seanhalle@260 74
seanhalle@270 75 inline bool32 masterFunction( AnimSlot *slot );
seanhalle@270 76
seanhalle@268 77 //============== include internally used fn prototypes ================
seanhalle@260 78
seanhalle@268 79 //include fn prototypes used internally in the proto-runtime implementation
seanhalle@268 80 #include "PR__int.h"
seanhalle@260 81
seanhalle@268 82 //include fn prototypes used by plugin
seanhalle@268 83 #include "PR__PI.h"
seanhalle@260 84
seanhalle@268 85 //include fn prototype used by wrapper library
seanhalle@268 86 #include "PR__WL.h"
seanhalle@260 87
seanhalle@268 88 //=================================
seanhalle@273 89 #define implement_me() printf("Unimpl Fn: \n%s \n%s : %d\n", __FILE__, __FUNCTION__, __LINE__)
seanhalle@268 90 //#define fix_me printf("Fix me at: \n%s \n%s : %s\n", __FILE__, __FUNCTION__, __LINE__)
seanhalle@260 91
seanhalle@260 92
seanhalle@268 93 //========================= Services =======================
seanhalle@272 94 #include "Services_Offered_by_PR/Measurement_and_Stats/probes.h"
seanhalle@272 95 #include "Services_Offered_by_PR/Services_Language/PRServ.h"
seanhalle@268 96 //#include "Services_Offered_by_PR/Services_Language/libPRServ.h"
seanhalle@260 97
seanhalle@260 98 //================================================
seanhalle@260 99 #endif /* _PR_H */
seanhalle@260 100