1#ifdef __KERNEL__
2#ifndef _ASM_IRQ_H
3#define _ASM_IRQ_H
4
5/*
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */
11
12#include <asm/atomic.h>
13
14extern void disable_irq(unsigned int);
15extern void disable_irq_nosync(unsigned int);
16extern void enable_irq(unsigned int);
17
18/*
19 * this is the maximum number of virtual irqs we will use.
20 */
21#define NR_IRQS			512
22
23#define NUM_8259_INTERRUPTS	16
24
25/* Interrupt numbers are virtual in case they are sparsely
26 * distributed by the hardware.
27 */
28#define NR_HW_IRQS		8192
29extern unsigned short real_irq_to_virt_map[NR_HW_IRQS];
30extern unsigned short virt_irq_to_real_map[NR_IRQS];
31/* Create a mapping for a real_irq if it doesn't already exist.
32 * Return the virtual irq as a convenience.
33 */
34unsigned long virt_irq_create_mapping(unsigned long real_irq);
35
36/* These funcs map irqs between real and virtual */
37static inline unsigned long real_irq_to_virt(unsigned long real_irq) {
38	return real_irq_to_virt_map[real_irq];
39}
40static inline unsigned long virt_irq_to_real(unsigned long virt_irq) {
41	return virt_irq_to_real_map[virt_irq];
42}
43
44/*
45 * This gets called from serial.c, which is now used on
46 * powermacs as well as prep/chrp boxes.
47 * Prep and chrp both have cascaded 8259 PICs.
48 */
49static __inline__ int irq_cannonicalize(int irq)
50{
51	return irq;
52}
53
54#endif /* _ASM_IRQ_H */
55#endif /* __KERNEL__ */
56