diff options
Diffstat (limited to 'arch/um/include/asm/system-um.h')
-rw-r--r-- | arch/um/include/asm/system-um.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/arch/um/include/asm/system-um.h b/arch/um/include/asm/system-um.h new file mode 100644 index 000000000000..0eec24579288 --- /dev/null +++ b/arch/um/include/asm/system-um.h @@ -0,0 +1,45 @@ +#ifndef __UM_SYSTEM_GENERIC_H +#define __UM_SYSTEM_GENERIC_H + +extern int get_signals(void); +extern int set_signals(int enable); +extern void block_signals(void); +extern void unblock_signals(void); + +static inline unsigned long arch_local_save_flags(void) +{ + return get_signals(); +} + +static inline void arch_local_irq_restore(unsigned long flags) +{ + set_signals(flags); +} + +static inline void arch_local_irq_enable(void) +{ + unblock_signals(); +} + +static inline void arch_local_irq_disable(void) +{ + block_signals(); +} + +static inline unsigned long arch_local_irq_save(void) +{ + unsigned long flags; + flags = arch_local_save_flags(); + arch_local_irq_disable(); + return flags; +} + +static inline bool arch_irqs_disabled(void) +{ + return arch_local_save_flags() == 0; +} + +extern void *_switch_to(void *prev, void *next, void *last); +#define switch_to(prev, next, last) prev = _switch_to(prev, next, last) + +#endif |