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