Add checking code for GenAcpiTable tools.
[people/mcb30/edk2.git] / edk2 / Tools / CCode / Source / Include / IndustryStandard / Acpi1_0.h
1 /*++\r
2 \r
3 Copyright (c) 2006, Intel Corporation. All rights reserved. \r
4 This software and associated documentation (if any) is furnished\r
5 under a license and may only be used or copied in accordance\r
6 with the terms of the license. Except as permitted by such\r
7 license, no part of this software or documentation may be\r
8 reproduced, stored in a retrieval system, or transmitted in any\r
9 form or by any means without the express written consent of\r
10 Intel Corporation.\r
11 \r
12 \r
13 Module Name:\r
14   \r
15     Acpi1_0.h\r
16 \r
17 Abstract:\r
18 \r
19   ACPI 1.0b definitions from the ACPI Specification, revision 1.0b\r
20 \r
21 --*/\r
22 \r
23 #ifndef _ACPI_1_0_H_\r
24 #define _ACPI_1_0_H_\r
25 \r
26 #include <IndustryStandard\Acpi.h>\r
27 //\r
28 // Ensure proper structure formats\r
29 //\r
30 #pragma pack(1)\r
31 //\r
32 // ACPI 1.0b table structures\r
33 //\r
34 //\r
35 // Root System Description Pointer Structure\r
36 //\r
37 typedef struct {\r
38   UINT64  Signature;\r
39   UINT8   Checksum;\r
40   UINT8   OemId[6];\r
41   UINT8   Reserved;\r
42   UINT32  RsdtAddress;\r
43 } EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER;\r
44 \r
45 //\r
46 // Root System Description Table\r
47 // No definition needed as it is a common description table header followed by a\r
48 // variable number of UINT32 table pointers.\r
49 //\r
50 //\r
51 // RSDT Revision (as defined in ACPI 1.0b spec.)\r
52 //\r
53 #define EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_TABLE_REVISION 0x01\r
54 \r
55 //\r
56 // Fixed ACPI Description Table Structure (FADT)\r
57 //\r
58 typedef struct {\r
59   EFI_ACPI_DESCRIPTION_HEADER Header;\r
60   UINT32                      FirmwareCtrl;\r
61   UINT32                      Dsdt;\r
62   UINT8                       IntModel;\r
63   UINT8                       Reserved1;\r
64   UINT16                      SciInt;\r
65   UINT32                      SmiCmd;\r
66   UINT8                       AcpiEnable;\r
67   UINT8                       AcpiDisable;\r
68   UINT8                       S4BiosReq;\r
69   UINT8                       Reserved2;\r
70   UINT32                      Pm1aEvtBlk;\r
71   UINT32                      Pm1bEvtBlk;\r
72   UINT32                      Pm1aCntBlk;\r
73   UINT32                      Pm1bCntBlk;\r
74   UINT32                      Pm2CntBlk;\r
75   UINT32                      PmTmrBlk;\r
76   UINT32                      Gpe0Blk;\r
77   UINT32                      Gpe1Blk;\r
78   UINT8                       Pm1EvtLen;\r
79   UINT8                       Pm1CntLen;\r
80   UINT8                       Pm2CntLen;\r
81   UINT8                       PmTmLen;\r
82   UINT8                       Gpe0BlkLen;\r
83   UINT8                       Gpe1BlkLen;\r
84   UINT8                       Gpe1Base;\r
85   UINT8                       Reserved3;\r
86   UINT16                      PLvl2Lat;\r
87   UINT16                      PLvl3Lat;\r
88   UINT16                      FlushSize;\r
89   UINT16                      FlushStride;\r
90   UINT8                       DutyOffset;\r
91   UINT8                       DutyWidth;\r
92   UINT8                       DayAlrm;\r
93   UINT8                       MonAlrm;\r
94   UINT8                       Century;\r
95   UINT8                       Reserved4;\r
96   UINT8                       Reserved5;\r
97   UINT8                       Reserved6;\r
98   UINT32                      Flags;\r
99 } EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE;\r
100 \r
101 //\r
102 // FADT Version (as defined in ACPI 1.0b spec.)\r
103 //\r
104 #define EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE_REVISION  0x01\r
105 \r
106 //\r
107 // Fixed ACPI Description Table Fixed Feature Flags\r
108 // All other bits are reserved and must be set to 0.\r
109 //\r
110 #define EFI_ACPI_1_0_WBINVD       (1 << 0)\r
111 #define EFI_ACPI_1_0_WBINVD_FLUSH (1 << 1)\r
112 #define EFI_ACPI_1_0_PROC_C1      (1 << 2)\r
113 #define EFI_ACPI_1_0_P_LVL2_UP    (1 << 3)\r
114 #define EFI_ACPI_1_0_PWR_BUTTON   (1 << 4)\r
115 #define EFI_ACPI_1_0_SLP_BUTTON   (1 << 5)\r
116 #define EFI_ACPI_1_0_FIX_RTC      (1 << 6)\r
117 #define EFI_ACPI_1_0_RTC_S4       (1 << 7)\r
118 #define EFI_ACPI_1_0_TMR_VAL_EXT  (1 << 8)\r
119 #define EFI_ACPI_1_0_DCK_CAP      (1 << 9)\r
120 \r
121 //\r
122 // Firmware ACPI Control Structure\r
123 //\r
124 typedef struct {\r
125   UINT32  Signature;\r
126   UINT32  Length;\r
127   UINT32  HardwareSignature;\r
128   UINT32  FirmwareWakingVector;\r
129   UINT32  GlobalLock;\r
130   UINT32  Flags;\r
131   UINT8   Reserved[40];\r
132 } EFI_ACPI_1_0_FIRMWARE_ACPI_CONTROL_STRUCTURE;\r
133 \r
134 //\r
135 // Firmware Control Structure Feature Flags\r
136 // All other bits are reserved and must be set to 0.\r
137 //\r
138 #define EFI_ACPI_1_0_S4BIOS_F (1 << 0)\r
139 \r
140 //\r
141 // Multiple APIC Description Table header definition.  The rest of the table\r
142 // must be defined in a platform specific manner.\r
143 //\r
144 typedef struct {\r
145   EFI_ACPI_DESCRIPTION_HEADER Header;\r
146   UINT32                      LocalApicAddress;\r
147   UINT32                      Flags;\r
148 } EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER;\r
149 \r
150 //\r
151 // MADT Revision (as defined in ACPI 1.0b spec.)\r
152 //\r
153 #define EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION 0x01\r
154 \r
155 //\r
156 // Multiple APIC Flags\r
157 // All other bits are reserved and must be set to 0.\r
158 //\r
159 #define EFI_ACPI_1_0_PCAT_COMPAT  (1 << 0)\r
160 \r
161 //\r
162 // Multiple APIC Description Table APIC structure types\r
163 // All other values between 0x09 an 0xFF are reserved and\r
164 // will be ignored by OSPM.\r
165 //\r
166 #define EFI_ACPI_1_0_PROCESSOR_LOCAL_APIC           0x00\r
167 #define EFI_ACPI_1_0_IO_APIC                        0x01\r
168 #define EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE      0x02\r
169 #define EFI_ACPI_1_0_NON_MASKABLE_INTERRUPT_SOURCE  0x03\r
170 #define EFI_ACPI_1_0_LOCAL_APIC_NMI                 0x04\r
171 \r
172 //\r
173 // APIC Structure Definitions\r
174 //\r
175 //\r
176 // Processor Local APIC Structure Definition\r
177 //\r
178 typedef struct {\r
179   UINT8   Type;\r
180   UINT8   Length;\r
181   UINT8   AcpiProcessorId;\r
182   UINT8   ApicId;\r
183   UINT32  Flags;\r
184 } EFI_ACPI_1_0_PROCESSOR_LOCAL_APIC_STRUCTURE;\r
185 \r
186 //\r
187 // Local APIC Flags.  All other bits are reserved and must be 0.\r
188 //\r
189 #define EFI_ACPI_1_0_LOCAL_APIC_ENABLED (1 << 0)\r
190 \r
191 //\r
192 // IO APIC Structure\r
193 //\r
194 typedef struct {\r
195   UINT8   Type;\r
196   UINT8   Length;\r
197   UINT8   IoApicId;\r
198   UINT8   Reserved;\r
199   UINT32  IoApicAddress;\r
200   UINT32  SystemVectorBase;\r
201 } EFI_ACPI_1_0_IO_APIC_STRUCTURE;\r
202 \r
203 //\r
204 // Interrupt Source Override Structure\r
205 //\r
206 typedef struct {\r
207   UINT8   Type;\r
208   UINT8   Length;\r
209   UINT8   Bus;\r
210   UINT8   Source;\r
211   UINT32  GlobalSystemInterruptVector;\r
212   UINT16  Flags;\r
213 } EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE;\r
214 \r
215 //\r
216 // Non-Maskable Interrupt Source Structure\r
217 //\r
218 typedef struct {\r
219   UINT8   Type;\r
220   UINT8   Length;\r
221   UINT16  Flags;\r
222   UINT32  GlobalSystemInterruptVector;\r
223 } EFI_ACPI_1_0_NON_MASKABLE_INTERRUPT_SOURCE_STRUCTURE;\r
224 \r
225 //\r
226 // Local APIC NMI Structure\r
227 //\r
228 typedef struct {\r
229   UINT8   Type;\r
230   UINT8   Length;\r
231   UINT8   AcpiProcessorId;\r
232   UINT16  Flags;\r
233   UINT8   LocalApicInti;\r
234 } EFI_ACPI_1_0_LOCAL_APIC_NMI_STRUCTURE;\r
235 \r
236 //\r
237 // Smart Battery Description Table (SBST)\r
238 //\r
239 typedef struct {\r
240   EFI_ACPI_DESCRIPTION_HEADER Header;\r
241   UINT32                      WarningEnergyLevel;\r
242   UINT32                      LowEnergyLevel;\r
243   UINT32                      CriticalEnergyLevel;\r
244 } EFI_ACPI_1_0_SMART_BATTERY_DESCRIPTION_TABLE;\r
245 \r
246 //\r
247 // Known table signatures\r
248 //\r
249 //\r
250 // "RSD PTR " Root System Description Pointer\r
251 //\r
252 #define EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER_SIGNATURE  0x2052545020445352ULL\r
253 \r
254 //\r
255 // "APIC" Multiple APIC Description Table\r
256 //\r
257 #define EFI_ACPI_1_0_APIC_SIGNATURE 0x43495041\r
258 \r
259 //\r
260 // "DSDT" Differentiated System Description Table\r
261 //\r
262 #define EFI_ACPI_1_0_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE  0x54445344\r
263 \r
264 //\r
265 // "FACS" Firmware ACPI Control Structure\r
266 //\r
267 #define EFI_ACPI_1_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_SIGNATURE  0x53434146\r
268 \r
269 //\r
270 // "FACP" Fixed ACPI Description Table\r
271 //\r
272 #define EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE 0x50434146\r
273 \r
274 //\r
275 // "PSDT" Persistent System Description Table\r
276 //\r
277 #define EFI_ACPI_1_0_PERSISTENT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE  0x54445350\r
278 \r
279 //\r
280 // "RSDT" Root System Description Table\r
281 //\r
282 #define EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE  0x54445352\r
283 \r
284 //\r
285 // "SBST" Smart Battery Specification Table\r
286 //\r
287 #define EFI_ACPI_1_0_SMART_BATTERY_SPECIFICATION_TABLE_SIGNATURE  0x54534253\r
288 \r
289 //\r
290 // "SSDT" Secondary System Description Table\r
291 //\r
292 #define EFI_ACPI_1_0_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE 0x54445353\r
293 \r
294 #pragma pack()\r
295 \r
296 #endif\r