i8259.h 961 B

1234567891011121314151617181920212223242526272829303132333435
  1. #ifndef __ASM_I8259_H__
  2. #define __ASM_I8259_H__
  3. extern unsigned int cached_irq_mask;
  4. #define __byte(x,y) (((unsigned char *) &(y))[x])
  5. #define cached_master_mask (__byte(0, cached_irq_mask))
  6. #define cached_slave_mask (__byte(1, cached_irq_mask))
  7. /* i8259A PIC registers */
  8. #define PIC_MASTER_CMD 0x20
  9. #define PIC_MASTER_IMR 0x21
  10. #define PIC_MASTER_ISR PIC_MASTER_CMD
  11. #define PIC_MASTER_POLL PIC_MASTER_ISR
  12. #define PIC_MASTER_OCW3 PIC_MASTER_ISR
  13. #define PIC_SLAVE_CMD 0xa0
  14. #define PIC_SLAVE_IMR 0xa1
  15. /* i8259A PIC related value */
  16. #define PIC_CASCADE_IR 2
  17. #define MASTER_ICW4_DEFAULT 0x01
  18. #define SLAVE_ICW4_DEFAULT 0x01
  19. #define PIC_ICW4_AEOI 2
  20. extern spinlock_t i8259A_lock;
  21. extern void init_8259A(int auto_eoi);
  22. extern void enable_8259A_irq(unsigned int irq);
  23. extern void disable_8259A_irq(unsigned int irq);
  24. extern unsigned int startup_8259A_irq(unsigned int irq);
  25. #define inb_pic inb_p
  26. #define outb_pic outb_p
  27. #endif /* __ASM_I8259_H__ */