00001 #include "local.h" 00002 00003 #include <linux/kernel.h> 00004 00005 /* IRQ lock reference counter */ 00006 static atomic_t _refcnt = ATOMIC_INIT(0); 00007 00008 /* Check whether IRQs are currently disabled. 00009 * 00010 * This is the case, if flags is greater than 0. 00011 */ 00012 00013 int raw_irqs_disabled_flags(unsigned long flags) 00014 { 00015 return ((int)flags > 0); 00016 } 00017 00018 /* Store the current flags state. 00019 * 00020 * This is done by returning the current refcnt. 00021 * 00022 * XXX: Up to now, flags was always 0 at this point and 00023 * I assume that this is always the case. Prove? 00024 */ 00025 unsigned long __raw_local_save_flags(void) 00026 { 00027 return (unsigned long)atomic_read(&_refcnt); 00028 } 00029 00030 /* Restore IRQ state. */ 00031 void raw_local_irq_restore(unsigned long flags) 00032 { 00033 atomic_set(&_refcnt, flags); 00034 } 00035 00036 /* Disable IRQs by grabbing the IRQ lock. */ 00037 void raw_local_irq_disable(void) 00038 { 00039 atomic_inc(&_refcnt); 00040 } 00041 00042 /* Unlock the IRQ lock until refcnt is 0. */ 00043 void raw_local_irq_enable(void) 00044 { 00045 atomic_set(&_refcnt, 0); 00046 } 00047 00048 00049 void raw_safe_halt(void) 00050 { 00051 WARN_UNIMPL; 00052 } 00053 00054 00055 void halt(void) 00056 { 00057 WARN_UNIMPL; 00058 } 00059 00060 /* These functions are empty for DDE. Every DDE thread is a separate 00061 * "virtual" CPU. Therefore there is no need to en/disable bottom halves. 00062 */ 00063 void local_bh_disable(void) {} 00064 void __local_bh_enable(void) {} 00065 void _local_bh_enable(void) {} 00066 void local_bh_enable(void) {}
1.5.6