diff options
| -rw-r--r-- | arch/um/include/asm/irqflags.h | 38 | ||||
| -rw-r--r-- | arch/um/include/asm/system-um.h | 45 | ||||
| -rw-r--r-- | arch/x86/um/asm/system.h | 4 |
3 files changed, 40 insertions, 47 deletions
diff --git a/arch/um/include/asm/irqflags.h b/arch/um/include/asm/irqflags.h index 659b9abdfdba..c780d8a16773 100644 --- a/arch/um/include/asm/irqflags.h +++ b/arch/um/include/asm/irqflags.h | |||
| @@ -1,6 +1,42 @@ | |||
| 1 | #ifndef __UM_IRQFLAGS_H | 1 | #ifndef __UM_IRQFLAGS_H |
| 2 | #define __UM_IRQFLAGS_H | 2 | #define __UM_IRQFLAGS_H |
| 3 | 3 | ||
| 4 | /* Empty for now */ | 4 | extern int get_signals(void); |
| 5 | extern int set_signals(int enable); | ||
| 6 | extern void block_signals(void); | ||
| 7 | extern void unblock_signals(void); | ||
| 8 | |||
| 9 | static inline unsigned long arch_local_save_flags(void) | ||
| 10 | { | ||
| 11 | return get_signals(); | ||
| 12 | } | ||
| 13 | |||
| 14 | static inline void arch_local_irq_restore(unsigned long flags) | ||
| 15 | { | ||
| 16 | set_signals(flags); | ||
| 17 | } | ||
| 18 | |||
| 19 | static inline void arch_local_irq_enable(void) | ||
| 20 | { | ||
| 21 | unblock_signals(); | ||
| 22 | } | ||
| 23 | |||
| 24 | static inline void arch_local_irq_disable(void) | ||
| 25 | { | ||
| 26 | block_signals(); | ||
| 27 | } | ||
| 28 | |||
| 29 | static inline unsigned long arch_local_irq_save(void) | ||
| 30 | { | ||
| 31 | unsigned long flags; | ||
| 32 | flags = arch_local_save_flags(); | ||
| 33 | arch_local_irq_disable(); | ||
| 34 | return flags; | ||
| 35 | } | ||
| 36 | |||
| 37 | static inline bool arch_irqs_disabled(void) | ||
| 38 | { | ||
| 39 | return arch_local_save_flags() == 0; | ||
| 40 | } | ||
| 5 | 41 | ||
| 6 | #endif | 42 | #endif |
diff --git a/arch/um/include/asm/system-um.h b/arch/um/include/asm/system-um.h deleted file mode 100644 index 0eec24579288..000000000000 --- a/arch/um/include/asm/system-um.h +++ /dev/null | |||
| @@ -1,45 +0,0 @@ | |||
| 1 | #ifndef __UM_SYSTEM_GENERIC_H | ||
| 2 | #define __UM_SYSTEM_GENERIC_H | ||
| 3 | |||
| 4 | extern int get_signals(void); | ||
| 5 | extern int set_signals(int enable); | ||
| 6 | extern void block_signals(void); | ||
| 7 | extern void unblock_signals(void); | ||
| 8 | |||
| 9 | static inline unsigned long arch_local_save_flags(void) | ||
| 10 | { | ||
| 11 | return get_signals(); | ||
| 12 | } | ||
| 13 | |||
| 14 | static inline void arch_local_irq_restore(unsigned long flags) | ||
| 15 | { | ||
| 16 | set_signals(flags); | ||
| 17 | } | ||
| 18 | |||
| 19 | static inline void arch_local_irq_enable(void) | ||
| 20 | { | ||
| 21 | unblock_signals(); | ||
| 22 | } | ||
| 23 | |||
| 24 | static inline void arch_local_irq_disable(void) | ||
| 25 | { | ||
| 26 | block_signals(); | ||
| 27 | } | ||
| 28 | |||
| 29 | static inline unsigned long arch_local_irq_save(void) | ||
| 30 | { | ||
| 31 | unsigned long flags; | ||
| 32 | flags = arch_local_save_flags(); | ||
| 33 | arch_local_irq_disable(); | ||
| 34 | return flags; | ||
| 35 | } | ||
| 36 | |||
| 37 | static inline bool arch_irqs_disabled(void) | ||
| 38 | { | ||
| 39 | return arch_local_save_flags() == 0; | ||
| 40 | } | ||
| 41 | |||
| 42 | extern void *_switch_to(void *prev, void *next, void *last); | ||
| 43 | #define switch_to(prev, next, last) prev = _switch_to(prev, next, last) | ||
| 44 | |||
| 45 | #endif | ||
diff --git a/arch/x86/um/asm/system.h b/arch/x86/um/asm/system.h index a89113bc74f2..a459fd9b7598 100644 --- a/arch/x86/um/asm/system.h +++ b/arch/x86/um/asm/system.h | |||
| @@ -6,7 +6,6 @@ | |||
| 6 | #include <asm/cpufeature.h> | 6 | #include <asm/cpufeature.h> |
| 7 | #include <asm/cmpxchg.h> | 7 | #include <asm/cmpxchg.h> |
| 8 | #include <asm/nops.h> | 8 | #include <asm/nops.h> |
| 9 | #include <asm/system-um.h> | ||
| 10 | 9 | ||
| 11 | #include <linux/kernel.h> | 10 | #include <linux/kernel.h> |
| 12 | #include <linux/irqflags.h> | 11 | #include <linux/irqflags.h> |
| @@ -130,4 +129,7 @@ static inline void rdtsc_barrier(void) | |||
| 130 | alternative(ASM_NOP3, "lfence", X86_FEATURE_LFENCE_RDTSC); | 129 | alternative(ASM_NOP3, "lfence", X86_FEATURE_LFENCE_RDTSC); |
| 131 | } | 130 | } |
| 132 | 131 | ||
| 132 | extern void *_switch_to(void *prev, void *next, void *last); | ||
| 133 | #define switch_to(prev, next, last) prev = _switch_to(prev, next, last) | ||
| 134 | |||
| 133 | #endif | 135 | #endif |
