3 #include <linux/kernel.h>
5 /* IRQ lock reference counter */
6 static atomic_t _refcnt = ATOMIC_INIT(0);
8 /* Check whether IRQs are currently disabled.
10 * This is the case, if flags is greater than 0.
13 int raw_irqs_disabled_flags(unsigned long flags)
15 return ((int)flags > 0);
18 /* Store the current flags state.
20 * This is done by returning the current refcnt.
22 * XXX: Up to now, flags was always 0 at this point and
23 * I assume that this is always the case. Prove?
25 unsigned long __raw_local_save_flags(void)
27 return (unsigned long)atomic_read(&_refcnt);
30 /* Restore IRQ state. */
31 void raw_local_irq_restore(unsigned long flags)
33 atomic_set(&_refcnt, flags);
36 /* Disable IRQs by grabbing the IRQ lock. */
37 void raw_local_irq_disable(void)
42 /* Unlock the IRQ lock until refcnt is 0. */
43 void raw_local_irq_enable(void)
45 atomic_set(&_refcnt, 0);
49 void raw_safe_halt(void)
60 /* These functions are empty for DDE. Every DDE thread is a separate
61 * "virtual" CPU. Therefore there is no need to en/disable bottom halves.
63 void local_bh_disable(void) {}
64 void __local_bh_enable(void) {}
65 void _local_bh_enable(void) {}
66 void local_bh_enable(void) {}