# HG changeset patch # User Merten Sach # Date 1329158132 -3600 # Node ID 0320b49ca013ad5910fc79a994e2a90b3468d54a # Parent a8312581709c60046ecd20e78afbab41b9ca6756 New include paths because of new project structure diff -r a8312581709c -r 0320b49ca013 CoreLoop.c --- a/CoreLoop.c Fri Feb 03 19:04:12 2012 +0100 +++ b/CoreLoop.c Mon Feb 13 19:35:32 2012 +0100 @@ -6,7 +6,7 @@ #include "VMS.h" -#include "Queue_impl/BlockingQueue.h" +#include "C_Libraries/Queue_impl/BlockingQueue.h" #include "ProcrContext.h" #include diff -r a8312581709c -r 0320b49ca013 VMS.c --- a/VMS.c Fri Feb 03 19:04:12 2012 +0100 +++ b/VMS.c Mon Feb 13 19:35:32 2012 +0100 @@ -13,8 +13,8 @@ #include "VMS.h" #include "ProcrContext.h" -#include "Queue_impl/BlockingQueue.h" -#include "Histogram/Histogram.h" +#include "C_Libraries/Queue_impl/BlockingQueue.h" +#include "C_Libraries/Histogram/Histogram.h" #define thdAttrs NULL @@ -105,7 +105,7 @@ //Very first thing put into the master env is the free-list, seeded // with a massive initial chunk of memory. - //After this, all other mallocs are VMS__malloc. + //After this, all other mallocs are VMS_int__malloc. _VMSMasterEnv->freeLists = VMS_ext__create_free_list(); @@ -124,15 +124,15 @@ #endif //======================================================================== - //===================== Only VMS__malloc after this ==================== + //===================== Only VMS_int__malloc after this ==================== masterEnv = (MasterEnv*)_VMSMasterEnv; //Make a readyToAnimateQ for each core loop - readyToAnimateQs = VMS__malloc( NUM_CORES * sizeof(VMSQueueStruc *) ); - masterVPs = VMS__malloc( NUM_CORES * sizeof(VirtProcr *) ); + readyToAnimateQs = VMS_int__malloc( NUM_CORES * sizeof(VMSQueueStruc *) ); + masterVPs = VMS_int__malloc( NUM_CORES * sizeof(VirtProcr *) ); //One array for each core, 3 in array, core's masterVP scheds all - allSchedSlots = VMS__malloc( NUM_CORES * sizeof(SchedSlot *) ); + allSchedSlots = VMS_int__malloc( NUM_CORES * sizeof(SchedSlot *) ); _VMSMasterEnv->numProcrsCreated = 0; //used by create procr for( coreIdx = 0; coreIdx < NUM_CORES; coreIdx++ ) @@ -162,7 +162,7 @@ _VMSMasterEnv->dynIntervalProbesInfo = makePrivDynArrayOfSize( (void***)&(_VMSMasterEnv->intervalProbes), 200); - _VMSMasterEnv->probeNameHashTbl = makeHashTable( 1000, &VMS__free ); + _VMSMasterEnv->probeNameHashTbl = makeHashTable( 1000, &VMS_int__free ); //put creation time directly into master env, for fast retrieval struct timeval timeStamp; @@ -187,12 +187,12 @@ { SchedSlot **schedSlots; int i; - //schedSlots = VMS__malloc( NUM_SCHED_SLOTS * sizeof(SchedSlot *) ); + //schedSlots = VMS_int__malloc( NUM_SCHED_SLOTS * sizeof(SchedSlot *) ); posix_memalign(&schedSlots, CACHELINE_SIZE, NUM_SCHED_SLOTS * sizeof(SchedSlot *)); for( i = 0; i < NUM_SCHED_SLOTS; i++ ) { - //schedSlots[i] = VMS__malloc( sizeof(SchedSlot) ); + //schedSlots[i] = VMS_int__malloc( sizeof(SchedSlot) ); posix_memalign(&schedSlots[i], CACHELINE_SIZE, CACHELINE_SIZE ); //Set state to mean "handling requests done, slot needs filling" @@ -208,9 +208,9 @@ { int i; for( i = 0; i < NUM_SCHED_SLOTS; i++ ) { - VMS__free( schedSlots[i] ); + VMS_int__free( schedSlots[i] ); } - VMS__free( schedSlots ); + VMS_int__free( schedSlots ); } @@ -228,7 +228,7 @@ //Make the threads that animate the core loops for( coreIdx=0; coreIdx < NUM_CORES; coreIdx++ ) - { coreLoopThdParams[coreIdx] = VMS__malloc( sizeof(ThdParams) ); + { coreLoopThdParams[coreIdx] = VMS_int__malloc( sizeof(ThdParams) ); coreLoopThdParams[coreIdx]->coreNum = coreIdx; retCode = @@ -293,7 +293,7 @@ posix_memalign((void*)&newPr, CACHELINE_SIZE, sizeof(VirtProcr) ); //align to cacheline posix_memalign(&stackLocs, CACHELINE_SIZE, VIRT_PROCR_STACK_SIZE ); //align to cacheline if( stackLocs == 0 ) - { perror("VMS__malloc stack"); exit(1); } + { perror("VMS_int__malloc stack"); exit(1); } return create_procr_helper( newPr, fnPtr, initialData, stackLocs ); } @@ -437,7 +437,7 @@ VMS_ext__dissipate_procr( VirtProcr *procrToDissipate ) { //NOTE: initialData was given to the processor, so should either have - // been alloc'd with VMS__malloc, or freed by the level above animPr. + // been alloc'd with VMS_int__malloc, or freed by the level above animPr. //So, all that's left to free here is the stack and the VirtProcr struc // itself //Note, should not stack-allocate initial data -- no guarantee, in @@ -456,14 +456,14 @@ * be malloc'd if this is called inside the same call chain before the * send of the last request is called. * - *The request handler has to call VMS__free_VMSReq for any of these + *The request handler has to call VMS_int__free_VMSReq for any of these */ inline void VMS__add_sem_request_in_mallocd_VMSReqst( void *semReqData, VirtProcr *callingPr ) { VMSReqst *req; - req = VMS__malloc( sizeof(VMSReqst) ); + req = VMS_int__malloc( sizeof(VMSReqst) ); req->reqType = semantic; req->semReqData = semReqData; req->nextReqst = callingPr->requests; @@ -545,8 +545,8 @@ semReq = req->semReqData; - newProbe = VMS__malloc( sizeof(IntervalProbe) ); - newProbe->nameStr = VMS__strDup( semReq->nameStr ); + newProbe = VMS_int__malloc( sizeof(IntervalProbe) ); + newProbe->nameStr = VMS_int__strDup( semReq->nameStr ); newProbe->hist = NULL; newProbe->schedChoiceWasRecorded = FALSE; @@ -574,7 +574,7 @@ * VMS_malloc mechanism. Then it calls this, which first asks the malloc * system to disown any state that did use VMS_malloc, and then frees the * statck and the processor-struct itself. - *If the dissipated processor is the sole (remaining) owner of VMS__malloc'd + *If the dissipated processor is the sole (remaining) owner of VMS_int__malloc'd * state, then that state gets freed (or sent to recycling) as a side-effect * of dis-owning it. */ @@ -583,11 +583,11 @@ { //dis-own all locations owned by this processor, causing to be freed // any locations that it is (was) sole owner of -//TODO: implement VMS__malloc system, including "give up ownership" +//TODO: implement VMS_int__malloc system, including "give up ownership" //NOTE: initialData was given to the processor, so should either have - // been alloc'd with VMS__malloc, or freed by the level above animPr. + // been alloc'd with VMS_int__malloc, or freed by the level above animPr. //So, all that's left to free here is the stack and the VirtProcr struc // itself //Note, should not stack-allocate initial data -- no guarantee, in @@ -617,7 +617,7 @@ * masterVP any AppVPs that might still be allocated and sitting in the * semantic environment, or have been orphaned in the _VMSWorkQ. * - *NOTE: the semantic plug-in is expected to use VMS__malloc to get all the + *NOTE: the semantic plug-in is expected to use VMS_int__malloc to get all the * locations it needs, and give ownership to masterVP. Then, they will be * automatically freed. * @@ -729,7 +729,7 @@ } #endif - //All the environment data has been allocated with VMS__malloc, so just + //All the environment data has been allocated with VMS_int__malloc, so just // free its internal big-chunk and all inside it disappear. /* readyToAnimateQs = _VMSMasterEnv->readyToAnimateQs; @@ -745,13 +745,13 @@ freeSchedSlots( allSchedSlots[ coreIdx ] ); } - VMS__free( _VMSMasterEnv->readyToAnimateQs ); - VMS__free( _VMSMasterEnv->masterVPs ); - VMS__free( _VMSMasterEnv->allSchedSlots ); + VMS_int__free( _VMSMasterEnv->readyToAnimateQs ); + VMS_int__free( _VMSMasterEnv->masterVPs ); + VMS_int__free( _VMSMasterEnv->allSchedSlots ); //============================= MEASUREMENT STUFF ======================== #ifdef STATS__TURN_ON_PROBES - freeDynArrayDeep( _VMSMasterEnv->dynIntervalProbesInfo, &VMS__free_probe); + freeDynArrayDeep( _VMSMasterEnv->dynIntervalProbesInfo, &VMS_int__free_probe); #endif //======================================================================== */ diff -r a8312581709c -r 0320b49ca013 VMS.h --- a/VMS.h Fri Feb 03 19:04:12 2012 +0100 +++ b/VMS.h Mon Feb 13 19:35:32 2012 +0100 @@ -11,10 +11,10 @@ #define _GNU_SOURCE #include "VMS_primitive_data_types.h" -#include "Queue_impl/PrivateQueue.h" -#include "Histogram/Histogram.h" -#include "DynArray/DynArray.h" -#include "Hash_impl/PrivateHash.h" +#include "C_Libraries/Queue_impl/PrivateQueue.h" +#include "C_Libraries/Histogram/Histogram.h" +#include "C_Libraries/DynArray/DynArray.h" +#include "C_Libraries/Hash_impl/PrivateHash.h" #include "vmalloc.h" #include @@ -331,6 +331,6 @@ #include "ProcrContext.h" #include "probes.h" #include "vutilities.h" -#include "../VMS_lang_specific_defines.h" +#include "VMS_Implementations/Vthread_impl/VMS_lang_specific_defines.h" #endif /* _VMS_H */ diff -r a8312581709c -r 0320b49ca013 VMS_defs.h --- a/VMS_defs.h Fri Feb 03 19:04:12 2012 +0100 +++ b/VMS_defs.h Mon Feb 13 19:35:32 2012 +0100 @@ -90,7 +90,7 @@ // stack size in virtual processors created #define VIRT_PROCR_STACK_SIZE 0x8000 /* 32K */ - // memory for VMS__malloc + // memory for VMS_int__malloc #define MALLOC_ADDITIONAL_MEM_FROM_OS_SIZE 0x40000000 /* 1G */ #define CACHE_LINE 64 @@ -103,7 +103,7 @@ #define writeVMSQ writePrivQ #define readVMSQ readPrivQ -#define makeVMSQ makeVMSPrivQ +#define makeVMSQ makePrivQ #define numInVMSQ numInPrivQ #define VMSQueueStruc PrivQueueStruc diff -r a8312581709c -r 0320b49ca013 probes.c --- a/probes.c Fri Feb 03 19:04:12 2012 +0100 +++ b/probes.c Mon Feb 13 19:35:32 2012 +0100 @@ -9,8 +9,8 @@ #include #include "VMS.h" -#include "Queue_impl/BlockingQueue.h" -#include "Histogram/Histogram.h" +#include "C_Libraries/Queue_impl/BlockingQueue.h" +#include "C_Libraries/Histogram/Histogram.h" //================================ STATS ==================================== @@ -146,8 +146,8 @@ void VMS_impl__free_probe( IntervalProbe *probe ) { if( probe->hist != NULL ) freeDblHist( probe->hist ); - if( probe->nameStr != NULL) VMS__free( probe->nameStr ); - VMS__free( probe ); + if( probe->nameStr != NULL) VMS_int__free( probe->nameStr ); + VMS_int__free( probe ); } diff -r a8312581709c -r 0320b49ca013 probes.h --- a/probes.h Fri Feb 03 19:04:12 2012 +0100 +++ b/probes.h Mon Feb 13 19:35:32 2012 +0100 @@ -89,7 +89,7 @@ binWidth, nameStr, animPr ) void VMS_impl__free_probe( IntervalProbe *probe ); -#define VMS__free_probe( probe ) \ +#define VMS_int__free_probe( probe ) \ VMS_impl__free_probe( probe ) void diff -r a8312581709c -r 0320b49ca013 vmalloc.c --- a/vmalloc.c Fri Feb 03 19:04:12 2012 +0100 +++ b/vmalloc.c Mon Feb 13 19:35:32 2012 +0100 @@ -15,7 +15,7 @@ #include #include "VMS.h" -#include "Histogram/Histogram.h" +#include "C_Libraries/Histogram/Histogram.h" #define MAX_UINT64 0xFFFFFFFFFFFFFFFF @@ -205,7 +205,7 @@ * This is sequential code, meant to only be called from the Master, not from * any slave VPs. */ -void *VMS__malloc( size_t sizeRequested ) +void *VMS_int__malloc( size_t sizeRequested ) { //============================= MEASUREMENT STUFF ======================== #ifdef MEAS__TIME_MALLOC @@ -261,7 +261,7 @@ * any slave VPs. */ void -VMS__free( void *ptrToFree ) +VMS_int__free( void *ptrToFree ) { //============================= MEASUREMENT STUFF ======================== diff -r a8312581709c -r 0320b49ca013 vmalloc.h --- a/vmalloc.h Fri Feb 03 19:04:12 2012 +0100 +++ b/vmalloc.h Mon Feb 13 19:35:32 2012 +0100 @@ -52,24 +52,29 @@ } FreeListHead; -void * -VMS__malloc( size_t sizeRequested ); +//comply with interface of HW__generic_x86_64_MC branch +#define VMS_WL__malloc VMS_int__malloc +#define VMS_WL__malloc_aligned VMS_int__malloc_aligned +#define VMS_WL__free VMS_int__free void * -VMS__malloc_aligned( size_t sizeRequested ); +VMS_int__malloc( size_t sizeRequested ); + +void * +VMS_int__malloc_aligned( size_t sizeRequested ); void -VMS__free( void *ptrToFree ); +VMS_int__free( void *ptrToFree ); /*Allocates memory from the external system -- higher overhead */ void * -VMS__malloc_in_ext( size_t sizeRequested ); +VMS_int__malloc_in_ext( size_t sizeRequested ); /*Frees memory that was allocated in the external system -- higher overhead */ void -VMS__free_in_ext( void *ptrToFree ); +VMS_int__free_in_ext( void *ptrToFree ); MallocArrays * diff -r a8312581709c -r 0320b49ca013 vutilities.c --- a/vutilities.c Fri Feb 03 19:04:12 2012 +0100 +++ b/vutilities.c Mon Feb 13 19:35:32 2012 +0100 @@ -14,10 +14,10 @@ inline char * -VMS__strDup( char *str ) +VMS_int__strDup( char *str ) { char *retStr; - retStr = VMS__malloc( strlen(str) + 1 ); + retStr = VMS_int__malloc( strlen(str) + 1 ); if( str == NULL ) return str; strcpy( retStr, str ); diff -r a8312581709c -r 0320b49ca013 vutilities.h --- a/vutilities.h Fri Feb 03 19:04:12 2012 +0100 +++ b/vutilities.h Mon Feb 13 19:35:32 2012 +0100 @@ -15,6 +15,6 @@ #include "VMS_primitive_data_types.h" inline char * -VMS__strDup( char *str ); +VMS_int__strDup( char *str ); #endif