Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #ifndef __ASM_IO_APIC_H |
| 2 | #define __ASM_IO_APIC_H |
| 3 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 4 | #include <asm/types.h> |
| 5 | #include <asm/mpspec.h> |
| 6 | |
| 7 | /* |
| 8 | * Intel IO-APIC support for SMP and UP systems. |
| 9 | * |
| 10 | * Copyright (C) 1997, 1998, 1999, 2000 Ingo Molnar |
| 11 | */ |
| 12 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 13 | #define APIC_MISMATCH_DEBUG |
| 14 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 15 | /* |
| 16 | * The structure of the IO-APIC: |
| 17 | */ |
| 18 | union IO_APIC_reg_00 { |
| 19 | u32 raw; |
| 20 | struct { |
| 21 | u32 __reserved_2 : 14, |
| 22 | LTS : 1, |
| 23 | delivery_type : 1, |
| 24 | __reserved_1 : 8, |
| 25 | ID : 8; |
| 26 | } __attribute__ ((packed)) bits; |
| 27 | }; |
| 28 | |
| 29 | union IO_APIC_reg_01 { |
| 30 | u32 raw; |
| 31 | struct { |
| 32 | u32 version : 8, |
| 33 | __reserved_2 : 7, |
| 34 | PRQ : 1, |
| 35 | entries : 8, |
| 36 | __reserved_1 : 8; |
| 37 | } __attribute__ ((packed)) bits; |
| 38 | }; |
| 39 | |
| 40 | union IO_APIC_reg_02 { |
| 41 | u32 raw; |
| 42 | struct { |
| 43 | u32 __reserved_2 : 24, |
| 44 | arbitration : 4, |
| 45 | __reserved_1 : 4; |
| 46 | } __attribute__ ((packed)) bits; |
| 47 | }; |
| 48 | |
| 49 | union IO_APIC_reg_03 { |
| 50 | u32 raw; |
| 51 | struct { |
| 52 | u32 boot_DT : 1, |
| 53 | __reserved_1 : 31; |
| 54 | } __attribute__ ((packed)) bits; |
| 55 | }; |
| 56 | |
| 57 | /* |
| 58 | * # of IO-APICs and # of IRQ routing registers |
| 59 | */ |
| 60 | extern int nr_ioapics; |
| 61 | extern int nr_ioapic_registers[MAX_IO_APICS]; |
| 62 | |
| 63 | enum ioapic_irq_destination_types { |
| 64 | dest_Fixed = 0, |
| 65 | dest_LowestPrio = 1, |
| 66 | dest_SMI = 2, |
| 67 | dest__reserved_1 = 3, |
| 68 | dest_NMI = 4, |
| 69 | dest_INIT = 5, |
| 70 | dest__reserved_2 = 6, |
| 71 | dest_ExtINT = 7 |
| 72 | }; |
| 73 | |
| 74 | struct IO_APIC_route_entry { |
| 75 | __u32 vector : 8, |
| 76 | delivery_mode : 3, /* 000: FIXED |
| 77 | * 001: lowest prio |
| 78 | * 111: ExtINT |
| 79 | */ |
| 80 | dest_mode : 1, /* 0: physical, 1: logical */ |
| 81 | delivery_status : 1, |
| 82 | polarity : 1, |
| 83 | irr : 1, |
| 84 | trigger : 1, /* 0: edge, 1: level */ |
| 85 | mask : 1, /* 0: enabled, 1: disabled */ |
| 86 | __reserved_2 : 15; |
| 87 | |
| 88 | union { struct { __u32 |
| 89 | __reserved_1 : 24, |
| 90 | physical_dest : 4, |
| 91 | __reserved_2 : 4; |
| 92 | } physical; |
| 93 | |
| 94 | struct { __u32 |
| 95 | __reserved_1 : 24, |
| 96 | logical_dest : 8; |
| 97 | } logical; |
| 98 | } dest; |
| 99 | |
| 100 | } __attribute__ ((packed)); |
| 101 | |
| 102 | /* |
| 103 | * MP-BIOS irq configuration table structures: |
| 104 | */ |
| 105 | |
| 106 | /* I/O APIC entries */ |
| 107 | extern struct mpc_config_ioapic mp_ioapics[MAX_IO_APICS]; |
| 108 | |
| 109 | /* # of MP IRQ source entries */ |
| 110 | extern int mp_irq_entries; |
| 111 | |
| 112 | /* MP IRQ source entries */ |
| 113 | extern struct mpc_config_intsrc mp_irqs[MAX_IRQ_SOURCES]; |
| 114 | |
| 115 | /* non-0 if default (table-less) MP configuration */ |
| 116 | extern int mpc_default_type; |
| 117 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 118 | /* 1 if "noapic" boot option passed */ |
| 119 | extern int skip_ioapic_setup; |
| 120 | |
| 121 | /* |
| 122 | * If we use the IO-APIC for IRQ routing, disable automatic |
| 123 | * assignment of PCI IRQ's. |
| 124 | */ |
| 125 | #define io_apic_assign_pci_irqs (mp_irq_entries && !skip_ioapic_setup && io_apic_irqs) |
| 126 | |
Len Brown | 888ba6c | 2005-08-24 12:07:20 -0400 | [diff] [blame] | 127 | #ifdef CONFIG_ACPI |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 128 | extern int io_apic_get_version (int ioapic); |
| 129 | extern int io_apic_get_redir_entries (int ioapic); |
| 130 | extern int io_apic_set_pci_routing (int ioapic, int pin, int irq, int, int); |
| 131 | #endif |
| 132 | |
| 133 | extern int sis_apic_bug; /* dummy */ |
| 134 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 135 | void enable_NMI_through_LVT0 (void * dummy); |
| 136 | |
Ingo Molnar | 306e440 | 2005-06-30 02:58:55 -0700 | [diff] [blame] | 137 | extern spinlock_t i8259A_lock; |
| 138 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 139 | #endif |