From eb4585bcc6eb2b1d2c8d5ba3de28336e7f3cb558 Mon Sep 17 00:00:00 2001 From: Ian Lepore Date: Thu, 25 Dec 2014 19:08:39 +0000 Subject: [PATCH] Add macros for asm barrier instructions with arch-specific implementations. --- sys/arm/include/asm.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/sys/arm/include/asm.h b/sys/arm/include/asm.h index 506e99a9a21..deaccec19ee 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 +#include #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_ */