2 * Thumb-1 drop-in for the linux/include/asm-arm/proc-armv/system.h
5 * Albert ARIBAUD <albert.u.boot@aribaud.net>
7 * The original file does not build in Thumb mode. However, in U-Boot
8 * we don't use interrupt context, so we can redefine these as empty
9 * memory barriers, which makes Thumb-1 compiler happy.
11 * SPDX-License-Identifier: GPL-2.0+
15 * Use the same macro name as linux/include/asm-arm/proc-armv/system.h
16 * here, so that if the original ever gets included after us, it won't
17 * try to re-redefine anything.
20 #ifndef __ASM_PROC_SYSTEM_H
21 #define __ASM_PROC_SYSTEM_H
24 * Redefine all original macros with static inline functions containing
25 * a simple memory barrier, so that they produce the same instruction
26 * ordering constraints as their original counterparts.
27 * We use static inline functions rather than macros so that we can tell
28 * the compiler to not complain about unused arguments.
31 static inline void local_irq_save(
32 unsigned long flags __attribute__((unused)))
34 __asm__ __volatile__ ("" : : : "memory");
37 static inline void local_irq_enable(void)
39 __asm__ __volatile__ ("" : : : "memory");
42 static inline void local_irq_disable(void)
44 __asm__ __volatile__ ("" : : : "memory");
47 static inline void __stf(void)
49 __asm__ __volatile__ ("" : : : "memory");
52 static inline void __clf(void)
54 __asm__ __volatile__ ("" : : : "memory");
57 static inline void local_save_flags(
58 unsigned long flags __attribute__((unused)))
60 __asm__ __volatile__ ("" : : : "memory");
63 static inline void local_irq_restore(
64 unsigned long flags __attribute__((unused)))
66 __asm__ __volatile__ ("" : : : "memory");
69 #endif /* __ASM_PROC_SYSTEM_H */