diff options
author | attilio <attilio@FreeBSD.org> | 2012-10-09 14:32:30 +0000 |
---|---|---|
committer | attilio <attilio@FreeBSD.org> | 2012-10-09 14:32:30 +0000 |
commit | 6997194551ffae05d71ea650af49c4551d753a1a (patch) | |
tree | 18e9f31a3018a88b46e78d76a45d0953dea5276b /sys/gnu | |
parent | 6a02d06d1d81ffda0499310925ef854fd237f382 (diff) | |
download | FreeBSD-src-6997194551ffae05d71ea650af49c4551d753a1a.zip FreeBSD-src-6997194551ffae05d71ea650af49c4551d753a1a.tar.gz |
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
Diffstat (limited to 'sys/gnu')
-rw-r--r-- | sys/gnu/fs/xfs/FreeBSD/xfs_compat.h | 4 | ||||
-rw-r--r-- | sys/gnu/fs/xfs/FreeBSD/xfs_freebsd.h | 2 |
2 files changed, 1 insertions, 5 deletions
diff --git a/sys/gnu/fs/xfs/FreeBSD/xfs_compat.h b/sys/gnu/fs/xfs/FreeBSD/xfs_compat.h index 7229f27..55a03c9 100644 --- a/sys/gnu/fs/xfs/FreeBSD/xfs_compat.h +++ b/sys/gnu/fs/xfs/FreeBSD/xfs_compat.h @@ -129,10 +129,6 @@ typedef dev_t os_dev_t; #define copy_from_user(dst, src, len) copyin((src), (dst), (len)) #endif -#ifndef barrier -#define barrier() __asm__ __volatile__("": : :"memory") -#endif - /* * Map simple global vairables to FreeBSD kernel equivalents */ diff --git a/sys/gnu/fs/xfs/FreeBSD/xfs_freebsd.h b/sys/gnu/fs/xfs/FreeBSD/xfs_freebsd.h index a47c413..cc1d8df 100644 --- a/sys/gnu/fs/xfs/FreeBSD/xfs_freebsd.h +++ b/sys/gnu/fs/xfs/FreeBSD/xfs_freebsd.h @@ -162,7 +162,7 @@ */ #define EFSCORRUPTED 990 /* Filesystem is corrupted */ -#define SYNCHRONIZE() barrier() +#define SYNCHRONIZE() __compiler_membar() #define __return_address __builtin_return_address(0) /* |