summaryrefslogtreecommitdiffstats
path: root/arch/arm/thumb1/include/asm/proc-armv
diff options
context:
space:
mode:
authorStefano Babic <sbabic@denx.de>2015-11-12 17:13:26 +0100
committerStefano Babic <sbabic@denx.de>2015-11-12 17:13:26 +0100
commit5f5620ab2679608f94b3a77e51c77d0a770103bd (patch)
treeec983c06d2f62384909968bb870add121b8a1502 /arch/arm/thumb1/include/asm/proc-armv
parent78e9ca52edaab74ad645d719676ff4c24d2f462c (diff)
parent038be18fd95aa6283eafb85ceabc0b880976424b (diff)
downloadtalos-obmc-uboot-5f5620ab2679608f94b3a77e51c77d0a770103bd.tar.gz
talos-obmc-uboot-5f5620ab2679608f94b3a77e51c77d0a770103bd.zip
Merge git://git.denx.de/u-boot
Diffstat (limited to 'arch/arm/thumb1/include/asm/proc-armv')
-rw-r--r--arch/arm/thumb1/include/asm/proc-armv/system.h69
1 files changed, 69 insertions, 0 deletions
diff --git a/arch/arm/thumb1/include/asm/proc-armv/system.h b/arch/arm/thumb1/include/asm/proc-armv/system.h
new file mode 100644
index 0000000000..7dfbf3d33d
--- /dev/null
+++ b/arch/arm/thumb1/include/asm/proc-armv/system.h
@@ -0,0 +1,69 @@
+/*
+ * Thumb-1 drop-in for the linux/include/asm-arm/proc-armv/system.h
+ *
+ * (C) Copyright 2015
+ * Albert ARIBAUD <albert.u.boot@aribaud.net>
+ *
+ * The original file does not build in Thumb mode. However, in U-Boot
+ * we don't use interrupt context, so we can redefine these as empty
+ * memory barriers, which makes Thumb-1 compiler happy.
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+/*
+ * Use the same macro name as linux/include/asm-arm/proc-armv/system.h
+ * here, so that if the original ever gets included after us, it won't
+ * try to re-redefine anything.
+ */
+
+#ifndef __ASM_PROC_SYSTEM_H
+#define __ASM_PROC_SYSTEM_H
+
+/*
+ * Redefine all original macros with static inline functions containing
+ * a simple memory barrier, so that they produce the same instruction
+ * ordering constraints as their original counterparts.
+ * We use static inline functions rather than macros so that we can tell
+ * the compiler to not complain about unused arguments.
+ */
+
+static inline void local_irq_save(
+ unsigned long flags __attribute__((unused)))
+{
+ __asm__ __volatile__ ("" : : : "memory");
+}
+
+static inline void local_irq_enable(void)
+{
+ __asm__ __volatile__ ("" : : : "memory");
+}
+
+static inline void local_irq_disable(void)
+{
+ __asm__ __volatile__ ("" : : : "memory");
+}
+
+static inline void __stf(void)
+{
+ __asm__ __volatile__ ("" : : : "memory");
+}
+
+static inline void __clf(void)
+{
+ __asm__ __volatile__ ("" : : : "memory");
+}
+
+static inline void local_save_flags(
+ unsigned long flags __attribute__((unused)))
+{
+ __asm__ __volatile__ ("" : : : "memory");
+}
+
+static inline void local_irq_restore(
+ unsigned long flags __attribute__((unused)))
+{
+ __asm__ __volatile__ ("" : : : "memory");
+}
+
+#endif /* __ASM_PROC_SYSTEM_H */
OpenPOWER on IntegriCloud