1 #ifndef __ASM_IO_APIC_H
2 #define __ASM_IO_APIC_H
4 #include <linux/types.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
15 * The structure of the IO-APIC:
17 union IO_APIC_reg_00
{
20 u32 __reserved_2
: 14,
25 } __attribute__ ((packed
)) bits
;
28 union IO_APIC_reg_01
{
36 } __attribute__ ((packed
)) bits
;
39 union IO_APIC_reg_02
{
42 u32 __reserved_2
: 24,
45 } __attribute__ ((packed
)) bits
;
48 union IO_APIC_reg_03
{
53 } __attribute__ ((packed
)) bits
;
56 enum ioapic_irq_destination_types
{
67 struct IO_APIC_route_entry
{
69 delivery_mode
: 3, /* 000: FIXED
73 dest_mode
: 1, /* 0: physical, 1: logical */
77 trigger
: 1, /* 0: edge, 1: level */
78 mask
: 1, /* 0: enabled, 1: disabled */
84 __u32 __reserved_1
: 24,
90 __u32 __reserved_1
: 24,
95 __u32 __reserved_3
: 24,
99 } __attribute__ ((packed
));
101 #ifdef CONFIG_X86_IO_APIC
104 * # of IO-APICs and # of IRQ routing registers
106 extern int nr_ioapics
;
107 extern int nr_ioapic_registers
[MAX_IO_APICS
];
110 * MP-BIOS irq configuration table structures:
113 #define MP_MAX_IOAPIC_PIN 127
115 struct mp_config_ioapic
{
116 unsigned long mp_apicaddr
;
117 unsigned int mp_apicid
;
118 unsigned char mp_type
;
119 unsigned char mp_apicver
;
120 unsigned char mp_flags
;
123 struct mp_config_intsrc
{
124 unsigned int mp_dstapic
;
125 unsigned char mp_type
;
126 unsigned char mp_irqtype
;
127 unsigned short mp_irqflag
;
128 unsigned char mp_srcbus
;
129 unsigned char mp_srcbusirq
;
130 unsigned char mp_dstirq
;
133 /* I/O APIC entries */
134 extern struct mp_config_ioapic mp_ioapics
[MAX_IO_APICS
];
136 /* # of MP IRQ source entries */
137 extern int mp_irq_entries
;
139 /* MP IRQ source entries */
140 extern struct mp_config_intsrc mp_irqs
[MAX_IRQ_SOURCES
];
142 /* non-0 if default (table-less) MP configuration */
143 extern int mpc_default_type
;
145 /* Older SiS APIC requires we rewrite the index register */
146 extern int sis_apic_bug
;
148 /* 1 if "noapic" boot option passed */
149 extern int skip_ioapic_setup
;
151 static inline void disable_ioapic_setup(void)
153 skip_ioapic_setup
= 1;
157 * If we use the IO-APIC for IRQ routing, disable automatic
158 * assignment of PCI IRQ's.
160 #define io_apic_assign_pci_irqs \
161 (mp_irq_entries && !skip_ioapic_setup && io_apic_irqs)
164 extern int io_apic_get_unique_id(int ioapic
, int apic_id
);
165 extern int io_apic_get_version(int ioapic
);
166 extern int io_apic_get_redir_entries(int ioapic
);
167 extern int io_apic_set_pci_routing(int ioapic
, int pin
, int irq
,
168 int edge_level
, int active_high_low
);
169 #endif /* CONFIG_ACPI */
171 extern int (*ioapic_renumber_irq
)(int ioapic
, int irq
);
172 extern void ioapic_init_mappings(void);
174 #else /* !CONFIG_X86_IO_APIC */
175 #define io_apic_assign_pci_irqs 0