Albert ARIBAUD | a382322 | 2015-10-23 18:06:40 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Thumb-1 drop-in for the linux/include/asm-arm/proc-armv/system.h |
| 3 | * |
| 4 | * (C) Copyright 2015 |
| 5 | * Albert ARIBAUD <albert.u.boot@aribaud.net> |
| 6 | * |
| 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. |
| 10 | * |
| 11 | * SPDX-License-Identifier: GPL-2.0+ |
| 12 | */ |
| 13 | |
| 14 | /* |
| 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. |
| 18 | */ |
| 19 | |
| 20 | #ifndef __ASM_PROC_SYSTEM_H |
| 21 | #define __ASM_PROC_SYSTEM_H |
| 22 | |
| 23 | /* |
| 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. |
| 29 | */ |
| 30 | |
| 31 | static inline void local_irq_save( |
| 32 | unsigned long flags __attribute__((unused))) |
| 33 | { |
| 34 | __asm__ __volatile__ ("" : : : "memory"); |
| 35 | } |
| 36 | |
| 37 | static inline void local_irq_enable(void) |
| 38 | { |
| 39 | __asm__ __volatile__ ("" : : : "memory"); |
| 40 | } |
| 41 | |
| 42 | static inline void local_irq_disable(void) |
| 43 | { |
| 44 | __asm__ __volatile__ ("" : : : "memory"); |
| 45 | } |
| 46 | |
| 47 | static inline void __stf(void) |
| 48 | { |
| 49 | __asm__ __volatile__ ("" : : : "memory"); |
| 50 | } |
| 51 | |
| 52 | static inline void __clf(void) |
| 53 | { |
| 54 | __asm__ __volatile__ ("" : : : "memory"); |
| 55 | } |
| 56 | |
| 57 | static inline void local_save_flags( |
| 58 | unsigned long flags __attribute__((unused))) |
| 59 | { |
| 60 | __asm__ __volatile__ ("" : : : "memory"); |
| 61 | } |
| 62 | |
| 63 | static inline void local_irq_restore( |
| 64 | unsigned long flags __attribute__((unused))) |
| 65 | { |
| 66 | __asm__ __volatile__ ("" : : : "memory"); |
| 67 | } |
| 68 | |
| 69 | #endif /* __ASM_PROC_SYSTEM_H */ |