1 #ifndef __ASM_IO_APIC_H
2 #define __ASM_IO_APIC_H
5 #include <asm/mpspec.h>
6 #include <asm/apicdef.h>
9 * Intel IO-APIC support for SMP and UP systems.
11 * Copyright (C) 1997, 1998, 1999, 2000 Ingo Molnar
14 #ifdef CONFIG_X86_IO_APIC
17 * The structure of the IO-APIC:
19 union IO_APIC_reg_00
{
22 u32 __reserved_2
: 14,
27 } __attribute__ ((packed
)) bits
;
30 union IO_APIC_reg_01
{
38 } __attribute__ ((packed
)) bits
;
41 union IO_APIC_reg_02
{
44 u32 __reserved_2
: 24,
47 } __attribute__ ((packed
)) bits
;
50 union IO_APIC_reg_03
{
55 } __attribute__ ((packed
)) bits
;
59 * # of IO-APICs and # of IRQ routing registers
61 extern int nr_ioapics
;
62 extern int nr_ioapic_registers
[MAX_IO_APICS
];
64 enum ioapic_irq_destination_types
{
75 struct IO_APIC_route_entry
{
77 delivery_mode
: 3, /* 000: FIXED
81 dest_mode
: 1, /* 0: physical, 1: logical */
85 trigger
: 1, /* 0: edge, 1: level */
86 mask
: 1, /* 0: enabled, 1: disabled */
89 union { struct { __u32
101 } __attribute__ ((packed
));
104 * MP-BIOS irq configuration table structures:
107 /* I/O APIC entries */
108 extern struct mpc_config_ioapic mp_ioapics
[MAX_IO_APICS
];
110 /* # of MP IRQ source entries */
111 extern int mp_irq_entries
;
113 /* MP IRQ source entries */
114 extern struct mpc_config_intsrc mp_irqs
[MAX_IRQ_SOURCES
];
116 /* non-0 if default (table-less) MP configuration */
117 extern int mpc_default_type
;
119 /* Older SiS APIC requires we rewrite the index register */
120 extern int sis_apic_bug
;
122 /* 1 if "noapic" boot option passed */
123 extern int skip_ioapic_setup
;
125 static inline void disable_ioapic_setup(void)
127 skip_ioapic_setup
= 1;
130 static inline int ioapic_setup_disabled(void)
132 return skip_ioapic_setup
;
136 * If we use the IO-APIC for IRQ routing, disable automatic
137 * assignment of PCI IRQ's.
139 #define io_apic_assign_pci_irqs (mp_irq_entries && !skip_ioapic_setup && io_apic_irqs)
142 extern int io_apic_get_unique_id (int ioapic
, int apic_id
);
143 extern int io_apic_get_version (int ioapic
);
144 extern int io_apic_get_redir_entries (int ioapic
);
145 extern int io_apic_set_pci_routing (int ioapic
, int pin
, int irq
, int edge_level
, int active_high_low
);
146 extern int timer_uses_ioapic_pin_0
;
147 #endif /* CONFIG_ACPI */
149 extern int (*ioapic_renumber_irq
)(int ioapic
, int irq
);
151 #else /* !CONFIG_X86_IO_APIC */
152 #define io_apic_assign_pci_irqs 0