]> git.proxmox.com Git - mirror_edk2.git/blob - Vlv2DeviceRefCodePkg/AcpiTablesPCAT/Madt/Madt.h
72eb44e9003ad939438f68454cfcd857101e9fa8
[mirror_edk2.git] / Vlv2DeviceRefCodePkg / AcpiTablesPCAT / Madt / Madt.h
1 /*++
2
3 Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>
4
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7
8 Module Name:
9
10 Madt.h
11
12 Abstract:
13
14 This file describes the contents of the ACPI Multiple APIC Description
15 Table (MADT). Some additional ACPI values are defined in Acpi1_0.h and
16 Acpi2_0.h.
17 To make changes to the MADT, it is necessary to update the count for the
18 APIC structure being updated, and to modify table found in Madt.c.
19
20 --*/
21
22 #ifndef _MADT_H
23 #define _MADT_H
24
25 //
26 // Statements that include other files
27 //
28 #include "AcpiTablePlatform.h"
29 #include <IndustryStandard/Acpi10.h>
30 #include <IndustryStandard/Acpi20.h>
31 #include <IndustryStandard/Acpi30.h>
32 #include "Platform.h"
33
34 //
35 // MADT Definitions
36 //
37 #define EFI_ACPI_OEM_MADT_REVISION 0x00000000
38 //
39 // Multiple APIC Flags are defined in AcpiX.0.h
40 //
41 #define EFI_ACPI_1_0_MULTIPLE_APIC_FLAGS (EFI_ACPI_1_0_PCAT_COMPAT)
42 #define EFI_ACPI_2_0_MULTIPLE_APIC_FLAGS (EFI_ACPI_2_0_PCAT_COMPAT)
43 #define EFI_ACPI_3_0_MULTIPLE_APIC_FLAGS (EFI_ACPI_3_0_PCAT_COMPAT)
44 #define EFI_ACPI_4_0_MULTIPLE_APIC_FLAGS (EFI_ACPI_4_0_PCAT_COMPAT)
45
46 //
47 // Define the number of each table type.
48 // This is where the table layout is modified.
49 //
50 #define EFI_ACPI_PROCESSOR_LOCAL_APIC_COUNT MAX_CPU_NUM
51 #define EFI_ACPI_LOCAL_APIC_NMI_COUNT MAX_CPU_NUM
52 #define EFI_ACPI_IO_APIC_COUNT 1
53 #define EFI_ACPI_INTERRUPT_SOURCE_OVERRIDE_COUNT 2
54 #define EFI_ACPI_NON_MASKABLE_INTERRUPT_SOURCE_COUNT 0
55 #define EFI_ACPI_LOCAL_APIC_ADDRESS_OVERRIDE_COUNT 0
56 #define EFI_ACPI_IO_SAPIC_COUNT 0
57 #define EFI_ACPI_PROCESSOR_LOCAL_SAPIC_COUNT 0
58 #define EFI_ACPI_PLATFORM_INTERRUPT_SOURCES_COUNT 0
59
60 //
61 // MADT structure
62 //
63 //
64 // Ensure proper structure formats
65 //
66 #pragma pack(1)
67 //
68 // ACPI 1.0 Table structure
69 //
70 typedef struct {
71 EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER Header;
72
73 #if EFI_ACPI_PROCESSOR_LOCAL_APIC_COUNT > 0
74 EFI_ACPI_1_0_PROCESSOR_LOCAL_APIC_STRUCTURE LocalApic[EFI_ACPI_PROCESSOR_LOCAL_APIC_COUNT];
75 #endif
76
77 #if EFI_ACPI_IO_APIC_COUNT > 0
78 EFI_ACPI_1_0_IO_APIC_STRUCTURE IoApic[EFI_ACPI_IO_APIC_COUNT];
79 #endif
80
81 #if EFI_ACPI_INTERRUPT_SOURCE_OVERRIDE_COUNT > 0
82 EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE Iso[EFI_ACPI_INTERRUPT_SOURCE_OVERRIDE_COUNT];
83 #endif
84
85 #if EFI_ACPI_NON_MASKABLE_INTERRUPT_SOURCE_COUNT > 0
86 EFI_ACPI_1_0_NON_MASKABLE_INTERRUPT_SOURCE_STRUCTURE NmiSource[EFI_ACPI_NON_MASKABLE_INTERRUPT_SOURCE_COUNT];
87 #endif
88
89 #if EFI_ACPI_LOCAL_APIC_NMI_COUNT > 0
90 EFI_ACPI_1_0_LOCAL_APIC_NMI_STRUCTURE LocalApicNmi[EFI_ACPI_LOCAL_APIC_NMI_COUNT];
91 #endif
92
93 #if EFI_ACPI_LOCAL_APIC_ADDRESS_OVERRIDE_COUNT > 0
94 EFI_ACPI_1_0_LOCAL_APIC_ADDRESS_OVERRIDE_STRUCTURE LocalApicOverride[EFI_ACPI_LOCAL_APIC_ADDRESS_OVERRIDE_COUNT];
95 #endif
96
97 } EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE;
98
99 //
100 // ACPI 2.0 Table structure
101 //
102 typedef struct {
103 EFI_ACPI_2_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER Header;
104
105 #if EFI_ACPI_PROCESSOR_LOCAL_APIC_COUNT > 0
106 EFI_ACPI_2_0_PROCESSOR_LOCAL_APIC_STRUCTURE LocalApic[EFI_ACPI_PROCESSOR_LOCAL_APIC_COUNT];
107 #endif
108
109 #if EFI_ACPI_IO_APIC_COUNT > 0
110 EFI_ACPI_2_0_IO_APIC_STRUCTURE IoApic[EFI_ACPI_IO_APIC_COUNT];
111 #endif
112
113 #if EFI_ACPI_INTERRUPT_SOURCE_OVERRIDE_COUNT > 0
114 EFI_ACPI_2_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE Iso[EFI_ACPI_INTERRUPT_SOURCE_OVERRIDE_COUNT];
115 #endif
116
117 #if EFI_ACPI_NON_MASKABLE_INTERRUPT_SOURCE_COUNT > 0
118 EFI_ACPI_2_0_NON_MASKABLE_INTERRUPT_SOURCE_STRUCTURE NmiSource[EFI_ACPI_NON_MASKABLE_INTERRUPT_SOURCE_COUNT];
119 #endif
120
121 #if EFI_ACPI_LOCAL_APIC_NMI_COUNT > 0
122 EFI_ACPI_2_0_LOCAL_APIC_NMI_STRUCTURE LocalApicNmi[EFI_ACPI_LOCAL_APIC_NMI_COUNT];
123 #endif
124
125 #if EFI_ACPI_LOCAL_APIC_ADDRESS_OVERRIDE_COUNT > 0
126 EFI_ACPI_2_0_LOCAL_APIC_ADDRESS_OVERRIDE_STRUCTURE LocalApicOverride[EFI_ACPI_LOCAL_APIC_ADDRESS_OVERRIDE_COUNT];
127 #endif
128
129 #if EFI_ACPI_IO_SAPIC_COUNT > 0
130 EFI_ACPI_2_0_IO_SAPIC_STRUCTURE IoSapic[EFI_ACPI_IO_SAPIC_COUNT];
131 #endif
132
133 #if EFI_ACPI_PROCESSOR_LOCAL_SAPIC_COUNT > 0
134 EFI_ACPI_2_0_PROCESSOR_LOCAL_SAPIC_STRUCTURE LocalSapic[EFI_ACPI_PROCESSOR_LOCAL_SAPIC_COUNT];
135 #endif
136
137 #if EFI_ACPI_PLATFORM_INTERRUPT_SOURCES_COUNT > 0
138 EFI_ACPI_2_0_PLATFORM_INTERRUPT_SOURCES_STRUCTURE PlatformInterruptSources[EFI_ACPI_PLATFORM_INTERRUPT_SOURCES_COUNT];
139 #endif
140
141 } EFI_ACPI_2_0_MULTIPLE_APIC_DESCRIPTION_TABLE;
142
143 //
144 // ACPI 3.0 Table structure
145 //
146 typedef struct {
147 EFI_ACPI_3_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER Header;
148
149 #if EFI_ACPI_PROCESSOR_LOCAL_APIC_COUNT > 0 // Type 0x00
150 EFI_ACPI_3_0_PROCESSOR_LOCAL_APIC_STRUCTURE LocalApic[EFI_ACPI_PROCESSOR_LOCAL_APIC_COUNT];
151 #endif
152
153 #if EFI_ACPI_IO_APIC_COUNT > 0 // Type 0x01
154 EFI_ACPI_3_0_IO_APIC_STRUCTURE IoApic[EFI_ACPI_IO_APIC_COUNT];
155 #endif
156
157 #if EFI_ACPI_INTERRUPT_SOURCE_OVERRIDE_COUNT > 0 // Type 0x02
158 EFI_ACPI_3_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE Iso[EFI_ACPI_INTERRUPT_SOURCE_OVERRIDE_COUNT];
159 #endif
160
161 #if EFI_ACPI_NON_MASKABLE_INTERRUPT_SOURCE_COUNT > 0 // Type 0x03
162 EFI_ACPI_3_0_NON_MASKABLE_INTERRUPT_SOURCE_STRUCTURE NmiSource[EFI_ACPI_NON_MASKABLE_INTERRUPT_SOURCE_COUNT];
163 #endif
164
165 #if EFI_ACPI_LOCAL_APIC_NMI_COUNT > 0 // Type 0x04
166 EFI_ACPI_3_0_LOCAL_APIC_NMI_STRUCTURE LocalApicNmi[EFI_ACPI_LOCAL_APIC_NMI_COUNT];
167 #endif
168
169 #if EFI_ACPI_LOCAL_APIC_ADDRESS_OVERRIDE_COUNT > 0 // Type 0x05
170 EFI_ACPI_3_0_LOCAL_APIC_ADDRESS_OVERRIDE_STRUCTURE LocalApicOverride[EFI_ACPI_LOCAL_APIC_ADDRESS_OVERRIDE_COUNT];
171 #endif
172
173 #if EFI_ACPI_IO_SAPIC_COUNT > 0 // Type 0x06
174 EFI_ACPI_3_0_IO_SAPIC_STRUCTURE IoSapic[EFI_ACPI_IO_SAPIC_COUNT];
175 #endif
176
177 #if EFI_ACPI_PROCESSOR_LOCAL_SAPIC_COUNT > 0 // Type 0x07 : This table changes in madt 2.0
178 EFI_ACPI_3_0_PROCESSOR_LOCAL_SAPIC_STRUCTURE LocalSapic[EFI_ACPI_PROCESSOR_LOCAL_SAPIC_COUNT];
179 #endif
180
181 #if EFI_ACPI_PLATFORM_INTERRUPT_SOURCES_COUNT > 0 // Type 0x08
182 EFI_ACPI_3_0_PLATFORM_INTERRUPT_SOURCES_STRUCTURE PlatformInterruptSources[EFI_ACPI_PLATFORM_INTERRUPT_SOURCES_COUNT];
183 #endif
184
185 } EFI_ACPI_3_0_MULTIPLE_APIC_DESCRIPTION_TABLE;
186
187 #pragma pack()
188
189 #endif