softirq.h
上传用户:lgb322
上传日期:2013-02-24
资源大小:30529k
文件大小:1k
源码类别:

嵌入式Linux

开发平台:

Unix_Linux

  1. /*
  2.  * This file is subject to the terms and conditions of the GNU General Public
  3.  * License.  See the file "COPYING" in the main directory of this archive
  4.  * for more details.
  5.  *
  6.  * Copyright (C) 1997, 1998, 1999, 2000, 2001 Ralf Baechle
  7.  * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
  8.  * Copyright (C) 1999, 2001 MIPS Technologies, Inc.
  9.  */
  10. #ifndef _ASM_SOFTIRQ_H
  11. #define _ASM_SOFTIRQ_H
  12. #include <asm/atomic.h>
  13. #include <asm/hardirq.h>
  14. extern inline void cpu_bh_disable(int cpu)
  15. {
  16. local_bh_count(cpu)++;
  17. barrier();
  18. }
  19.  
  20. extern inline void __cpu_bh_enable(int cpu)
  21. {
  22. barrier();
  23. local_bh_count(cpu)--;
  24. }
  25. #define local_bh_disable() cpu_bh_disable(smp_processor_id())
  26. #define __local_bh_enable() __cpu_bh_enable(smp_processor_id())
  27. #define local_bh_enable()
  28. do {
  29. int cpu;
  30. barrier();
  31. cpu = smp_processor_id();
  32. if (!--local_bh_count(cpu) && softirq_pending(cpu))
  33. do_softirq();
  34. } while (0)
  35. #define in_softirq() (local_bh_count(smp_processor_id()) != 0)
  36. #define __cpu_raise_softirq(cpu, nr) set_bit(nr, &softirq_pending(cpu))
  37. #endif /* _ASM_SOFTIRQ_H */