blob: 67c319e0efc79f4975e1983e8a9f75e31465e434 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef __ASM_I8259_H__
2#define __ASM_I8259_H__
3
4extern unsigned int cached_irq_mask;
5
Thomas Gleixnerf20ebee2008-01-30 13:30:29 +01006#define __byte(x,y) (((unsigned char *) &(y))[x])
Linus Torvalds1da177e2005-04-16 15:20:36 -07007#define cached_master_mask (__byte(0, cached_irq_mask))
8#define cached_slave_mask (__byte(1, cached_irq_mask))
9
Thomas Gleixnerf20ebee2008-01-30 13:30:29 +010010/* i8259A PIC registers */
11#define PIC_MASTER_CMD 0x20
12#define PIC_MASTER_IMR 0x21
13#define PIC_MASTER_ISR PIC_MASTER_CMD
14#define PIC_MASTER_POLL PIC_MASTER_ISR
15#define PIC_MASTER_OCW3 PIC_MASTER_ISR
16#define PIC_SLAVE_CMD 0xa0
17#define PIC_SLAVE_IMR 0xa1
18
19/* i8259A PIC related value */
20#define PIC_CASCADE_IR 2
21#define MASTER_ICW4_DEFAULT 0x01
22#define SLAVE_ICW4_DEFAULT 0x01
23#define PIC_ICW4_AEOI 2
24
Linus Torvalds1da177e2005-04-16 15:20:36 -070025extern spinlock_t i8259A_lock;
26
27extern void init_8259A(int auto_eoi);
28extern void enable_8259A_irq(unsigned int irq);
29extern void disable_8259A_irq(unsigned int irq);
30extern unsigned int startup_8259A_irq(unsigned int irq);
31
Alan Cox466eed22008-01-30 13:33:14 +010032#define inb_pic inb_p
33#define outb_pic outb_p
34
Linus Torvalds1da177e2005-04-16 15:20:36 -070035#endif /* __ASM_I8259_H__ */