00001 /* 00002 * Copyright (C) 2005 Jakub Jermar 00003 * All rights reserved. 00004 * 00005 * Redistribution and use in source and binary forms, with or without 00006 * modification, are permitted provided that the following conditions 00007 * are met: 00008 * 00009 * - Redistributions of source code must retain the above copyright 00010 * notice, this list of conditions and the following disclaimer. 00011 * - Redistributions in binary form must reproduce the above copyright 00012 * notice, this list of conditions and the following disclaimer in the 00013 * documentation and/or other materials provided with the distribution. 00014 * - The name of the author may not be used to endorse or promote products 00015 * derived from this software without specific prior written permission. 00016 * 00017 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 00018 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 00019 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 00020 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 00021 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 00022 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 00023 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 00024 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00025 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 00026 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00027 */ 00028 00035 #ifndef __MADT_H__ 00036 #define __MADT_H__ 00037 00038 #include <genarch/acpi/acpi.h> 00039 #include <arch/smp/apic.h> 00040 #include <arch/smp/smp.h> 00041 00042 #define MADT_L_APIC 0 00043 #define MADT_IO_APIC 1 00044 #define MADT_INTR_SRC_OVRD 2 00045 #define MADT_NMI_SRC 3 00046 #define MADT_L_APIC_NMI 4 00047 #define MADT_L_APIC_ADDR_OVRD 5 00048 #define MADT_IO_SAPIC 6 00049 #define MADT_L_SAPIC 7 00050 #define MADT_PLATFORM_INTR_SRC 8 00051 #define MADT_RESERVED_SKIP_BEGIN 9 00052 #define MADT_RESERVED_SKIP_END 127 00053 #define MADT_RESERVED_OEM_BEGIN 128 00054 00055 struct madt_apic_header { 00056 __u8 type; 00057 __u8 length; 00058 } __attribute__ ((packed)); 00059 00060 00061 /* Multiple APIC Description Table */ 00062 struct acpi_madt { 00063 struct acpi_sdt_header header; 00064 __u32 l_apic_address; 00065 __u32 flags; 00066 struct madt_apic_header apic_header[]; 00067 } __attribute__ ((packed)); 00068 00069 struct madt_l_apic { 00070 struct madt_apic_header header; 00071 __u8 acpi_id; 00072 __u8 apic_id; 00073 __u32 flags; 00074 } __attribute__ ((packed)); 00075 00076 struct madt_io_apic { 00077 struct madt_apic_header header; 00078 __u8 io_apic_id; 00079 __u8 reserved; 00080 __u32 io_apic_address; 00081 __u32 global_intr_base; 00082 } __attribute__ ((packed)); 00083 00084 struct madt_intr_src_ovrd { 00085 struct madt_apic_header header; 00086 __u8 bus; 00087 __u8 source; 00088 __u32 global_int; 00089 __u16 flags; 00090 } __attribute__ ((packed)); 00091 00092 struct madt_nmi_src { 00093 struct madt_apic_header header; 00094 __u16 flags; 00095 __u32 global_intr; 00096 } __attribute__ ((packed)); 00097 00098 struct madt_l_apic_nmi { 00099 struct madt_apic_header header; 00100 __u8 acpi_id; 00101 __u16 flags; 00102 __u8 l_apic_lint; 00103 } __attribute__ ((packed)); 00104 00105 struct madt_l_apic_addr_ovrd { 00106 struct madt_apic_header header; 00107 __u16 reserved; 00108 __u64 l_apic_address; 00109 } __attribute__ ((packed)); 00110 00111 struct madt_io_sapic { 00112 struct madt_apic_header header; 00113 __u8 io_apic_id; 00114 __u8 reserved; 00115 __u32 global_intr_base; 00116 __u64 io_apic_address; 00117 } __attribute__ ((packed)); 00118 00119 struct madt_l_sapic { 00120 struct madt_apic_header header; 00121 __u8 acpi_id; 00122 __u8 sapic_id; 00123 __u8 sapic_eid; 00124 __u8 reserved[3]; 00125 __u32 flags; 00126 __u32 acpi_processor_uid_value; 00127 __u8 acpi_processor_uid_str[1]; 00128 } __attribute__ ((packed)); 00129 00130 struct madt_platform_intr_src { 00131 struct madt_apic_header header; 00132 __u16 flags; 00133 __u8 intr_type; 00134 __u8 processor_id; 00135 __u8 processor_eid; 00136 __u8 io_sapic_vector; 00137 __u32 global_intr; 00138 __u32 platform_intr_src_flags; 00139 } __attribute__ ((packed)); 00140 00141 extern struct acpi_madt *acpi_madt; 00142 extern struct smp_config_operations madt_config_operations; 00143 00144 extern void acpi_madt_parse(void); 00145 00146 #endif /* __MADT_H__ */ 00147