staging: octeon-usb: prevent memory corruption
[linux-2.6/btrfs-unstable.git] / include / linux / bottom_half.h
blob86c12c93e3cf6ce9c1db4085b9ee986d2c1e5b9a
1 #ifndef _LINUX_BH_H
2 #define _LINUX_BH_H
4 #include <linux/preempt.h>
5 #include <linux/preempt_mask.h>
7 #ifdef CONFIG_TRACE_IRQFLAGS
8 extern void __local_bh_disable_ip(unsigned long ip, unsigned int cnt);
9 #else
10 static __always_inline void __local_bh_disable_ip(unsigned long ip, unsigned int cnt)
12 preempt_count_add(cnt);
13 barrier();
15 #endif
17 static inline void local_bh_disable(void)
19 __local_bh_disable_ip(_THIS_IP_, SOFTIRQ_DISABLE_OFFSET);
22 extern void _local_bh_enable(void);
23 extern void __local_bh_enable_ip(unsigned long ip, unsigned int cnt);
25 static inline void local_bh_enable_ip(unsigned long ip)
27 __local_bh_enable_ip(ip, SOFTIRQ_DISABLE_OFFSET);
30 static inline void local_bh_enable(void)
32 __local_bh_enable_ip(_THIS_IP_, SOFTIRQ_DISABLE_OFFSET);
35 #endif /* _LINUX_BH_H */