Sync ACPICA with Intel's version 20150930.
[dragonfly.git] / sys / contrib / dev / acpica / source / include / actbl1.h
CommitLineData
0d02842f
SW
1/******************************************************************************
2 *
3 * Name: actbl1.h - Additional ACPI table definitions
4 *
5 *****************************************************************************/
6
7/*
fe7b5cb4 8 * Copyright (C) 2000 - 2015, Intel Corp.
0d02842f
SW
9 * All rights reserved.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions, and the following disclaimer,
16 * without modification.
17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 * substantially similar to the "NO WARRANTY" disclaimer below
19 * ("Disclaimer") and any redistribution must be conditioned upon
20 * including a substantially similar Disclaimer requirement for further
21 * binary redistribution.
22 * 3. Neither the names of the above-listed copyright holders nor the names
23 * of any contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
25 *
26 * Alternatively, this software may be distributed under the terms of the
27 * GNU General Public License ("GPL") version 2 as published by the Free
28 * Software Foundation.
29 *
30 * NO WARRANTY
31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 * POSSIBILITY OF SUCH DAMAGES.
42 */
43
44#ifndef __ACTBL1_H__
45#define __ACTBL1_H__
46
47
48/*******************************************************************************
49 *
50 * Additional ACPI Tables (1)
51 *
52 * These tables are not consumed directly by the ACPICA subsystem, but are
53 * included here to support device drivers and the AML disassembler.
54 *
55 * The tables in this file are fully defined within the ACPI specification.
56 *
57 ******************************************************************************/
58
59
60/*
61 * Values for description table header signatures for tables defined in this
62 * file. Useful because they make it more difficult to inadvertently type in
63 * the wrong signature.
64 */
65#define ACPI_SIG_BERT "BERT" /* Boot Error Record Table */
66#define ACPI_SIG_CPEP "CPEP" /* Corrected Platform Error Polling table */
67#define ACPI_SIG_ECDT "ECDT" /* Embedded Controller Boot Resources Table */
68#define ACPI_SIG_EINJ "EINJ" /* Error Injection table */
69#define ACPI_SIG_ERST "ERST" /* Error Record Serialization Table */
70#define ACPI_SIG_HEST "HEST" /* Hardware Error Source Table */
71#define ACPI_SIG_MADT "APIC" /* Multiple APIC Description Table */
72#define ACPI_SIG_MSCT "MSCT" /* Maximum System Characteristics Table */
73#define ACPI_SIG_SBST "SBST" /* Smart Battery Specification Table */
74#define ACPI_SIG_SLIT "SLIT" /* System Locality Distance Information Table */
75#define ACPI_SIG_SRAT "SRAT" /* System Resource Affinity Table */
896f2e3a 76#define ACPI_SIG_NFIT "NFIT" /* NVDIMM Firmware Interface Table */
0d02842f
SW
77
78
79/*
80 * All tables must be byte-packed to match the ACPI specification, since
81 * the tables are provided by the system BIOS.
82 */
83#pragma pack(1)
84
85/*
86 * Note: C bitfields are not used for this reason:
87 *
88 * "Bitfields are great and easy to read, but unfortunately the C language
89 * does not specify the layout of bitfields in memory, which means they are
90 * essentially useless for dealing with packed data in on-disk formats or
91 * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me,
92 * this decision was a design error in C. Ritchie could have picked an order
93 * and stuck with it." Norman Ramsey.
94 * See http://stackoverflow.com/a/1053662/41661
95 */
96
97
98/*******************************************************************************
99 *
100 * Common subtable headers
101 *
102 ******************************************************************************/
103
104/* Generic subtable header (used in MADT, SRAT, etc.) */
105
106typedef struct acpi_subtable_header
107{
108 UINT8 Type;
109 UINT8 Length;
110
111} ACPI_SUBTABLE_HEADER;
112
113
114/* Subtable header for WHEA tables (EINJ, ERST, WDAT) */
115
116typedef struct acpi_whea_header
117{
118 UINT8 Action;
119 UINT8 Instruction;
120 UINT8 Flags;
121 UINT8 Reserved;
122 ACPI_GENERIC_ADDRESS RegisterRegion;
123 UINT64 Value; /* Value used with Read/Write register */
124 UINT64 Mask; /* Bitmask required for this register instruction */
125
126} ACPI_WHEA_HEADER;
127
128
129/*******************************************************************************
130 *
131 * BERT - Boot Error Record Table (ACPI 4.0)
132 * Version 1
133 *
134 ******************************************************************************/
135
136typedef struct acpi_table_bert
137{
138 ACPI_TABLE_HEADER Header; /* Common ACPI table header */
139 UINT32 RegionLength; /* Length of the boot error region */
140 UINT64 Address; /* Physical address of the error region */
141
142} ACPI_TABLE_BERT;
143
144
145/* Boot Error Region (not a subtable, pointed to by Address field above) */
146
147typedef struct acpi_bert_region
148{
149 UINT32 BlockStatus; /* Type of error information */
150 UINT32 RawDataOffset; /* Offset to raw error data */
151 UINT32 RawDataLength; /* Length of raw error data */
152 UINT32 DataLength; /* Length of generic error data */
153 UINT32 ErrorSeverity; /* Severity code */
154
155} ACPI_BERT_REGION;
156
157/* Values for BlockStatus flags above */
158
159#define ACPI_BERT_UNCORRECTABLE (1)
160#define ACPI_BERT_CORRECTABLE (1<<1)
161#define ACPI_BERT_MULTIPLE_UNCORRECTABLE (1<<2)
162#define ACPI_BERT_MULTIPLE_CORRECTABLE (1<<3)
163#define ACPI_BERT_ERROR_ENTRY_COUNT (0xFF<<4) /* 8 bits, error count */
164
165/* Values for ErrorSeverity above */
166
167enum AcpiBertErrorSeverity
168{
169 ACPI_BERT_ERROR_CORRECTABLE = 0,
170 ACPI_BERT_ERROR_FATAL = 1,
171 ACPI_BERT_ERROR_CORRECTED = 2,
172 ACPI_BERT_ERROR_NONE = 3,
173 ACPI_BERT_ERROR_RESERVED = 4 /* 4 and greater are reserved */
174};
175
176/*
177 * Note: The generic error data that follows the ErrorSeverity field above
178 * uses the ACPI_HEST_GENERIC_DATA defined under the HEST table below
179 */
180
181
182/*******************************************************************************
183 *
184 * CPEP - Corrected Platform Error Polling table (ACPI 4.0)
185 * Version 1
186 *
187 ******************************************************************************/
188
189typedef struct acpi_table_cpep
190{
191 ACPI_TABLE_HEADER Header; /* Common ACPI table header */
192 UINT64 Reserved;
193
194} ACPI_TABLE_CPEP;
195
196
197/* Subtable */
198
199typedef struct acpi_cpep_polling
200{
201 ACPI_SUBTABLE_HEADER Header;
202 UINT8 Id; /* Processor ID */
203 UINT8 Eid; /* Processor EID */
204 UINT32 Interval; /* Polling interval (msec) */
205
206} ACPI_CPEP_POLLING;
207
208
209/*******************************************************************************
210 *
211 * ECDT - Embedded Controller Boot Resources Table
212 * Version 1
213 *
214 ******************************************************************************/
215
216typedef struct acpi_table_ecdt
217{
218 ACPI_TABLE_HEADER Header; /* Common ACPI table header */
219 ACPI_GENERIC_ADDRESS Control; /* Address of EC command/status register */
220 ACPI_GENERIC_ADDRESS Data; /* Address of EC data register */
221 UINT32 Uid; /* Unique ID - must be same as the EC _UID method */
222 UINT8 Gpe; /* The GPE for the EC */
223 UINT8 Id[1]; /* Full namepath of the EC in the ACPI namespace */
224
225} ACPI_TABLE_ECDT;
226
227
228/*******************************************************************************
229 *
230 * EINJ - Error Injection Table (ACPI 4.0)
231 * Version 1
232 *
233 ******************************************************************************/
234
235typedef struct acpi_table_einj
236{
237 ACPI_TABLE_HEADER Header; /* Common ACPI table header */
238 UINT32 HeaderLength;
239 UINT8 Flags;
240 UINT8 Reserved[3];
241 UINT32 Entries;
242
243} ACPI_TABLE_EINJ;
244
245
246/* EINJ Injection Instruction Entries (actions) */
247
248typedef struct acpi_einj_entry
249{
250 ACPI_WHEA_HEADER WheaHeader; /* Common header for WHEA tables */
251
252} ACPI_EINJ_ENTRY;
253
254/* Masks for Flags field above */
255
256#define ACPI_EINJ_PRESERVE (1)
257
258/* Values for Action field above */
259
260enum AcpiEinjActions
261{
262 ACPI_EINJ_BEGIN_OPERATION = 0,
263 ACPI_EINJ_GET_TRIGGER_TABLE = 1,
264 ACPI_EINJ_SET_ERROR_TYPE = 2,
265 ACPI_EINJ_GET_ERROR_TYPE = 3,
266 ACPI_EINJ_END_OPERATION = 4,
267 ACPI_EINJ_EXECUTE_OPERATION = 5,
268 ACPI_EINJ_CHECK_BUSY_STATUS = 6,
269 ACPI_EINJ_GET_COMMAND_STATUS = 7,
270 ACPI_EINJ_SET_ERROR_TYPE_WITH_ADDRESS = 8,
271 ACPI_EINJ_ACTION_RESERVED = 9, /* 9 and greater are reserved */
272 ACPI_EINJ_TRIGGER_ERROR = 0xFF /* Except for this value */
273};
274
275/* Values for Instruction field above */
276
277enum AcpiEinjInstructions
278{
279 ACPI_EINJ_READ_REGISTER = 0,
280 ACPI_EINJ_READ_REGISTER_VALUE = 1,
281 ACPI_EINJ_WRITE_REGISTER = 2,
282 ACPI_EINJ_WRITE_REGISTER_VALUE = 3,
283 ACPI_EINJ_NOOP = 4,
284 ACPI_EINJ_FLUSH_CACHELINE = 5,
285 ACPI_EINJ_INSTRUCTION_RESERVED = 6 /* 6 and greater are reserved */
286};
287
288typedef struct acpi_einj_error_type_with_addr
289{
290 UINT32 ErrorType;
291 UINT32 VendorStructOffset;
292 UINT32 Flags;
293 UINT32 ApicId;
294 UINT64 Address;
295 UINT64 Range;
296 UINT32 PcieId;
297
298} ACPI_EINJ_ERROR_TYPE_WITH_ADDR;
299
300typedef struct acpi_einj_vendor
301{
302 UINT32 Length;
303 UINT32 PcieId;
304 UINT16 VendorId;
305 UINT16 DeviceId;
306 UINT8 RevisionId;
307 UINT8 Reserved[3];
308
309} ACPI_EINJ_VENDOR;
310
311
312/* EINJ Trigger Error Action Table */
313
314typedef struct acpi_einj_trigger
315{
316 UINT32 HeaderSize;
317 UINT32 Revision;
318 UINT32 TableSize;
319 UINT32 EntryCount;
320
321} ACPI_EINJ_TRIGGER;
322
323/* Command status return values */
324
325enum AcpiEinjCommandStatus
326{
327 ACPI_EINJ_SUCCESS = 0,
328 ACPI_EINJ_FAILURE = 1,
329 ACPI_EINJ_INVALID_ACCESS = 2,
330 ACPI_EINJ_STATUS_RESERVED = 3 /* 3 and greater are reserved */
331};
332
333
334/* Error types returned from ACPI_EINJ_GET_ERROR_TYPE (bitfield) */
335
336#define ACPI_EINJ_PROCESSOR_CORRECTABLE (1)
337#define ACPI_EINJ_PROCESSOR_UNCORRECTABLE (1<<1)
338#define ACPI_EINJ_PROCESSOR_FATAL (1<<2)
339#define ACPI_EINJ_MEMORY_CORRECTABLE (1<<3)
340#define ACPI_EINJ_MEMORY_UNCORRECTABLE (1<<4)
341#define ACPI_EINJ_MEMORY_FATAL (1<<5)
342#define ACPI_EINJ_PCIX_CORRECTABLE (1<<6)
343#define ACPI_EINJ_PCIX_UNCORRECTABLE (1<<7)
344#define ACPI_EINJ_PCIX_FATAL (1<<8)
345#define ACPI_EINJ_PLATFORM_CORRECTABLE (1<<9)
346#define ACPI_EINJ_PLATFORM_UNCORRECTABLE (1<<10)
347#define ACPI_EINJ_PLATFORM_FATAL (1<<11)
348#define ACPI_EINJ_VENDOR_DEFINED (1<<31)
349
350
351/*******************************************************************************
352 *
353 * ERST - Error Record Serialization Table (ACPI 4.0)
354 * Version 1
355 *
356 ******************************************************************************/
357
358typedef struct acpi_table_erst
359{
360 ACPI_TABLE_HEADER Header; /* Common ACPI table header */
361 UINT32 HeaderLength;
362 UINT32 Reserved;
363 UINT32 Entries;
364
365} ACPI_TABLE_ERST;
366
367
368/* ERST Serialization Entries (actions) */
369
370typedef struct acpi_erst_entry
371{
372 ACPI_WHEA_HEADER WheaHeader; /* Common header for WHEA tables */
373
374} ACPI_ERST_ENTRY;
375
376/* Masks for Flags field above */
377
378#define ACPI_ERST_PRESERVE (1)
379
380/* Values for Action field above */
381
382enum AcpiErstActions
383{
384 ACPI_ERST_BEGIN_WRITE = 0,
385 ACPI_ERST_BEGIN_READ = 1,
386 ACPI_ERST_BEGIN_CLEAR = 2,
387 ACPI_ERST_END = 3,
388 ACPI_ERST_SET_RECORD_OFFSET = 4,
389 ACPI_ERST_EXECUTE_OPERATION = 5,
390 ACPI_ERST_CHECK_BUSY_STATUS = 6,
391 ACPI_ERST_GET_COMMAND_STATUS = 7,
392 ACPI_ERST_GET_RECORD_ID = 8,
393 ACPI_ERST_SET_RECORD_ID = 9,
394 ACPI_ERST_GET_RECORD_COUNT = 10,
395 ACPI_ERST_BEGIN_DUMMY_WRIITE = 11,
396 ACPI_ERST_NOT_USED = 12,
397 ACPI_ERST_GET_ERROR_RANGE = 13,
398 ACPI_ERST_GET_ERROR_LENGTH = 14,
399 ACPI_ERST_GET_ERROR_ATTRIBUTES = 15,
400 ACPI_ERST_ACTION_RESERVED = 16 /* 16 and greater are reserved */
401};
402
403/* Values for Instruction field above */
404
405enum AcpiErstInstructions
406{
407 ACPI_ERST_READ_REGISTER = 0,
408 ACPI_ERST_READ_REGISTER_VALUE = 1,
409 ACPI_ERST_WRITE_REGISTER = 2,
410 ACPI_ERST_WRITE_REGISTER_VALUE = 3,
411 ACPI_ERST_NOOP = 4,
412 ACPI_ERST_LOAD_VAR1 = 5,
413 ACPI_ERST_LOAD_VAR2 = 6,
414 ACPI_ERST_STORE_VAR1 = 7,
415 ACPI_ERST_ADD = 8,
416 ACPI_ERST_SUBTRACT = 9,
417 ACPI_ERST_ADD_VALUE = 10,
418 ACPI_ERST_SUBTRACT_VALUE = 11,
419 ACPI_ERST_STALL = 12,
420 ACPI_ERST_STALL_WHILE_TRUE = 13,
421 ACPI_ERST_SKIP_NEXT_IF_TRUE = 14,
422 ACPI_ERST_GOTO = 15,
423 ACPI_ERST_SET_SRC_ADDRESS_BASE = 16,
424 ACPI_ERST_SET_DST_ADDRESS_BASE = 17,
425 ACPI_ERST_MOVE_DATA = 18,
426 ACPI_ERST_INSTRUCTION_RESERVED = 19 /* 19 and greater are reserved */
427};
428
429/* Command status return values */
430
431enum AcpiErstCommandStatus
432{
433 ACPI_ERST_SUCESS = 0,
434 ACPI_ERST_NO_SPACE = 1,
435 ACPI_ERST_NOT_AVAILABLE = 2,
436 ACPI_ERST_FAILURE = 3,
437 ACPI_ERST_RECORD_EMPTY = 4,
438 ACPI_ERST_NOT_FOUND = 5,
439 ACPI_ERST_STATUS_RESERVED = 6 /* 6 and greater are reserved */
440};
441
442
443/* Error Record Serialization Information */
444
445typedef struct acpi_erst_info
446{
447 UINT16 Signature; /* Should be "ER" */
448 UINT8 Data[48];
449
450} ACPI_ERST_INFO;
451
452
453/*******************************************************************************
454 *
455 * HEST - Hardware Error Source Table (ACPI 4.0)
456 * Version 1
457 *
458 ******************************************************************************/
459
460typedef struct acpi_table_hest
461{
462 ACPI_TABLE_HEADER Header; /* Common ACPI table header */
463 UINT32 ErrorSourceCount;
464
465} ACPI_TABLE_HEST;
466
467
468/* HEST subtable header */
469
470typedef struct acpi_hest_header
471{
472 UINT16 Type;
473 UINT16 SourceId;
474
475} ACPI_HEST_HEADER;
476
477
478/* Values for Type field above for subtables */
479
480enum AcpiHestTypes
481{
482 ACPI_HEST_TYPE_IA32_CHECK = 0,
483 ACPI_HEST_TYPE_IA32_CORRECTED_CHECK = 1,
484 ACPI_HEST_TYPE_IA32_NMI = 2,
485 ACPI_HEST_TYPE_NOT_USED3 = 3,
486 ACPI_HEST_TYPE_NOT_USED4 = 4,
487 ACPI_HEST_TYPE_NOT_USED5 = 5,
488 ACPI_HEST_TYPE_AER_ROOT_PORT = 6,
489 ACPI_HEST_TYPE_AER_ENDPOINT = 7,
490 ACPI_HEST_TYPE_AER_BRIDGE = 8,
491 ACPI_HEST_TYPE_GENERIC_ERROR = 9,
492 ACPI_HEST_TYPE_RESERVED = 10 /* 10 and greater are reserved */
493};
494
495
496/*
497 * HEST substructures contained in subtables
498 */
499
500/*
501 * IA32 Error Bank(s) - Follows the ACPI_HEST_IA_MACHINE_CHECK and
502 * ACPI_HEST_IA_CORRECTED structures.
503 */
504typedef struct acpi_hest_ia_error_bank
505{
506 UINT8 BankNumber;
507 UINT8 ClearStatusOnInit;
508 UINT8 StatusFormat;
509 UINT8 Reserved;
510 UINT32 ControlRegister;
511 UINT64 ControlData;
512 UINT32 StatusRegister;
513 UINT32 AddressRegister;
514 UINT32 MiscRegister;
515
516} ACPI_HEST_IA_ERROR_BANK;
517
518
519/* Common HEST sub-structure for PCI/AER structures below (6,7,8) */
520
521typedef struct acpi_hest_aer_common
522{
523 UINT16 Reserved1;
524 UINT8 Flags;
525 UINT8 Enabled;
526 UINT32 RecordsToPreallocate;
527 UINT32 MaxSectionsPerRecord;
528 UINT32 Bus; /* Bus and Segment numbers */
529 UINT16 Device;
530 UINT16 Function;
531 UINT16 DeviceControl;
532 UINT16 Reserved2;
533 UINT32 UncorrectableMask;
534 UINT32 UncorrectableSeverity;
535 UINT32 CorrectableMask;
536 UINT32 AdvancedCapabilities;
537
538} ACPI_HEST_AER_COMMON;
539
540/* Masks for HEST Flags fields */
541
542#define ACPI_HEST_FIRMWARE_FIRST (1)
543#define ACPI_HEST_GLOBAL (1<<1)
544
545/*
546 * Macros to access the bus/segment numbers in Bus field above:
547 * Bus number is encoded in bits 7:0
548 * Segment number is encoded in bits 23:8
549 */
550#define ACPI_HEST_BUS(Bus) ((Bus) & 0xFF)
551#define ACPI_HEST_SEGMENT(Bus) (((Bus) >> 8) & 0xFFFF)
552
553
554/* Hardware Error Notification */
555
556typedef struct acpi_hest_notify
557{
558 UINT8 Type;
559 UINT8 Length;
560 UINT16 ConfigWriteEnable;
561 UINT32 PollInterval;
562 UINT32 Vector;
563 UINT32 PollingThresholdValue;
564 UINT32 PollingThresholdWindow;
565 UINT32 ErrorThresholdValue;
566 UINT32 ErrorThresholdWindow;
567
568} ACPI_HEST_NOTIFY;
569
570/* Values for Notify Type field above */
571
572enum AcpiHestNotifyTypes
573{
574 ACPI_HEST_NOTIFY_POLLED = 0,
575 ACPI_HEST_NOTIFY_EXTERNAL = 1,
576 ACPI_HEST_NOTIFY_LOCAL = 2,
577 ACPI_HEST_NOTIFY_SCI = 3,
578 ACPI_HEST_NOTIFY_NMI = 4,
579 ACPI_HEST_NOTIFY_CMCI = 5, /* ACPI 5.0 */
580 ACPI_HEST_NOTIFY_MCE = 6, /* ACPI 5.0 */
581 ACPI_HEST_NOTIFY_RESERVED = 7 /* 7 and greater are reserved */
582};
583
584/* Values for ConfigWriteEnable bitfield above */
585
586#define ACPI_HEST_TYPE (1)
587#define ACPI_HEST_POLL_INTERVAL (1<<1)
588#define ACPI_HEST_POLL_THRESHOLD_VALUE (1<<2)
589#define ACPI_HEST_POLL_THRESHOLD_WINDOW (1<<3)
590#define ACPI_HEST_ERR_THRESHOLD_VALUE (1<<4)
591#define ACPI_HEST_ERR_THRESHOLD_WINDOW (1<<5)
592
593
594/*
595 * HEST subtables
596 */
597
598/* 0: IA32 Machine Check Exception */
599
600typedef struct acpi_hest_ia_machine_check
601{
602 ACPI_HEST_HEADER Header;
603 UINT16 Reserved1;
604 UINT8 Flags;
605 UINT8 Enabled;
606 UINT32 RecordsToPreallocate;
607 UINT32 MaxSectionsPerRecord;
608 UINT64 GlobalCapabilityData;
609 UINT64 GlobalControlData;
610 UINT8 NumHardwareBanks;
611 UINT8 Reserved3[7];
612
613} ACPI_HEST_IA_MACHINE_CHECK;
614
615
616/* 1: IA32 Corrected Machine Check */
617
618typedef struct acpi_hest_ia_corrected
619{
620 ACPI_HEST_HEADER Header;
621 UINT16 Reserved1;
622 UINT8 Flags;
623 UINT8 Enabled;
624 UINT32 RecordsToPreallocate;
625 UINT32 MaxSectionsPerRecord;
626 ACPI_HEST_NOTIFY Notify;
627 UINT8 NumHardwareBanks;
628 UINT8 Reserved2[3];
629
630} ACPI_HEST_IA_CORRECTED;
631
632
633/* 2: IA32 Non-Maskable Interrupt */
634
635typedef struct acpi_hest_ia_nmi
636{
637 ACPI_HEST_HEADER Header;
638 UINT32 Reserved;
639 UINT32 RecordsToPreallocate;
640 UINT32 MaxSectionsPerRecord;
641 UINT32 MaxRawDataLength;
642
643} ACPI_HEST_IA_NMI;
644
645
646/* 3,4,5: Not used */
647
648/* 6: PCI Express Root Port AER */
649
650typedef struct acpi_hest_aer_root
651{
652 ACPI_HEST_HEADER Header;
653 ACPI_HEST_AER_COMMON Aer;
654 UINT32 RootErrorCommand;
655
656} ACPI_HEST_AER_ROOT;
657
658
659/* 7: PCI Express AER (AER Endpoint) */
660
661typedef struct acpi_hest_aer
662{
663 ACPI_HEST_HEADER Header;
664 ACPI_HEST_AER_COMMON Aer;
665
666} ACPI_HEST_AER;
667
668
669/* 8: PCI Express/PCI-X Bridge AER */
670
671typedef struct acpi_hest_aer_bridge
672{
673 ACPI_HEST_HEADER Header;
674 ACPI_HEST_AER_COMMON Aer;
675 UINT32 UncorrectableMask2;
676 UINT32 UncorrectableSeverity2;
677 UINT32 AdvancedCapabilities2;
678
679} ACPI_HEST_AER_BRIDGE;
680
681
682/* 9: Generic Hardware Error Source */
683
684typedef struct acpi_hest_generic
685{
686 ACPI_HEST_HEADER Header;
687 UINT16 RelatedSourceId;
688 UINT8 Reserved;
689 UINT8 Enabled;
690 UINT32 RecordsToPreallocate;
691 UINT32 MaxSectionsPerRecord;
692 UINT32 MaxRawDataLength;
693 ACPI_GENERIC_ADDRESS ErrorStatusAddress;
694 ACPI_HEST_NOTIFY Notify;
695 UINT32 ErrorBlockLength;
696
697} ACPI_HEST_GENERIC;
698
699
700/* Generic Error Status block */
701
702typedef struct acpi_hest_generic_status
703{
704 UINT32 BlockStatus;
705 UINT32 RawDataOffset;
706 UINT32 RawDataLength;
707 UINT32 DataLength;
708 UINT32 ErrorSeverity;
709
710} ACPI_HEST_GENERIC_STATUS;
711
712/* Values for BlockStatus flags above */
713
714#define ACPI_HEST_UNCORRECTABLE (1)
715#define ACPI_HEST_CORRECTABLE (1<<1)
716#define ACPI_HEST_MULTIPLE_UNCORRECTABLE (1<<2)
717#define ACPI_HEST_MULTIPLE_CORRECTABLE (1<<3)
718#define ACPI_HEST_ERROR_ENTRY_COUNT (0xFF<<4) /* 8 bits, error count */
719
720
721/* Generic Error Data entry */
722
723typedef struct acpi_hest_generic_data
724{
725 UINT8 SectionType[16];
726 UINT32 ErrorSeverity;
727 UINT16 Revision;
728 UINT8 ValidationBits;
729 UINT8 Flags;
730 UINT32 ErrorDataLength;
731 UINT8 FruId[16];
732 UINT8 FruText[20];
733
734} ACPI_HEST_GENERIC_DATA;
735
736
737/*******************************************************************************
738 *
739 * MADT - Multiple APIC Description Table
740 * Version 3
741 *
742 ******************************************************************************/
743
744typedef struct acpi_table_madt
745{
746 ACPI_TABLE_HEADER Header; /* Common ACPI table header */
747 UINT32 Address; /* Physical address of local APIC */
748 UINT32 Flags;
749
750} ACPI_TABLE_MADT;
751
752/* Masks for Flags field above */
753
754#define ACPI_MADT_PCAT_COMPAT (1) /* 00: System also has dual 8259s */
755
756/* Values for PCATCompat flag */
757
758#define ACPI_MADT_DUAL_PIC 0
759#define ACPI_MADT_MULTIPLE_APIC 1
760
761
762/* Values for MADT subtable type in ACPI_SUBTABLE_HEADER */
763
764enum AcpiMadtType
765{
066b6da2
SW
766 ACPI_MADT_TYPE_LOCAL_APIC = 0,
767 ACPI_MADT_TYPE_IO_APIC = 1,
768 ACPI_MADT_TYPE_INTERRUPT_OVERRIDE = 2,
769 ACPI_MADT_TYPE_NMI_SOURCE = 3,
770 ACPI_MADT_TYPE_LOCAL_APIC_NMI = 4,
771 ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE = 5,
772 ACPI_MADT_TYPE_IO_SAPIC = 6,
773 ACPI_MADT_TYPE_LOCAL_SAPIC = 7,
774 ACPI_MADT_TYPE_INTERRUPT_SOURCE = 8,
775 ACPI_MADT_TYPE_LOCAL_X2APIC = 9,
776 ACPI_MADT_TYPE_LOCAL_X2APIC_NMI = 10,
777 ACPI_MADT_TYPE_GENERIC_INTERRUPT = 11,
778 ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR = 12,
779 ACPI_MADT_TYPE_GENERIC_MSI_FRAME = 13,
780 ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR = 14,
896f2e3a
SW
781 ACPI_MADT_TYPE_GENERIC_TRANSLATOR = 15,
782 ACPI_MADT_TYPE_RESERVED = 16 /* 16 and greater are reserved */
0d02842f
SW
783};
784
785
786/*
9e1c0880 787 * MADT Subtables, correspond to Type in ACPI_SUBTABLE_HEADER
0d02842f
SW
788 */
789
790/* 0: Processor Local APIC */
791
792typedef struct acpi_madt_local_apic
793{
794 ACPI_SUBTABLE_HEADER Header;
795 UINT8 ProcessorId; /* ACPI processor id */
796 UINT8 Id; /* Processor's local APIC id */
797 UINT32 LapicFlags;
798
799} ACPI_MADT_LOCAL_APIC;
800
801
802/* 1: IO APIC */
803
804typedef struct acpi_madt_io_apic
805{
806 ACPI_SUBTABLE_HEADER Header;
807 UINT8 Id; /* I/O APIC ID */
808 UINT8 Reserved; /* Reserved - must be zero */
809 UINT32 Address; /* APIC physical address */
810 UINT32 GlobalIrqBase; /* Global system interrupt where INTI lines start */
811
812} ACPI_MADT_IO_APIC;
813
814
815/* 2: Interrupt Override */
816
817typedef struct acpi_madt_interrupt_override
818{
819 ACPI_SUBTABLE_HEADER Header;
820 UINT8 Bus; /* 0 - ISA */
821 UINT8 SourceIrq; /* Interrupt source (IRQ) */
822 UINT32 GlobalIrq; /* Global system interrupt */
823 UINT16 IntiFlags;
824
825} ACPI_MADT_INTERRUPT_OVERRIDE;
826
827
828/* 3: NMI Source */
829
830typedef struct acpi_madt_nmi_source
831{
832 ACPI_SUBTABLE_HEADER Header;
833 UINT16 IntiFlags;
834 UINT32 GlobalIrq; /* Global system interrupt */
835
836} ACPI_MADT_NMI_SOURCE;
837
838
839/* 4: Local APIC NMI */
840
841typedef struct acpi_madt_local_apic_nmi
842{
843 ACPI_SUBTABLE_HEADER Header;
844 UINT8 ProcessorId; /* ACPI processor id */
845 UINT16 IntiFlags;
846 UINT8 Lint; /* LINTn to which NMI is connected */
847
848} ACPI_MADT_LOCAL_APIC_NMI;
849
850
851/* 5: Address Override */
852
853typedef struct acpi_madt_local_apic_override
854{
855 ACPI_SUBTABLE_HEADER Header;
856 UINT16 Reserved; /* Reserved, must be zero */
857 UINT64 Address; /* APIC physical address */
858
859} ACPI_MADT_LOCAL_APIC_OVERRIDE;
860
861
862/* 6: I/O Sapic */
863
864typedef struct acpi_madt_io_sapic
865{
866 ACPI_SUBTABLE_HEADER Header;
867 UINT8 Id; /* I/O SAPIC ID */
868 UINT8 Reserved; /* Reserved, must be zero */
869 UINT32 GlobalIrqBase; /* Global interrupt for SAPIC start */
870 UINT64 Address; /* SAPIC physical address */
871
872} ACPI_MADT_IO_SAPIC;
873
874
875/* 7: Local Sapic */
876
877typedef struct acpi_madt_local_sapic
878{
879 ACPI_SUBTABLE_HEADER Header;
880 UINT8 ProcessorId; /* ACPI processor id */
881 UINT8 Id; /* SAPIC ID */
882 UINT8 Eid; /* SAPIC EID */
883 UINT8 Reserved[3]; /* Reserved, must be zero */
884 UINT32 LapicFlags;
885 UINT32 Uid; /* Numeric UID - ACPI 3.0 */
886 char UidString[1]; /* String UID - ACPI 3.0 */
887
888} ACPI_MADT_LOCAL_SAPIC;
889
890
891/* 8: Platform Interrupt Source */
892
893typedef struct acpi_madt_interrupt_source
894{
895 ACPI_SUBTABLE_HEADER Header;
896 UINT16 IntiFlags;
897 UINT8 Type; /* 1=PMI, 2=INIT, 3=corrected */
898 UINT8 Id; /* Processor ID */
899 UINT8 Eid; /* Processor EID */
900 UINT8 IoSapicVector; /* Vector value for PMI interrupts */
901 UINT32 GlobalIrq; /* Global system interrupt */
902 UINT32 Flags; /* Interrupt Source Flags */
903
904} ACPI_MADT_INTERRUPT_SOURCE;
905
906/* Masks for Flags field above */
907
908#define ACPI_MADT_CPEI_OVERRIDE (1)
909
910
911/* 9: Processor Local X2APIC (ACPI 4.0) */
912
913typedef struct acpi_madt_local_x2apic
914{
915 ACPI_SUBTABLE_HEADER Header;
916 UINT16 Reserved; /* Reserved - must be zero */
917 UINT32 LocalApicId; /* Processor x2APIC ID */
918 UINT32 LapicFlags;
919 UINT32 Uid; /* ACPI processor UID */
920
921} ACPI_MADT_LOCAL_X2APIC;
922
923
924/* 10: Local X2APIC NMI (ACPI 4.0) */
925
926typedef struct acpi_madt_local_x2apic_nmi
927{
928 ACPI_SUBTABLE_HEADER Header;
929 UINT16 IntiFlags;
930 UINT32 Uid; /* ACPI processor UID */
931 UINT8 Lint; /* LINTn to which NMI is connected */
932 UINT8 Reserved[3]; /* Reserved - must be zero */
933
934} ACPI_MADT_LOCAL_X2APIC_NMI;
935
936
896f2e3a 937/* 11: Generic Interrupt (ACPI 5.0 + ACPI 6.0 changes) */
0d02842f
SW
938
939typedef struct acpi_madt_generic_interrupt
940{
941 ACPI_SUBTABLE_HEADER Header;
942 UINT16 Reserved; /* Reserved - must be zero */
066b6da2 943 UINT32 CpuInterfaceNumber;
0d02842f
SW
944 UINT32 Uid;
945 UINT32 Flags;
946 UINT32 ParkingVersion;
947 UINT32 PerformanceInterrupt;
948 UINT64 ParkedAddress;
949 UINT64 BaseAddress;
066b6da2
SW
950 UINT64 GicvBaseAddress;
951 UINT64 GichBaseAddress;
952 UINT32 VgicInterrupt;
953 UINT64 GicrBaseAddress;
954 UINT64 ArmMpidr;
896f2e3a
SW
955 UINT8 EfficiencyClass;
956 UINT8 Reserved2[3];
0d02842f
SW
957
958} ACPI_MADT_GENERIC_INTERRUPT;
959
066b6da2
SW
960/* Masks for Flags field above */
961
962/* ACPI_MADT_ENABLED (1) Processor is usable if set */
963#define ACPI_MADT_PERFORMANCE_IRQ_MODE (1<<1) /* 01: Performance Interrupt Mode */
964#define ACPI_MADT_VGIC_IRQ_MODE (1<<2) /* 02: VGIC Maintenance Interrupt mode */
965
0d02842f 966
896f2e3a 967/* 12: Generic Distributor (ACPI 5.0 + ACPI 6.0 changes) */
0d02842f
SW
968
969typedef struct acpi_madt_generic_distributor
970{
971 ACPI_SUBTABLE_HEADER Header;
972 UINT16 Reserved; /* Reserved - must be zero */
973 UINT32 GicId;
974 UINT64 BaseAddress;
975 UINT32 GlobalIrqBase;
896f2e3a 976 UINT8 Version;
25ca8c79 977 UINT8 Reserved2[3]; /* Reserved - must be zero */
0d02842f
SW
978
979} ACPI_MADT_GENERIC_DISTRIBUTOR;
980
25ca8c79
SW
981/* Values for Version field above */
982
983enum AcpiMadtGicVersion
984{
985 ACPI_MADT_GIC_VERSION_NONE = 0,
986 ACPI_MADT_GIC_VERSION_V1 = 1,
987 ACPI_MADT_GIC_VERSION_V2 = 2,
988 ACPI_MADT_GIC_VERSION_V3 = 3,
989 ACPI_MADT_GIC_VERSION_V4 = 4,
990 ACPI_MADT_GIC_VERSION_RESERVED = 5 /* 5 and greater are reserved */
991};
992
0d02842f 993
066b6da2
SW
994/* 13: Generic MSI Frame (ACPI 5.1) */
995
996typedef struct acpi_madt_generic_msi_frame
997{
998 ACPI_SUBTABLE_HEADER Header;
999 UINT16 Reserved; /* Reserved - must be zero */
1000 UINT32 MsiFrameId;
1001 UINT64 BaseAddress;
1002 UINT32 Flags;
1003 UINT16 SpiCount;
1004 UINT16 SpiBase;
1005
1006} ACPI_MADT_GENERIC_MSI_FRAME;
1007
1008/* Masks for Flags field above */
1009
1010#define ACPI_MADT_OVERRIDE_SPI_VALUES (1)
1011
1012
1013/* 14: Generic Redistributor (ACPI 5.1) */
1014
1015typedef struct acpi_madt_generic_redistributor
1016{
1017 ACPI_SUBTABLE_HEADER Header;
1018 UINT16 Reserved; /* reserved - must be zero */
1019 UINT64 BaseAddress;
1020 UINT32 Length;
1021
1022} ACPI_MADT_GENERIC_REDISTRIBUTOR;
1023
1024
896f2e3a
SW
1025/* 15: Generic Translator (ACPI 6.0) */
1026
1027typedef struct acpi_madt_generic_translator
1028{
1029 ACPI_SUBTABLE_HEADER Header;
1030 UINT16 Reserved; /* reserved - must be zero */
1031 UINT32 TranslationId;
1032 UINT64 BaseAddress;
1033 UINT32 Reserved2;
1034
1035} ACPI_MADT_GENERIC_TRANSLATOR;
1036
1037
0d02842f
SW
1038/*
1039 * Common flags fields for MADT subtables
1040 */
1041
066b6da2 1042/* MADT Local APIC flags */
0d02842f
SW
1043
1044#define ACPI_MADT_ENABLED (1) /* 00: Processor is usable if set */
1045
1046/* MADT MPS INTI flags (IntiFlags) */
1047
1048#define ACPI_MADT_POLARITY_MASK (3) /* 00-01: Polarity of APIC I/O input signals */
1049#define ACPI_MADT_TRIGGER_MASK (3<<2) /* 02-03: Trigger mode of APIC input signals */
1050
1051/* Values for MPS INTI flags */
1052
1053#define ACPI_MADT_POLARITY_CONFORMS 0
1054#define ACPI_MADT_POLARITY_ACTIVE_HIGH 1
1055#define ACPI_MADT_POLARITY_RESERVED 2
1056#define ACPI_MADT_POLARITY_ACTIVE_LOW 3
1057
1058#define ACPI_MADT_TRIGGER_CONFORMS (0)
1059#define ACPI_MADT_TRIGGER_EDGE (1<<2)
1060#define ACPI_MADT_TRIGGER_RESERVED (2<<2)
1061#define ACPI_MADT_TRIGGER_LEVEL (3<<2)
1062
1063
1064/*******************************************************************************
1065 *
1066 * MSCT - Maximum System Characteristics Table (ACPI 4.0)
1067 * Version 1
1068 *
1069 ******************************************************************************/
1070
1071typedef struct acpi_table_msct
1072{
1073 ACPI_TABLE_HEADER Header; /* Common ACPI table header */
1074 UINT32 ProximityOffset; /* Location of proximity info struct(s) */
1075 UINT32 MaxProximityDomains;/* Max number of proximity domains */
1076 UINT32 MaxClockDomains; /* Max number of clock domains */
1077 UINT64 MaxAddress; /* Max physical address in system */
1078
1079} ACPI_TABLE_MSCT;
1080
1081
1082/* Subtable - Maximum Proximity Domain Information. Version 1 */
1083
1084typedef struct acpi_msct_proximity
1085{
1086 UINT8 Revision;
1087 UINT8 Length;
1088 UINT32 RangeStart; /* Start of domain range */
1089 UINT32 RangeEnd; /* End of domain range */
1090 UINT32 ProcessorCapacity;
1091 UINT64 MemoryCapacity; /* In bytes */
1092
1093} ACPI_MSCT_PROXIMITY;
1094
1095
896f2e3a
SW
1096/*******************************************************************************
1097 *
1098 * NFIT - NVDIMM Interface Table (ACPI 6.0)
1099 * Version 1
1100 *
1101 ******************************************************************************/
1102
1103typedef struct acpi_table_nfit
1104{
1105 ACPI_TABLE_HEADER Header; /* Common ACPI table header */
1106 UINT32 Reserved; /* Reserved, must be zero */
1107
1108} ACPI_TABLE_NFIT;
1109
1110/* Subtable header for NFIT */
1111
1112typedef struct acpi_nfit_header
1113{
1114 UINT16 Type;
1115 UINT16 Length;
1116
1117} ACPI_NFIT_HEADER;
1118
1119
1120/* Values for subtable type in ACPI_NFIT_HEADER */
1121
1122enum AcpiNfitType
1123{
1124 ACPI_NFIT_TYPE_SYSTEM_ADDRESS = 0,
1125 ACPI_NFIT_TYPE_MEMORY_MAP = 1,
1126 ACPI_NFIT_TYPE_INTERLEAVE = 2,
1127 ACPI_NFIT_TYPE_SMBIOS = 3,
1128 ACPI_NFIT_TYPE_CONTROL_REGION = 4,
1129 ACPI_NFIT_TYPE_DATA_REGION = 5,
1130 ACPI_NFIT_TYPE_FLUSH_ADDRESS = 6,
1131 ACPI_NFIT_TYPE_RESERVED = 7 /* 7 and greater are reserved */
1132};
1133
1134/*
1135 * NFIT Subtables
1136 */
1137
1138/* 0: System Physical Address Range Structure */
1139
1140typedef struct acpi_nfit_system_address
1141{
1142 ACPI_NFIT_HEADER Header;
1143 UINT16 RangeIndex;
1144 UINT16 Flags;
1145 UINT32 Reserved; /* Reseved, must be zero */
1146 UINT32 ProximityDomain;
1147 UINT8 RangeGuid[16];
1148 UINT64 Address;
1149 UINT64 Length;
1150 UINT64 MemoryMapping;
1151
1152} ACPI_NFIT_SYSTEM_ADDRESS;
1153
1154/* Flags */
1155
1156#define ACPI_NFIT_ADD_ONLINE_ONLY (1) /* 00: Add/Online Operation Only */
1157#define ACPI_NFIT_PROXIMITY_VALID (1<<1) /* 01: Proximity Domain Valid */
1158
1159/* Range Type GUIDs appear in the include/acuuid.h file */
1160
1161
1162/* 1: Memory Device to System Address Range Map Structure */
1163
1164typedef struct acpi_nfit_memory_map
1165{
1166 ACPI_NFIT_HEADER Header;
1167 UINT32 DeviceHandle;
1168 UINT16 PhysicalId;
1169 UINT16 RegionId;
1170 UINT16 RangeIndex;
1171 UINT16 RegionIndex;
1172 UINT64 RegionSize;
1173 UINT64 RegionOffset;
1174 UINT64 Address;
1175 UINT16 InterleaveIndex;
1176 UINT16 InterleaveWays;
1177 UINT16 Flags;
1178 UINT16 Reserved; /* Reserved, must be zero */
1179
1180} ACPI_NFIT_MEMORY_MAP;
1181
1182/* Flags */
1183
1184#define ACPI_NFIT_MEM_SAVE_FAILED (1) /* 00: Last SAVE to Memory Device failed */
1185#define ACPI_NFIT_MEM_RESTORE_FAILED (1<<1) /* 01: Last RESTORE from Memory Device failed */
1186#define ACPI_NFIT_MEM_FLUSH_FAILED (1<<2) /* 02: Platform flush failed */
c6400d37 1187#define ACPI_NFIT_MEM_NOT_ARMED (1<<3) /* 03: Memory Device is not armed */
896f2e3a
SW
1188#define ACPI_NFIT_MEM_HEALTH_OBSERVED (1<<4) /* 04: Memory Device observed SMART/health events */
1189#define ACPI_NFIT_MEM_HEALTH_ENABLED (1<<5) /* 05: SMART/health events enabled */
1190
1191
1192/* 2: Interleave Structure */
1193
1194typedef struct acpi_nfit_interleave
1195{
1196 ACPI_NFIT_HEADER Header;
1197 UINT16 InterleaveIndex;
1198 UINT16 Reserved; /* Reserved, must be zero */
1199 UINT32 LineCount;
1200 UINT32 LineSize;
1201 UINT32 LineOffset[1]; /* Variable length */
1202
1203} ACPI_NFIT_INTERLEAVE;
1204
1205
1206/* 3: SMBIOS Management Information Structure */
1207
1208typedef struct acpi_nfit_smbios
1209{
1210 ACPI_NFIT_HEADER Header;
1211 UINT32 Reserved; /* Reserved, must be zero */
1212 UINT8 Data[1]; /* Variable length */
1213
1214} ACPI_NFIT_SMBIOS;
1215
1216
1217/* 4: NVDIMM Control Region Structure */
1218
1219typedef struct acpi_nfit_control_region
1220{
1221 ACPI_NFIT_HEADER Header;
1222 UINT16 RegionIndex;
1223 UINT16 VendorId;
1224 UINT16 DeviceId;
1225 UINT16 RevisionId;
1226 UINT16 SubsystemVendorId;
1227 UINT16 SubsystemDeviceId;
1228 UINT16 SubsystemRevisionId;
1229 UINT8 Reserved[6]; /* Reserved, must be zero */
1230 UINT32 SerialNumber;
1231 UINT16 Code;
1232 UINT16 Windows;
1233 UINT64 WindowSize;
1234 UINT64 CommandOffset;
1235 UINT64 CommandSize;
1236 UINT64 StatusOffset;
1237 UINT64 StatusSize;
1238 UINT16 Flags;
1239 UINT8 Reserved1[6]; /* Reserved, must be zero */
1240
1241} ACPI_NFIT_CONTROL_REGION;
1242
1243/* Flags */
1244
1245#define ACPI_NFIT_CONTROL_BUFFERED (1) /* Block Data Windows implementation is buffered */
1246
1247
1248/* 5: NVDIMM Block Data Window Region Structure */
1249
1250typedef struct acpi_nfit_data_region
1251{
1252 ACPI_NFIT_HEADER Header;
1253 UINT16 RegionIndex;
1254 UINT16 Windows;
1255 UINT64 Offset;
1256 UINT64 Size;
1257 UINT64 Capacity;
1258 UINT64 StartAddress;
1259
1260} ACPI_NFIT_DATA_REGION;
1261
1262
1263/* 6: Flush Hint Address Structure */
1264
1265typedef struct acpi_nfit_flush_address
1266{
1267 ACPI_NFIT_HEADER Header;
1268 UINT32 DeviceHandle;
1269 UINT16 HintCount;
1270 UINT8 Reserved[6]; /* Reserved, must be zero */
1271 UINT64 HintAddress[1]; /* Variable length */
1272
1273} ACPI_NFIT_FLUSH_ADDRESS;
1274
1275
0d02842f
SW
1276/*******************************************************************************
1277 *
1278 * SBST - Smart Battery Specification Table
1279 * Version 1
1280 *
1281 ******************************************************************************/
1282
1283typedef struct acpi_table_sbst
1284{
1285 ACPI_TABLE_HEADER Header; /* Common ACPI table header */
1286 UINT32 WarningLevel;
1287 UINT32 LowLevel;
1288 UINT32 CriticalLevel;
1289
1290} ACPI_TABLE_SBST;
1291
1292
1293/*******************************************************************************
1294 *
1295 * SLIT - System Locality Distance Information Table
1296 * Version 1
1297 *
1298 ******************************************************************************/
1299
1300typedef struct acpi_table_slit
1301{
1302 ACPI_TABLE_HEADER Header; /* Common ACPI table header */
1303 UINT64 LocalityCount;
1304 UINT8 Entry[1]; /* Real size = localities^2 */
1305
1306} ACPI_TABLE_SLIT;
1307
1308
1309/*******************************************************************************
1310 *
1311 * SRAT - System Resource Affinity Table
1312 * Version 3
1313 *
1314 ******************************************************************************/
1315
1316typedef struct acpi_table_srat
1317{
1318 ACPI_TABLE_HEADER Header; /* Common ACPI table header */
1319 UINT32 TableRevision; /* Must be value '1' */
1320 UINT64 Reserved; /* Reserved, must be zero */
1321
1322} ACPI_TABLE_SRAT;
1323
1324/* Values for subtable type in ACPI_SUBTABLE_HEADER */
1325
1326enum AcpiSratType
1327{
1328 ACPI_SRAT_TYPE_CPU_AFFINITY = 0,
1329 ACPI_SRAT_TYPE_MEMORY_AFFINITY = 1,
1330 ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY = 2,
79eafdd7
SW
1331 ACPI_SRAT_TYPE_GICC_AFFINITY = 3,
1332 ACPI_SRAT_TYPE_RESERVED = 4 /* 4 and greater are reserved */
0d02842f
SW
1333};
1334
1335/*
9e1c0880 1336 * SRAT Subtables, correspond to Type in ACPI_SUBTABLE_HEADER
0d02842f
SW
1337 */
1338
1339/* 0: Processor Local APIC/SAPIC Affinity */
1340
1341typedef struct acpi_srat_cpu_affinity
1342{
1343 ACPI_SUBTABLE_HEADER Header;
1344 UINT8 ProximityDomainLo;
1345 UINT8 ApicId;
1346 UINT32 Flags;
1347 UINT8 LocalSapicEid;
1348 UINT8 ProximityDomainHi[3];
79eafdd7 1349 UINT32 ClockDomain;
0d02842f
SW
1350
1351} ACPI_SRAT_CPU_AFFINITY;
1352
1353/* Flags */
1354
1355#define ACPI_SRAT_CPU_USE_AFFINITY (1) /* 00: Use affinity structure */
1356
1357
1358/* 1: Memory Affinity */
1359
1360typedef struct acpi_srat_mem_affinity
1361{
1362 ACPI_SUBTABLE_HEADER Header;
1363 UINT32 ProximityDomain;
1364 UINT16 Reserved; /* Reserved, must be zero */
1365 UINT64 BaseAddress;
1366 UINT64 Length;
1367 UINT32 Reserved1;
1368 UINT32 Flags;
1369 UINT64 Reserved2; /* Reserved, must be zero */
1370
1371} ACPI_SRAT_MEM_AFFINITY;
1372
1373/* Flags */
1374
1375#define ACPI_SRAT_MEM_ENABLED (1) /* 00: Use affinity structure */
1376#define ACPI_SRAT_MEM_HOT_PLUGGABLE (1<<1) /* 01: Memory region is hot pluggable */
1377#define ACPI_SRAT_MEM_NON_VOLATILE (1<<2) /* 02: Memory region is non-volatile */
1378
1379
1380/* 2: Processor Local X2_APIC Affinity (ACPI 4.0) */
1381
1382typedef struct acpi_srat_x2apic_cpu_affinity
1383{
1384 ACPI_SUBTABLE_HEADER Header;
1385 UINT16 Reserved; /* Reserved, must be zero */
1386 UINT32 ProximityDomain;
1387 UINT32 ApicId;
1388 UINT32 Flags;
1389 UINT32 ClockDomain;
1390 UINT32 Reserved2;
1391
1392} ACPI_SRAT_X2APIC_CPU_AFFINITY;
1393
1394/* Flags for ACPI_SRAT_CPU_AFFINITY and ACPI_SRAT_X2APIC_CPU_AFFINITY */
1395
1396#define ACPI_SRAT_CPU_ENABLED (1) /* 00: Use affinity structure */
1397
1398
79eafdd7
SW
1399/* 3: GICC Affinity (ACPI 5.1) */
1400
1401typedef struct acpi_srat_gicc_affinity
1402{
1403 ACPI_SUBTABLE_HEADER Header;
1404 UINT32 ProximityDomain;
1405 UINT32 AcpiProcessorUid;
1406 UINT32 Flags;
1407 UINT32 ClockDomain;
1408
1409} ACPI_SRAT_GICC_AFFINITY;
1410
1411/* Flags for ACPI_SRAT_GICC_AFFINITY */
1412
1413#define ACPI_SRAT_GICC_ENABLED (1) /* 00: Use affinity structure */
1414
896f2e3a 1415
d4972a9c
SW
1416/* Reset to default packing */
1417
1418#pragma pack()
0d02842f
SW
1419
1420#endif /* __ACTBL1_H__ */