diff options
author | Attilio Rao <attilio@FreeBSD.org> | 2012-10-09 14:32:30 +0000 |
---|---|---|
committer | Attilio Rao <attilio@FreeBSD.org> | 2012-10-09 14:32:30 +0000 |
commit | 3a4730256a96ac1a229a7fe1f6171f669fb1d000 (patch) | |
tree | 18e9f31a3018a88b46e78d76a45d0953dea5276b /sys/x86 | |
parent | 6a762eb23ea5f31e65cfa12602937f39a14e9b0c (diff) | |
download | src-3a4730256a96ac1a229a7fe1f6171f669fb1d000.tar.gz src-3a4730256a96ac1a229a7fe1f6171f669fb1d000.zip |
Add an unified macro to deny ability from the compiler to reorder
instruction loads/stores at its will.
The macro __compiler_membar() is currently supported for both gcc and
clang, but kernel compilation will fail otherwise.
Reviewed by: bde, kib
Discussed with: dim, theraven
MFC after: 2 weeks
Notes
Notes:
svn path=/head/; revision=241374
Diffstat (limited to 'sys/x86')
-rw-r--r-- | sys/x86/include/bus.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/x86/include/bus.h b/sys/x86/include/bus.h index 3b4342a40345..fb5babf43268 100644 --- a/sys/x86/include/bus.h +++ b/sys/x86/include/bus.h @@ -1014,7 +1014,7 @@ bus_space_barrier(bus_space_tag_t tag __unused, bus_space_handle_t bsh __unused, __asm __volatile("lock; addl $0,0(%%esp)" : : : "memory"); #endif else - __asm __volatile("" : : : "memory"); + __compiler_membar(); #endif } |