Skip to content

Commit 012a59a

Browse files
committed
Mirror the same in bsd_zero.hpp
1 parent 9963407 commit 012a59a

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

src/hotspot/os_cpu/bsd_zero/orderAccess_bsd_zero.hpp

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828

2929
// Included in orderAccess.hpp header file.
3030

31-
#ifdef ARM
32-
3331
/*
3432
* ARM Kernel helper for memory barrier.
3533
* Using __asm __volatile ("":::"memory") does not work reliable on ARM
@@ -39,28 +37,32 @@
3937
typedef void (__kernel_dmb_t) (void);
4038
#define __kernel_dmb (*(__kernel_dmb_t *) 0xffff0fa0)
4139

42-
#define FULL_MEM_BARRIER __kernel_dmb()
4340
#define LIGHT_MEM_BARRIER __kernel_dmb()
41+
#define FULL_MEM_BARRIER __kernel_dmb()
4442

45-
#else // ARM
46-
47-
#define FULL_MEM_BARRIER __sync_synchronize()
48-
49-
#ifdef PPC
43+
#elif defined(PPC) // ----------------------------------------------------
5044

5145
#ifdef __NO_LWSYNC__
5246
#define LIGHT_MEM_BARRIER __asm __volatile ("sync":::"memory")
5347
#else
5448
#define LIGHT_MEM_BARRIER __asm __volatile ("lwsync":::"memory")
5549
#endif
5650

57-
#else // PPC
51+
#define FULL_MEM_BARRIER __sync_synchronize()
52+
53+
#elif defined(X86) // ----------------------------------------------------
5854

5955
#define LIGHT_MEM_BARRIER __asm __volatile ("":::"memory")
56+
#define FULL_MEM_BARRIER __sync_synchronize()
57+
58+
#else // ----------------------------------------------------
59+
60+
// Default to strongest barriers for correctness.
6061

61-
#endif // PPC
62+
#define LIGHT_MEM_BARRIER __sync_synchronize()
63+
#define FULL_MEM_BARRIER __sync_synchronize()
6264

63-
#endif // ARM
65+
#endif // ----------------------------------------------------
6466

6567
// Note: What is meant by LIGHT_MEM_BARRIER is a barrier which is sufficient
6668
// to provide TSO semantics, i.e. StoreStore | LoadLoad | LoadStore.

0 commit comments

Comments
 (0)