minix/kernel/arch/i386/include/hw_intr.h
Tomas Hruby e6ebac015d APIC mode uses IO APICs
- kernel turns on IO APICs if no_apic is _not_ set or is equal 0

- pci driver must use the acpi driver to setup IRQ routing otherwise
  the system cannot work correctly except systems like KVM that use
  only legacy (E)ISA IRQs 0-15
2010-09-07 07:18:11 +00:00

49 lines
1.3 KiB
C

#ifndef __HW_INTR_X86_H__
#define __HW_INTR_X86_H__
#include "kernel/kernel.h"
_PROTOTYPE(int irq_8259_unmask,(int irq));
_PROTOTYPE(int irq_8259_mask,(int irq));
_PROTOTYPE(int irq_8259_eoi, (int irq));
_PROTOTYPE(void irq_handle,(int irq));
_PROTOTYPE(void i8259_disable,(void));
/*
* we don't use IO APIC if not configured for SMP as we cannot read any info
* about it unless we use MPS which is not present on all single CPU
* configurations. ACPI would be another option, however we don't support it
* either
*/
#if defined(CONFIG_APIC)
#include "arch/i386/apic.h"
#define hw_intr_mask(irq) ioapic_mask_irq(irq)
#define hw_intr_unmask(irq) ioapic_unmask_irq(irq)
#define hw_intr_ack(irq) ioapic_eoi(irq)
#define hw_intr_used(irq) do { \
if (ioapic_enabled) \
ioapic_set_irq(irq); \
} while (0)
#define hw_intr_not_used(irq) do { \
if (ioapic_enabled) \
ioapic_unset_irq(irq); \
} while (0)
#define hw_intr_disable_all() do { \
ioapic_disable_all(); \
ioapic_reset_pic(); \
lapic_disable(); \
} while (0)
#else
/* legacy PIC */
#define hw_intr_mask(irq) irq_8259_mask(irq)
#define hw_intr_unmask(irq) irq_8259_unmask(irq)
#define hw_intr_ack(irq) irq_8259_eoi(irq)
#define hw_intr_used(irq)
#define hw_intr_not_used(irq)
#define hw_intr_disable_all()
#endif
#endif /* __HW_INTR_X86_H__ */