# HG changeset patch # User Nina Engelhardt # Date 1348582275 -7200 # Node ID f5b110414453df7511ef9f0bd240b95ba3cd9233 # Parent 2bcf37fd50c6fb02d45a55ce4cf3efb2c0de86c9 fix coding standard to work with -std=gnu99 -Wall diff -r 2bcf37fd50c6 -r f5b110414453 AnimationMaster.c --- a/AnimationMaster.c Mon Sep 10 01:26:51 2012 -0700 +++ b/AnimationMaster.c Tue Sep 25 16:11:15 2012 +0200 @@ -11,7 +11,8 @@ #include "VMS.h" - +#include +ssize_t read(int fd, void *buf, size_t count); /*The animationMaster embodies most of the animator of the language. The * animator is what emodies the behavior of language constructs. diff -r 2bcf37fd50c6 -r f5b110414453 CoreController.c --- a/CoreController.c Mon Sep 10 01:26:51 2012 -0700 +++ b/CoreController.c Tue Sep 25 16:11:15 2012 +0200 @@ -14,13 +14,16 @@ #include #include +#include +ssize_t read(int fd, void *buf, size_t count); + //===================== Functions local to this file ======================= void *terminateCoreController(SlaveVP *currSlv); -inline void +void doBackoff_for_TooLongToGetLock( int32 numTriesToGetLock, uint32 *seed1, uint32 *seed2 ); -inline void +void doBackoff_for_TooLongWithNoWork( int32 numRepsWithNoWork, uint32 *seed1, uint32 *seed2 ); @@ -81,7 +84,9 @@ cpu_set_t coreMask; //used during pinning pthread to CPU core int32 errorCode; //Variables used during measurements +#ifdef MEAS__TURN_ON_SYSTEM_MEAS TSCountLowHigh endSusp; +#endif //Variables used in random-backoff, for master-lock and waiting for work uint32_t seed1 = rand()%1000; // init random number generator for backoffs uint32_t seed2 = rand()%1000; @@ -120,7 +125,7 @@ HOLISTIC__CoreCtrl_Setup; - DEBUG__printf1(TRUE, "started coreCtrlr", thisCoresIdx ); + DEBUG__printf1(TRUE, "started coreCtrlr on core %d", thisCoresIdx ); //====================== The Core Controller ====================== while(1) //An endless loop is just one way of doing the control structure @@ -222,7 +227,7 @@ pthread_exit( NULL ); } -inline uint32_t +uint32_t randomNumber() { _VMSMasterEnv->seed1 = (uint32)(36969 * (_VMSMasterEnv->seed1 & 65535) + @@ -237,7 +242,7 @@ /*Busy-wait for a random number of cycles -- chooses number of cycles * differently than for the too-many-tries-to-get-lock backoff */ -inline void +void doBackoff_for_TooLongWithNoWork( int32 numRepsWithNoWork, uint32 *seed1, uint32 *seed2 ) { int32 i, waitIterations; @@ -256,7 +261,7 @@ /*Busy-waits for a random number of cycles -- chooses number of cycles * differently than for the no-work backoff */ -inline void +void doBackoff_for_TooLongToGetLock( int32 numTriesToGetLock, uint32 *seed1, uint32 *seed2 ) { int32 i, waitIterations; diff -r 2bcf37fd50c6 -r f5b110414453 HW_Dependent_Primitives/VMS__HW_measurement.c --- a/HW_Dependent_Primitives/VMS__HW_measurement.c Mon Sep 10 01:26:51 2012 -0700 +++ b/HW_Dependent_Primitives/VMS__HW_measurement.c Tue Sep 25 16:11:15 2012 +0200 @@ -4,6 +4,7 @@ #include #include #include +#include #include #include "../VMS.h" diff -r 2bcf37fd50c6 -r f5b110414453 HW_Dependent_Primitives/VMS__HW_measurement.h --- a/HW_Dependent_Primitives/VMS__HW_measurement.h Mon Sep 10 01:26:51 2012 -0700 +++ b/HW_Dependent_Primitives/VMS__HW_measurement.h Tue Sep 25 16:11:15 2012 +0200 @@ -50,7 +50,7 @@ /* clobber */ : "%eax", "%edx" \ ); -inline TSCount getTSCount(); + TSCount getTSCount(); //For code that calculates normalization-offset between TSC counts of diff -r 2bcf37fd50c6 -r f5b110414453 HW_Dependent_Primitives/VMS__primitives.c --- a/HW_Dependent_Primitives/VMS__primitives.c Mon Sep 10 01:26:51 2012 -0700 +++ b/HW_Dependent_Primitives/VMS__primitives.c Tue Sep 25 16:11:15 2012 +0200 @@ -17,7 +17,7 @@ * some wrapper-libraries (but only "int" version, to warn users to check * carefully that it's safe) */ -inline void +void VMS_int__reset_slaveVP_to_TopLvlFn( SlaveVP *slaveVP, TopLevelFnPtr fnPtr, void *dataParam) { void *stackPtr; @@ -61,7 +61,7 @@ * *This preserves the stack state existed at time slave was suspended. */ -inline void +void VMS_int__point_slaveVP_to_OneParamFn( SlaveVP *slaveVP, void *fnPtr, void *param) { void *stackPtr; @@ -102,7 +102,7 @@ * *This preserves the stack state existed at time slave was suspended. */ -inline void +void VMS_int__point_slaveVP_to_TwoParamFn( SlaveVP *slaveVP, void *fnPtr, void *param1, void *param2) { void *stackPtr; diff -r 2bcf37fd50c6 -r f5b110414453 HW_Dependent_Primitives/VMS__primitives.h --- a/HW_Dependent_Primitives/VMS__primitives.h Mon Sep 10 01:26:51 2012 -0700 +++ b/HW_Dependent_Primitives/VMS__primitives.h Tue Sep 25 16:11:15 2012 +0200 @@ -43,11 +43,11 @@ void VMS_int__return_to_addr_in_ptd_to_loc(void *ptdToLoc); -inline void +void VMS_int__point_slaveVP_to_OneParamFn( SlaveVP *slaveVP, void *fnPtr, void *param); -inline void +void VMS_int__point_slaveVP_to_TwoParamFn( SlaveVP *slaveVP, void *fnPtr, void *param1, void *param2); diff -r 2bcf37fd50c6 -r f5b110414453 Services_Offered_by_VMS/Lang_Constructs/VMS_Lang.h --- a/Services_Offered_by_VMS/Lang_Constructs/VMS_Lang.h Mon Sep 10 01:26:51 2012 -0700 +++ b/Services_Offered_by_VMS/Lang_Constructs/VMS_Lang.h Tue Sep 25 16:11:15 2012 +0200 @@ -16,27 +16,27 @@ *Such constructs are used in application code, mixed-in with calls to * constructs of the VMS-based language. */ -inline void +void handleMalloc( SSRSemReq *semReq, SlaveVP *requestingSlv, SSRSemEnv *semEnv); -inline void +void handleFree( SSRSemReq *semReq, SlaveVP *requestingSlv, SSRSemEnv *semEnv ); -inline void +void handleTransEnd(SSRSemReq *semReq, SlaveVP *requestingSlv, SSRSemEnv*semEnv); -inline void +void handleTransStart( SSRSemReq *semReq, SlaveVP *requestingSlv, SSRSemEnv *semEnv ); -inline void +void handleAtomic( SSRSemReq *semReq, SlaveVP *requestingSlv, SSRSemEnv *semEnv); -inline void +void handleStartFnSingleton( SSRSemReq *semReq, SlaveVP *reqstingSlv, SSRSemEnv *semEnv ); -inline void +void handleEndFnSingleton( SSRSemReq *semReq, SlaveVP *requestingSlv, SSRSemEnv *semEnv ); -inline void +void handleStartDataSingleton( SSRSemReq *semReq, SlaveVP *reqstingSlv, SSRSemEnv *semEnv ); -inline void +void handleEndDataSingleton( SSRSemReq *semReq, SlaveVP *requestingSlv, SSRSemEnv *semEnv ); diff -r 2bcf37fd50c6 -r f5b110414453 Services_Offered_by_VMS/Measurement_and_Stats/probes.c --- a/Services_Offered_by_VMS/Measurement_and_Stats/probes.c Mon Sep 10 01:26:51 2012 -0700 +++ b/Services_Offered_by_VMS/Measurement_and_Stats/probes.c Tue Sep 25 16:11:15 2012 +0200 @@ -32,7 +32,7 @@ */ //============================ Helpers =========================== -inline void +void doNothing() { } diff -r 2bcf37fd50c6 -r f5b110414453 Services_Offered_by_VMS/Memory_Handling/vmalloc.c --- a/Services_Offered_by_VMS/Memory_Handling/vmalloc.c Mon Sep 10 01:26:51 2012 -0700 +++ b/Services_Offered_by_VMS/Memory_Handling/vmalloc.c Tue Sep 25 16:11:15 2012 +0200 @@ -421,7 +421,7 @@ MALLOC_ADDITIONAL_MEM_FROM_OS_SIZE - sizeof(MallocProlog)); firstChunk->nextChunkInFreeList = NULL; //previous element in the queue is the container - firstChunk->prevChunkInFreeList = &freeLists->bigChunks[container-2]; + firstChunk->prevChunkInFreeList = (MallocProlog*) &freeLists->bigChunks[container-2]; freeLists->bigChunks[container-2] = firstChunk; //Insert into bit search list diff -r 2bcf37fd50c6 -r f5b110414453 VMS.h --- a/VMS.h Mon Sep 10 01:26:51 2012 -0700 +++ b/VMS.h Tue Sep 25 16:11:15 2012 +0200 @@ -282,7 +282,7 @@ //============== =============== -inline SlaveVP * +SlaveVP * VMS_int__create_slaveVP( TopLevelFnPtr fnPtr, void *dataParam ); #define VMS_PI__create_slaveVP VMS_int__create_slaveVP #define VMS_WL__create_slaveVP VMS_int__create_slaveVP @@ -292,19 +292,19 @@ SlaveVP * VMS_ext__create_slaveVP( TopLevelFnPtr fnPtr, void *dataParam ); -inline SlaveVP * +SlaveVP * VMS_int__create_slaveVP_helper( SlaveVP *newSlv, TopLevelFnPtr fnPtr, void *dataParam, void *stackLocs ); -inline void +void VMS_int__reset_slaveVP_to_TopLvlFn( SlaveVP *slaveVP, TopLevelFnPtr fnPtr, void *dataParam); -inline void +void VMS_int__point_slaveVP_to_OneParamFn( SlaveVP *slaveVP, void *fnPtr, void *param); -inline void +void VMS_int__point_slaveVP_to_TwoParamFn( SlaveVP *slaveVP, void *fnPtr, void *param1, void *param2); @@ -330,12 +330,12 @@ //No WL version -- not safe! if use in WL, be sure data rd & wr is stable -inline void +void VMS_int__get_master_lock(); #define VMS_int__release_master_lock() _VMSMasterEnv->masterLock = UNLOCKED -inline uint32_t +uint32_t VMS_int__randomNumber(); //============== Request Related =============== @@ -343,30 +343,30 @@ void VMS_int__suspend_slaveVP_and_send_req( SlaveVP *callingSlv ); -inline void +void VMS_WL__add_sem_request_in_mallocd_VMSReqst( void *semReqData, SlaveVP *callingSlv ); -inline void +void VMS_WL__send_sem_request( void *semReqData, SlaveVP *callingSlv ); void VMS_WL__send_create_slaveVP_req( void *semReqData, SlaveVP *reqstingSlv ); -void inline +void VMS_WL__send_dissipate_req( SlaveVP *prToDissipate ); -inline void +void VMS_WL__send_VMSSem_request( void *semReqData, SlaveVP *callingSlv ); VMSReqst * VMS_PI__take_next_request_out_of( SlaveVP *slaveWithReq ); //#define VMS_PI__take_next_request_out_of( slave ) slave->requests -//inline void * +//void * //VMS_PI__take_sem_reqst_from( VMSReqst *req ); #define VMS_PI__take_sem_reqst_from( req ) req->semReqData -void inline +void VMS_PI__handle_VMSSemReq( VMSReqst *req, SlaveVP *requestingSlv, void *semEnv, ResumeSlvFnPtr resumeSlvFnPtr ); @@ -378,7 +378,7 @@ //========================= Utilities ======================= -inline char * +char * VMS_int__strDup( char *str ); diff -r 2bcf37fd50c6 -r f5b110414453 VMS__PI.c --- a/VMS__PI.c Mon Sep 10 01:26:51 2012 -0700 +++ b/VMS__PI.c Tue Sep 25 16:11:15 2012 +0200 @@ -23,10 +23,10 @@ */ //========================= Local Declarations ======================== -void inline +void handleMakeProbe( VMSSemReq *semReq, void *semEnv, ResumeSlvFnPtr resumeFn ); -void inline +void handleThrowException( VMSSemReq *semReq, void *semEnv, ResumeSlvFnPtr resumeFn ); //======================================================================= @@ -49,7 +49,7 @@ * *Turn function into macro that just accesses the request field * -inline void * + void * VMS_PI__take_sem_reqst_from( VMSReqst *req ) { return req->semReqData; @@ -71,7 +71,7 @@ * VMS-core steer the request to appropriate plugin * Do the same for OS calls -- look later at it.. */ -void inline +void VMS_PI__handle_VMSSemReq( VMSReqst *req, SlaveVP *requestingSlv, void *semEnv, ResumeSlvFnPtr resumeFn ) { VMSSemReq *semReq; @@ -84,6 +84,8 @@ break; case throw_excp: handleThrowException( semReq, semEnv, resumeFn); break; + default: + break; } } diff -r 2bcf37fd50c6 -r f5b110414453 VMS__WL.c --- a/VMS__WL.c Mon Sep 10 01:26:51 2012 -0700 +++ b/VMS__WL.c Tue Sep 25 16:11:15 2012 +0200 @@ -94,7 +94,7 @@ * *The request handler has to call VMS_int__free_VMSReq for any of these */ -inline void +void VMS_WL__add_sem_request_in_mallocd_VMSReqst( void *semReqData, SlaveVP *callingSlv ) { VMSReqst *req; @@ -111,7 +111,7 @@ * to plugin *Then it does suspend, to cause request to be sent. */ -inline void +void VMS_WL__send_sem_request( void *semReqData, SlaveVP *callingSlv ) { VMSReqst req; @@ -127,7 +127,7 @@ /*May 2012 Not sure what this is.. looks like old idea for VMS semantic * request */ -inline void +void VMS_WL__send_VMSSem_request( void *semReqData, SlaveVP *callingSlv ) { VMSReqst req; diff -r 2bcf37fd50c6 -r f5b110414453 VMS__int.c --- a/VMS__int.c Mon Sep 10 01:26:51 2012 -0700 +++ b/VMS__int.c Tue Sep 25 16:11:15 2012 +0200 @@ -11,8 +11,12 @@ #include #include +#include + #include "VMS.h" +#include +ssize_t read(int fd, void *buf, size_t count); /* MEANING OF WL PI SS int * These indicate which places the function is safe to use. They stand for: @@ -23,7 +27,7 @@ */ -inline SlaveVP * +SlaveVP * VMS_int__create_slaveVP( TopLevelFnPtr fnPtr, void *dataParam ) { SlaveVP *newSlv; void *stackLocs; @@ -42,7 +46,7 @@ * be called from main thread or other thread -- never from code animated by * a VMS virtual processor. */ -inline SlaveVP * +SlaveVP * VMS_ext__create_slaveVP( TopLevelFnPtr fnPtr, void *dataParam ) { SlaveVP *newSlv; char *stackLocs; @@ -173,7 +177,7 @@ /* * */ -inline SlaveVP * +SlaveVP * VMS_int__create_slaveVP_helper( SlaveVP *newSlv, TopLevelFnPtr fnPtr, void *dataParam, void *stackLocs ) { @@ -212,7 +216,7 @@ } -inline char * +char * VMS_int__strDup( char *str ) { char *retStr; @@ -224,12 +228,12 @@ } -inline void +void VMS_int__backoff_for_TooLongToGetLock( int32 numTriesToGetLock ); -inline void +void VMS_int__get_master_lock() - { int32 *addrOfMasterLock; + { volatile int32 *addrOfMasterLock; addrOfMasterLock = &(_VMSMasterEnv->masterLock); @@ -246,7 +250,7 @@ } if( numTriesToGetLock > MASTERLOCK_RETRIES_BEFORE_YIELD ) { numTriesToGetLock = 0; - pthread_yield(); + sched_yield(); } //try to get the lock @@ -260,7 +264,7 @@ * system rand because it takes much too long. *Note, are passing pointers to the seeds, which are then modified */ -inline uint32_t +uint32_t VMS_int__randomNumber() { _VMSMasterEnv->seed1 = 36969 * (_VMSMasterEnv->seed1 & 65535) + @@ -274,7 +278,7 @@ /*Busy-waits for a random number of cycles -- chooses number of cycles * differently than for the no-work backoff */ -inline void +void VMS_int__backoff_for_TooLongToGetLock( int32 numTriesToGetLock ) { int32 i, waitIterations; volatile double fakeWorkVar; //busy-wait fake work diff -r 2bcf37fd50c6 -r f5b110414453 VMS__startup_and_shutdown.c --- a/VMS__startup_and_shutdown.c Mon Sep 10 01:26:51 2012 -0700 +++ b/VMS__startup_and_shutdown.c Tue Sep 25 16:11:15 2012 +0200 @@ -408,7 +408,7 @@ { _VMSMasterEnv->slaveAssigner = animAssigner; } -VMS_SS__register_semantic_env( void *semanticEnv ) +void VMS_SS__register_semantic_env( void *semanticEnv ) { _VMSMasterEnv->semanticEnv = semanticEnv; }