From 415127f697d0c815d03c84236397705ac16ec7d8 Mon Sep 17 00:00:00 2001 From: sezero Date: Sun, 19 Aug 2018 16:36:33 +0300 Subject: [PATCH] glide2x, h3, linhwc.c: update P6FENCE macros from glide3 --- glide2x/h3/minihwc/linhwc.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/glide2x/h3/minihwc/linhwc.c b/glide2x/h3/minihwc/linhwc.c index b6edac1..a637f14 100644 --- a/glide2x/h3/minihwc/linhwc.c +++ b/glide2x/h3/minihwc/linhwc.c @@ -72,7 +72,15 @@ hwcCheckMemSize(hwcBoardInfo *bInfo, FxU32 xres, FxU32 yres, FxU32 nColBuffers, #endif static FxU32 __attribute_used fenceVar; -#define P6FENCE asm("xchg %%eax, %0" : : "m" (fenceVar) : "eax"); +#if defined(__GNUC__) && defined(__ia64__) +# define P6FENCE asm volatile ("mf.a" ::: "memory"); +#elif defined(__GNUC__) && defined(__alpha__) +# define P6FENCE asm volatile("mb" ::: "memory"); +#elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) +# define P6FENCE asm("xchg %%eax, %0" : : "m" (fenceVar) : "eax"); +#else +# error "No P6FENCE asm for this architecture" +#endif #define MAXFIFOSIZE 0x40000 #define FIFOPAD 0x0000