summaryrefslogtreecommitdiffstats
path: root/sys/arm
diff options
context:
space:
mode:
authorian <ian@FreeBSD.org>2014-12-25 19:08:39 +0000
committerian <ian@FreeBSD.org>2014-12-25 19:08:39 +0000
commitbb5aaad6a927a582b305ddd1b93525a48f577229 (patch)
treefb47b91af9f465c3d45f9b9b6de1deb4f81c026d /sys/arm
parentac5b1bdf7176022aa8b487a5c378684521c29db6 (diff)
downloadFreeBSD-src-bb5aaad6a927a582b305ddd1b93525a48f577229.zip
FreeBSD-src-bb5aaad6a927a582b305ddd1b93525a48f577229.tar.gz
Add macros for asm barrier instructions with arch-specific implementations.
Diffstat (limited to 'sys/arm')
-rw-r--r--sys/arm/include/asm.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/sys/arm/include/asm.h b/sys/arm/include/asm.h
index 506e99a..deaccec 100644
--- a/sys/arm/include/asm.h
+++ b/sys/arm/include/asm.h
@@ -39,6 +39,7 @@
#ifndef _MACHINE_ASM_H_
#define _MACHINE_ASM_H_
#include <sys/cdefs.h>
+#include <machine/sysreg.h>
#define _C_LABEL(x) x
#define _ASM_LABEL(x) x
@@ -221,4 +222,18 @@
# define RETc(c) mov##c pc, lr
#endif
+#if __ARM_ARCH >= 7
+#define ISB isb
+#define DSB dsb
+#define DMB dmb
+#elif __ARM_ARCH == 6
+#define ISB mcr CP15_CP15ISB
+#define DSB mcr CP15_CP15DSB
+#define DMB mcr CP15_CP15DMB
+#else
+#define ISB mcr CP15_CP15ISB
+#define DSB mcr CP15_CP15DSB /* DSB and DMB are the */
+#define DMB mcr CP15_CP15DSB /* same prior to v6.*/
+#endif
+
#endif /* !_MACHINE_ASM_H_ */
OpenPOWER on IntegriCloud