]> git.proxmox.com Git - mirror_edk2.git/blame - OvmfPkg/AcpiTables/Madt.aslc
BaseTools/BinToPcd: Fix Python 2.7.x compatibility issue
[mirror_edk2.git] / OvmfPkg / AcpiTables / Madt.aslc
CommitLineData
49ba9447 1/** @file\r
2 MADT Table\r
3\r
54235984 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 - 2012, Intel Corporation. All rights reserved.<BR>\r
56d7640a 8 This program and the accompanying materials are\r
49ba9447 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
54235984 12\r
49ba9447 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
54235984 16**/\r
49ba9447 17\r
18#include <IndustryStandard/Acpi.h>\r
498f7d8d 19#include <Platform.h>\r
49ba9447 20\r
21//\r
22// Local APIC address\r
23//\r
24#define EFI_ACPI_LOCAL_APIC_ADDRESS 0xFEE00000 // TBD\r
25\r
26//\r
27// Multiple APIC Flags are defined in AcpiX.0.h\r
28//\r
29#define EFI_ACPI_1_0_MULTIPLE_APIC_FLAGS (EFI_ACPI_1_0_PCAT_COMPAT)\r
30\r
31//\r
32// Define the number of each table type.\r
33// This is where the table layout is modified.\r
34//\r
35#define EFI_ACPI_PROCESSOR_LOCAL_APIC_COUNT 1\r
36#define EFI_ACPI_INTERRUPT_SOURCE_OVERRIDE_COUNT 2\r
37#define EFI_ACPI_IO_APIC_COUNT 1\r
38\r
39//\r
40// Ensure proper structure formats\r
41//\r
42#pragma pack (1)\r
43\r
44//\r
45// ACPI 1.0 MADT structure\r
46//\r
47typedef struct {\r
48 EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER Header;\r
49\r
50#if EFI_ACPI_PROCESSOR_LOCAL_APIC_COUNT > 0\r
51 EFI_ACPI_1_0_PROCESSOR_LOCAL_APIC_STRUCTURE LocalApic[EFI_ACPI_PROCESSOR_LOCAL_APIC_COUNT];\r
52#endif\r
53\r
54#if EFI_ACPI_INTERRUPT_SOURCE_OVERRIDE_COUNT > 0\r
55 EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE Iso[EFI_ACPI_INTERRUPT_SOURCE_OVERRIDE_COUNT];\r
56#endif\r
57\r
58#if EFI_ACPI_IO_APIC_COUNT > 0\r
59 EFI_ACPI_1_0_IO_APIC_STRUCTURE IoApic[EFI_ACPI_IO_APIC_COUNT];\r
60#endif\r
61\r
62} EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE;\r
63\r
64#pragma pack ()\r
65\r
66//\r
67// Multiple APIC Description Table\r
68//\r
69EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE Madt = {\r
ce68d3bc
SZ
70 {\r
71 {\r
72 EFI_ACPI_1_0_APIC_SIGNATURE,\r
73 sizeof (EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE),\r
74 EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION,\r
75 0x00, // Checksum will be updated at runtime\r
76 {EFI_ACPI_OEM_ID},\r
77 EFI_ACPI_OEM_TABLE_ID,\r
78 EFI_ACPI_OEM_REVISION,\r
79 EFI_ACPI_CREATOR_ID,\r
80 EFI_ACPI_CREATOR_REVISION\r
81 },\r
82\r
83 //\r
84 // MADT specific fields\r
85 //\r
86 EFI_ACPI_LOCAL_APIC_ADDRESS,\r
87 EFI_ACPI_1_0_MULTIPLE_APIC_FLAGS,\r
88 },\r
54235984 89\r
49ba9447 90 //\r
91 // Processor Local APIC Structure\r
92 //\r
ce68d3bc
SZ
93 {\r
94 {\r
95 EFI_ACPI_1_0_PROCESSOR_LOCAL_APIC, // Type\r
96 sizeof (EFI_ACPI_1_0_PROCESSOR_LOCAL_APIC_STRUCTURE), // Length\r
97 0x00, // Processor ID\r
98 0x00, // Local APIC ID\r
99 0x00000001 // Flags - Enabled by default\r
100 }\r
101 },\r
49ba9447 102\r
103 //\r
104 // Interrupt Source Override Structure\r
105 //\r
106\r
ce68d3bc
SZ
107 {\r
108 {\r
109 //\r
110 // IRQ0=>IRQ2 Interrupt Source Override Structure\r
111 //\r
112 EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE, // Type\r
113 sizeof (EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE),// Length\r
114 0x00, // Bus - ISA\r
115 0x00, // Source - IRQ0\r
116 0x00000002, // Global System Interrupt - IRQ2\r
117 0x0000 // Flags - Conforms to specifications of the bus\r
118 },\r
119\r
120 {\r
121 //\r
122 // ISO (SCI Active High) Interrupt Source Override Structure\r
123 //\r
124 EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE, // Type\r
125 sizeof (EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE),// Length\r
126 0x00, // Bus - ISA\r
127 0x09, // Source - IRQ0\r
128 0x00000009, // Global System Interrupt - IRQ2\r
129 0x000D // Flags - Level-tiggered, Active High\r
130 }\r
131 },\r
49ba9447 132\r
133 //\r
134 // IO APIC Structure\r
135 //\r
ce68d3bc
SZ
136 {\r
137 {\r
138 EFI_ACPI_1_0_IO_APIC, // Type\r
139 sizeof (EFI_ACPI_1_0_IO_APIC_STRUCTURE), // Length\r
140 0x02, // IO APIC ID\r
141 EFI_ACPI_RESERVED_BYTE, // Reserved\r
142 0xFEC00000, // IO APIC Address (physical)\r
143 0x00000000 // Global System Interrupt Base\r
144 }\r
145 },\r
49ba9447 146};\r
147\r
148\r
149VOID*\r
150ReferenceAcpiTable (\r
151 VOID\r
152 )\r
153{\r
154 //\r
54235984 155 // Reference the table being generated to prevent the optimizer from removing the\r
49ba9447 156 // data structure from the exeutable\r
157 //\r
158 return (VOID*)&Madt;\r
159}\r