make vfs & filesystems use failable copying
[minix3.git] / kernel / arch / i386 / include / hw_intr.h
blob3cc7c0b0e31b40d25923e990826fda42e3c58d7d
1 #ifndef __HW_INTR_X86_H__
2 #define __HW_INTR_X86_H__
4 #include "kernel/kernel.h"
5 void irq_8259_unmask(int irq);
6 void irq_8259_mask(int irq);
7 void irq_8259_eoi(int irq);
8 void irq_handle(int irq);
9 void i8259_disable(void);
10 void eoi_8259_master(void);
11 void eoi_8259_slave(void);
13 /*
14 * we don't use IO APIC if not configured for SMP as we cannot read any info
15 * about it unless we use MPS which is not present on all single CPU
16 * configurations. ACPI would be another option, however we don't support it
17 * either
19 #if defined(USE_APIC)
20 #include "kernel/arch/i386/apic.h"
22 #define hw_intr_mask(irq) ioapic_mask_irq(irq)
23 #define hw_intr_unmask(irq) ioapic_unmask_irq(irq)
24 #define hw_intr_ack(irq) ioapic_eoi(irq)
25 #define hw_intr_used(irq) do { \
26 if (ioapic_enabled) \
27 ioapic_set_irq(irq); \
28 } while (0)
29 #define hw_intr_not_used(irq) do { \
30 if (ioapic_enabled) \
31 ioapic_unset_irq(irq); \
32 } while (0)
33 #define hw_intr_disable_all() do { \
34 ioapic_disable_all(); \
35 ioapic_reset_pic(); \
36 lapic_disable(); \
37 } while (0)
38 #ifdef CONFIG_SMP
39 #define ipi_ack apic_eoi
40 #endif
42 #else
43 /* legacy PIC */
45 #define hw_intr_mask(irq) irq_8259_mask(irq)
46 #define hw_intr_unmask(irq) irq_8259_unmask(irq)
47 #define hw_intr_ack(irq) irq_8259_eoi(irq)
48 #define hw_intr_used(irq)
49 #define hw_intr_not_used(irq)
50 #define hw_intr_disable_all()
52 #endif
54 #endif /* __HW_INTR_X86_H__ */