bottom_half.h 764 B

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef _LINUX_BH_H
  2. #define _LINUX_BH_H
  3. #include <linux/preempt.h>
  4. #ifdef CONFIG_TRACE_IRQFLAGS
  5. extern void __local_bh_disable_ip(unsigned long ip, unsigned int cnt);
  6. #else
  7. static __always_inline void __local_bh_disable_ip(unsigned long ip, unsigned int cnt)
  8. {
  9. preempt_count_add(cnt);
  10. barrier();
  11. }
  12. #endif
  13. static inline void local_bh_disable(void)
  14. {
  15. __local_bh_disable_ip(_THIS_IP_, SOFTIRQ_DISABLE_OFFSET);
  16. }
  17. extern void _local_bh_enable(void);
  18. extern void __local_bh_enable_ip(unsigned long ip, unsigned int cnt);
  19. static inline void local_bh_enable_ip(unsigned long ip)
  20. {
  21. __local_bh_enable_ip(ip, SOFTIRQ_DISABLE_OFFSET);
  22. }
  23. static inline void local_bh_enable(void)
  24. {
  25. __local_bh_enable_ip(_THIS_IP_, SOFTIRQ_DISABLE_OFFSET);
  26. }
  27. #endif /* _LINUX_BH_H */