Mercurial > cgi-bin > hgwebdir.cgi > VMS > VMS_Implementations > VMS_impls > VMS__MC_shared_impl
diff VMS.h @ 25:c556193f7211
Linux Version -- first set of mods changing from win to linux
| author | Me |
|---|---|
| date | Sat, 24 Jul 2010 08:58:47 -0700 |
| parents | 2b161e1a50ee |
| children | 668278fa7a63 |
line diff
1.1 --- a/VMS.h Wed Jul 07 13:15:54 2010 -0700 1.2 +++ b/VMS.h Sat Jul 24 08:58:47 2010 -0700 1.3 @@ -8,11 +8,11 @@ 1.4 1.5 #ifndef _VMS_H 1.6 #define _VMS_H 1.7 +#define __USE_GNU 1.8 1.9 #include "VMS_primitive_data_types.h" 1.10 #include "Queue_impl/BlockingQueue.h" 1.11 -#include <windows.h> 1.12 -#include <winbase.h> 1.13 +#include "pthread.h" 1.14 1.15 //This value is the number of hardware threads in the shared memory 1.16 // machine 1.17 @@ -108,34 +108,36 @@ 1.18 int stillRunning; 1.19 1.20 VirtProcr *masterVirtPr; 1.21 + 1.22 void *semanticEnv; 1.23 void *OSEventStruc; //for future, when add I/O to BLIS 1.24 1.25 void *coreLoopShutDownPt; //addr to jump to to shut down a coreLoop 1.26 + 1.27 + int setupComplete; 1.28 + pthread_mutex_t suspend_mutex; 1.29 + pthread_cond_t suspend_cond; 1.30 } 1.31 MasterEnv; 1.32 1.33 1.34 //========================================================== 1.35 1.36 -DWORD WINAPI coreLoop( LPVOID paramsIn ); 1.37 -//void * coreLoop( void *paramsIn ); //standard PThreads fn prototype 1.38 +void * coreLoop( void *paramsIn ); //standard PThreads fn prototype 1.39 void masterLoop( void *initData, VirtProcr *masterPr ); 1.40 1.41 1.42 //===================== Global Vars =================== 1.43 1.44 1.45 -HANDLE coreLoopThdHandles[ NUM_CORES ]; //windows handle to thread 1.46 +pthread_t coreLoopThdHandles[ NUM_CORES ]; //pthread's virt-procr state 1.47 ThdParams *coreLoopThdParams[ NUM_CORES ]; 1.48 -DWORD coreLoopThdIds[ NUM_CORES ]; 1.49 1.50 - //TODO: Debug: figure out if need to be volatile or not 1.51 volatile MasterEnv *_VMSMasterEnv; 1.52 1.53 //workQ is global, static, and volatile so that core loop has its location 1.54 // hard coded, and reloads every time through the loop -- that way don't 1.55 - // need to save any regs used by core loop (will see if this really works) 1.56 + // need to save any regs used by core loop 1.57 volatile CASQueueStruc *_VMSWorkQ; 1.58 1.59 //========================== 1.60 @@ -195,6 +197,10 @@ 1.61 1.62 typedef unsigned long long TSCount; 1.63 1.64 + //Frequency of TS counts 1.65 + //TODO: change freq for each machine 1.66 +#define TSCOUNT_FREQ 3180000000 1.67 + 1.68 #define saveTimeStampCountInto(low, high) \ 1.69 asm volatile("RDTSC; \ 1.70 movl %%eax, %0; \
