h3, minihwc.c: fix p6Fence for MinGW.

This commit is contained in:
sezero
2018-08-11 01:21:10 +03:00
parent 3b522046d6
commit 2a711e29fe
2 changed files with 13 additions and 19 deletions

View File

@@ -590,10 +590,9 @@ static FxU32 __attribute_used fenceVar;
/*static FxU32 ProcessID;*/
#if defined(__WATCOMC__)
/*
* P6 Fence
*
*
* Here's the stuff to do P6 Fencing. This is required for the
* certain things on the P6
*
@@ -601,20 +600,18 @@ static FxU32 __attribute_used fenceVar;
* This was yoinked from sst1/include/sst1init.h, and should be
* merged back into something if we decide that we need it later.
*/
void
p6Fence(void);
#if defined(__WATCOMC__)
void p6Fence(void);
#pragma aux p6Fence = \
"xchg eax, fenceVar" \
modify [eax];
"xchg eax, fenceVar" \
modify [eax];
#define P6FENCE p6Fence()
#elif defined(__MSC__)
#define P6FENCE { __asm xchg eax, fenceVar }
#define P6FENCE {_asm xchg eax, fenceVar}
#elif defined(__POWERPC__) && defined(__MWERKS__)
#define P6FENCE __eieio()
#elif defined(__DJGPP__)
#define P6FENCE __asm __volatile ("xchg %%eax, _fenceVar":::"%eax");
#elif defined(__DJGPP__) || defined (__MINGW32__)
#define P6FENCE __asm __volatile ("xchg %%eax, _fenceVar":::"%eax")
#elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
#define P6FENCE __asm __volatile ("xchg %%eax, fenceVar":::"%eax")
#elif defined(__GNUC__) && defined(__ia64__)

View File

@@ -1022,10 +1022,9 @@ static void hwc_errncpy(char *dst,const char *src)
}
#endif
#if defined(__WATCOMC__)
/*
* P6 Fence
*
*
* Here's the stuff to do P6 Fencing. This is required for the
* certain things on the P6
*
@@ -1033,13 +1032,11 @@ static void hwc_errncpy(char *dst,const char *src)
* This was yoinked from sst1/include/sst1init.h, and should be
* merged back into something if we decide that we need it later.
*/
void
p6Fence(void);
#if defined(__WATCOMC__)
void p6Fence(void);
#pragma aux p6Fence = \
"xchg eax, fenceVar" \
modify [eax];
"xchg eax, fenceVar" \
modify [eax];
#define P6FENCE p6Fence()
#elif defined(__MSC__)
#define P6FENCE {_asm xchg eax, fenceVar}