diff options
Diffstat (limited to 'vdso/barrier.h')
-rw-r--r-- | vdso/barrier.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/vdso/barrier.h b/vdso/barrier.h index 7866af414..5b6c763f6 100644 --- a/vdso/barrier.h +++ b/vdso/barrier.h @@ -21,11 +21,25 @@ namespace vdso { inline void barrier(void) { __asm__ __volatile__("" ::: "memory"); } #if __x86_64__ + inline void memory_barrier(void) { __asm__ __volatile__("mfence" ::: "memory"); } inline void read_barrier(void) { barrier(); } inline void write_barrier(void) { barrier(); } + +#elif __aarch64__ + +inline void memory_barrier(void) { + __asm__ __volatile__("dmb ish" ::: "memory"); +} +inline void read_barrier(void) { + __asm__ __volatile__("dmb ishld" ::: "memory"); +} +inline void write_barrier(void) { + __asm__ __volatile__("dmb ishst" ::: "memory"); +} + #else #error "unsupported architecture" #endif |