Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
[wrt350n-kernel.git] / include / asm-um / system-generic.h
blob5bcfa35e7a22c79eed604df3697ba7c89baeb43d
1 #ifndef __UM_SYSTEM_GENERIC_H
2 #define __UM_SYSTEM_GENERIC_H
4 #include "asm/arch/system.h"
6 #undef switch_to
7 #undef local_irq_save
8 #undef local_irq_restore
9 #undef local_irq_disable
10 #undef local_irq_enable
11 #undef local_save_flags
12 #undef local_irq_restore
13 #undef local_irq_enable
14 #undef local_irq_disable
15 #undef local_irq_save
16 #undef irqs_disabled
18 extern void *switch_to(void *prev, void *next, void *last);
20 extern int get_signals(void);
21 extern int set_signals(int enable);
22 extern int get_signals(void);
23 extern void block_signals(void);
24 extern void unblock_signals(void);
26 #define local_save_flags(flags) do { typecheck(unsigned long, flags); \
27 (flags) = get_signals(); } while(0)
28 #define local_irq_restore(flags) do { typecheck(unsigned long, flags); \
29 set_signals(flags); } while(0)
31 #define local_irq_save(flags) do { local_save_flags(flags); \
32 local_irq_disable(); } while(0)
34 #define local_irq_enable() unblock_signals()
35 #define local_irq_disable() block_signals()
37 #define irqs_disabled() \
38 ({ \
39 unsigned long flags; \
40 local_save_flags(flags); \
41 (flags == 0); \
44 extern void *_switch_to(void *prev, void *next, void *last);
45 #define switch_to(prev, next, last) prev = _switch_to(prev, next, last)
47 #endif