]>
Commit | Line | Data |
---|---|---|
49ba9447 | 1 | /** @file\r |
2 | MADT Table\r | |
3 | \r | |
4 | This file contains a structure definition for the ACPI 1.0 Multiple APIC \r | |
5 | Description Table (MADT). \r | |
6 | \r | |
7 | Copyright (c) 2008 - 2009, Intel Corporation<BR> All rights\r | |
8 | reserved. This program and the accompanying materials are\r | |
9 | licensed and made available under the terms and conditions of the BSD License\r | |
10 | which accompanies this distribution. The full text of the license may be found at\r | |
11 | http://opensource.org/licenses/bsd-license.php\r | |
12 | \r | |
13 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
14 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
15 | \r | |
16 | **/ \r | |
17 | \r | |
18 | #include <IndustryStandard/Acpi.h>\r | |
19 | \r | |
20 | //\r | |
21 | // MADT Definitions\r | |
22 | //\r | |
23 | #define EFI_ACPI_OEM_MADT_REVISION 0x00000000 // TBD\r | |
24 | \r | |
25 | //\r | |
26 | // Local APIC address\r | |
27 | //\r | |
28 | #define EFI_ACPI_LOCAL_APIC_ADDRESS 0xFEE00000 // TBD\r | |
29 | \r | |
30 | //\r | |
31 | // Multiple APIC Flags are defined in AcpiX.0.h\r | |
32 | //\r | |
33 | #define EFI_ACPI_1_0_MULTIPLE_APIC_FLAGS (EFI_ACPI_1_0_PCAT_COMPAT)\r | |
34 | \r | |
35 | //\r | |
36 | // Define the number of each table type.\r | |
37 | // This is where the table layout is modified.\r | |
38 | //\r | |
39 | #define EFI_ACPI_PROCESSOR_LOCAL_APIC_COUNT 1\r | |
40 | #define EFI_ACPI_INTERRUPT_SOURCE_OVERRIDE_COUNT 2\r | |
41 | #define EFI_ACPI_IO_APIC_COUNT 1\r | |
42 | \r | |
43 | //\r | |
44 | // Ensure proper structure formats\r | |
45 | //\r | |
46 | #pragma pack (1)\r | |
47 | \r | |
48 | //\r | |
49 | // ACPI 1.0 MADT structure\r | |
50 | //\r | |
51 | typedef struct {\r | |
52 | EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER Header;\r | |
53 | \r | |
54 | #if EFI_ACPI_PROCESSOR_LOCAL_APIC_COUNT > 0\r | |
55 | EFI_ACPI_1_0_PROCESSOR_LOCAL_APIC_STRUCTURE LocalApic[EFI_ACPI_PROCESSOR_LOCAL_APIC_COUNT];\r | |
56 | #endif\r | |
57 | \r | |
58 | #if EFI_ACPI_INTERRUPT_SOURCE_OVERRIDE_COUNT > 0\r | |
59 | EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE Iso[EFI_ACPI_INTERRUPT_SOURCE_OVERRIDE_COUNT];\r | |
60 | #endif\r | |
61 | \r | |
62 | #if EFI_ACPI_IO_APIC_COUNT > 0\r | |
63 | EFI_ACPI_1_0_IO_APIC_STRUCTURE IoApic[EFI_ACPI_IO_APIC_COUNT];\r | |
64 | #endif\r | |
65 | \r | |
66 | } EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE;\r | |
67 | \r | |
68 | #pragma pack ()\r | |
69 | \r | |
70 | //\r | |
71 | // Multiple APIC Description Table\r | |
72 | //\r | |
73 | EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE Madt = {\r | |
74 | EFI_ACPI_1_0_APIC_SIGNATURE,\r | |
75 | sizeof (EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE),\r | |
76 | EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION,\r | |
77 | \r | |
78 | //\r | |
79 | // Checksum will be updated at runtime\r | |
80 | //\r | |
81 | 0x00,\r | |
82 | \r | |
83 | //\r | |
84 | // It is expected that these values will be programmed at runtime\r | |
85 | //\r | |
86 | ' ', ' ', ' ', ' ', ' ', ' ',\r | |
87 | \r | |
88 | 0,\r | |
89 | EFI_ACPI_OEM_MADT_REVISION,\r | |
90 | 0,\r | |
91 | 0,\r | |
92 | \r | |
93 | //\r | |
94 | // MADT specific fields\r | |
95 | //\r | |
96 | EFI_ACPI_LOCAL_APIC_ADDRESS,\r | |
97 | EFI_ACPI_1_0_MULTIPLE_APIC_FLAGS,\r | |
98 | \r | |
99 | //\r | |
100 | // Processor Local APIC Structure\r | |
101 | //\r | |
102 | \r | |
103 | EFI_ACPI_1_0_PROCESSOR_LOCAL_APIC, // Type\r | |
104 | sizeof (EFI_ACPI_1_0_PROCESSOR_LOCAL_APIC_STRUCTURE), // Length\r | |
105 | 0x01, // Processor ID\r | |
106 | 0x00, // Local APIC ID\r | |
107 | 0x00000001, // Flags - Enabled by default\r | |
108 | \r | |
109 | //\r | |
110 | // Interrupt Source Override Structure\r | |
111 | //\r | |
112 | \r | |
113 | //\r | |
114 | // IRQ0=>IRQ2 Interrupt Source Override Structure\r | |
115 | //\r | |
116 | EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE, // Type\r | |
117 | sizeof (EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE),// Length\r | |
118 | 0x00, // Bus - ISA\r | |
119 | 0x00, // Source - IRQ0\r | |
120 | 0x00000002, // Global System Interrupt - IRQ2\r | |
121 | 0x0000, // Flags - Conforms to specifications of the bus\r | |
122 | \r | |
123 | //\r | |
124 | // ISO (SCI Active High) Interrupt Source Override Structure\r | |
125 | //\r | |
126 | EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE, // Type\r | |
127 | sizeof (EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE),// Length\r | |
128 | 0x00, // Bus - ISA\r | |
129 | 0x09, // Source - IRQ0\r | |
130 | 0x00000009, // Global System Interrupt - IRQ2\r | |
131 | 0x000D, // Flags - Level-tiggered, Active High\r | |
132 | \r | |
133 | //\r | |
134 | // IO APIC Structure\r | |
135 | //\r | |
136 | EFI_ACPI_1_0_IO_APIC, // Type\r | |
137 | sizeof (EFI_ACPI_1_0_IO_APIC_STRUCTURE), // Length\r | |
138 | 0x02, // IO APIC ID\r | |
139 | EFI_ACPI_RESERVED_BYTE, // Reserved\r | |
140 | 0xFEC00000, // IO APIC Address (physical)\r | |
141 | 0x00000000 // Global System Interrupt Base\r | |
142 | };\r | |
143 | \r | |
144 | \r | |
145 | VOID*\r | |
146 | ReferenceAcpiTable (\r | |
147 | VOID\r | |
148 | )\r | |
149 | {\r | |
150 | //\r | |
151 | // Reference the table being generated to prevent the optimizer from removing the \r | |
152 | // data structure from the exeutable\r | |
153 | //\r | |
154 | return (VOID*)&Madt;\r | |
155 | }\r |