Import 2.3.18pre1
[davej-history.git] / include / asm-mips / hardirq.h
blob2232379ef9f23ac9f1c0fed259204faa3b25b3ff
1 /* $Id: hardirq.h,v 1.5 1998/08/29 21:20:21 ralf Exp $
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
7 * Copyright (C) 1997, 1998 by Ralf Baechle
8 */
9 #ifndef __ASM_MIPS_HARDIRQ_H
10 #define __ASM_MIPS_HARDIRQ_H
12 #include <linux/threads.h>
14 extern unsigned int local_irq_count[NR_CPUS];
17 * Are we in an interrupt context? Either doing bottom half
18 * or hardware interrupt processing?
20 #define in_interrupt() ({ int __cpu = smp_processor_id(); \
21 (local_irq_count[__cpu] + local_bh_count[__cpu] != 0); })
23 #ifndef __SMP__
25 #define hardirq_trylock(cpu) (local_irq_count[cpu] == 0)
26 #define hardirq_endlock(cpu) do { } while (0)
28 #define hardirq_enter(cpu) (local_irq_count[cpu]++)
29 #define hardirq_exit(cpu) (local_irq_count[cpu]--)
31 #define synchronize_irq() barrier();
33 #else
35 #error No habla MIPS SMP
37 #endif /* __SMP__ */
38 #endif /* __ASM_MIPS_HARDIRQ_H */