actbl1.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797
  1. /******************************************************************************
  2. *
  3. * Name: actbl1.h - Additional ACPI table definitions
  4. *
  5. *****************************************************************************/
  6. /*
  7. * Copyright (C) 2000 - 2008, Intel Corp.
  8. * All rights reserved.
  9. *
  10. * Redistribution and use in source and binary forms, with or without
  11. * modification, are permitted provided that the following conditions
  12. * are met:
  13. * 1. Redistributions of source code must retain the above copyright
  14. * notice, this list of conditions, and the following disclaimer,
  15. * without modification.
  16. * 2. Redistributions in binary form must reproduce at minimum a disclaimer
  17. * substantially similar to the "NO WARRANTY" disclaimer below
  18. * ("Disclaimer") and any redistribution must be conditioned upon
  19. * including a substantially similar Disclaimer requirement for further
  20. * binary redistribution.
  21. * 3. Neither the names of the above-listed copyright holders nor the names
  22. * of any contributors may be used to endorse or promote products derived
  23. * from this software without specific prior written permission.
  24. *
  25. * Alternatively, this software may be distributed under the terms of the
  26. * GNU General Public License ("GPL") version 2 as published by the Free
  27. * Software Foundation.
  28. *
  29. * NO WARRANTY
  30. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  31. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  32. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
  33. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  34. * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  35. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  36. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  37. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  38. * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
  39. * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  40. * POSSIBILITY OF SUCH DAMAGES.
  41. */
  42. #ifndef __ACTBL1_H__
  43. #define __ACTBL1_H__
  44. /*******************************************************************************
  45. *
  46. * Additional ACPI Tables (1)
  47. *
  48. * These tables are not consumed directly by the ACPICA subsystem, but are
  49. * included here to support device drivers and the AML disassembler.
  50. *
  51. * The tables in this file are fully defined within the ACPI specification.
  52. *
  53. ******************************************************************************/
  54. /*
  55. * Values for description table header signatures. Useful because they make
  56. * it more difficult to inadvertently type in the wrong signature.
  57. */
  58. #define ACPI_SIG_BERT "BERT" /* Boot Error Record Table */
  59. #define ACPI_SIG_CPEP "CPEP" /* Corrected Platform Error Polling table */
  60. #define ACPI_SIG_ECDT "ECDT" /* Embedded Controller Boot Resources Table */
  61. #define ACPI_SIG_EINJ "EINJ" /* Error Injection table */
  62. #define ACPI_SIG_ERST "ERST" /* Error Record Serialization Table */
  63. #define ACPI_SIG_HEST "HEST" /* Hardware Error Source Table */
  64. #define ACPI_SIG_MADT "APIC" /* Multiple APIC Description Table */
  65. #define ACPI_SIG_SBST "SBST" /* Smart Battery Specification Table */
  66. #define ACPI_SIG_SLIT "SLIT" /* System Locality Distance Information Table */
  67. #define ACPI_SIG_SRAT "SRAT" /* System Resource Affinity Table */
  68. /*
  69. * All tables must be byte-packed to match the ACPI specification, since
  70. * the tables are provided by the system BIOS.
  71. */
  72. #pragma pack(1)
  73. /*
  74. * Note about bitfields: The u8 type is used for bitfields in ACPI tables.
  75. * This is the only type that is even remotely portable. Anything else is not
  76. * portable, so do not use any other bitfield types.
  77. */
  78. /* Common Subtable header (used in MADT, SRAT, etc.) */
  79. struct acpi_subtable_header {
  80. u8 type;
  81. u8 length;
  82. };
  83. /* Common Subtable header for WHEA tables (EINJ, ERST, WDAT) */
  84. struct acpi_whea_header {
  85. u8 action;
  86. u8 instruction;
  87. u8 flags;
  88. u8 reserved;
  89. struct acpi_generic_address register_region;
  90. u64 value; /* Value used with Read/Write register */
  91. u64 mask; /* Bitmask required for this register instruction */
  92. };
  93. /*******************************************************************************
  94. *
  95. * BERT - Boot Error Record Table
  96. *
  97. ******************************************************************************/
  98. struct acpi_table_bert {
  99. struct acpi_table_header header; /* Common ACPI table header */
  100. u32 region_length; /* Length of the boot error region */
  101. u64 address; /* Physical addresss of the error region */
  102. };
  103. /* Boot Error Region */
  104. struct acpi_bert_region {
  105. u32 block_status;
  106. u32 raw_data_offset;
  107. u32 raw_data_length;
  108. u32 data_length;
  109. u32 error_severity;
  110. };
  111. /* block_status Flags */
  112. #define ACPI_BERT_UNCORRECTABLE (1)
  113. #define ACPI_BERT_CORRECTABLE (2)
  114. #define ACPI_BERT_MULTIPLE_UNCORRECTABLE (4)
  115. #define ACPI_BERT_MULTIPLE_CORRECTABLE (8)
  116. /*******************************************************************************
  117. *
  118. * CPEP - Corrected Platform Error Polling table
  119. *
  120. ******************************************************************************/
  121. struct acpi_table_cpep {
  122. struct acpi_table_header header; /* Common ACPI table header */
  123. u64 reserved;
  124. };
  125. /* Subtable */
  126. struct acpi_cpep_polling {
  127. u8 type;
  128. u8 length;
  129. u8 id; /* Processor ID */
  130. u8 eid; /* Processor EID */
  131. u32 interval; /* Polling interval (msec) */
  132. };
  133. /*******************************************************************************
  134. *
  135. * ECDT - Embedded Controller Boot Resources Table
  136. *
  137. ******************************************************************************/
  138. struct acpi_table_ecdt {
  139. struct acpi_table_header header; /* Common ACPI table header */
  140. struct acpi_generic_address control; /* Address of EC command/status register */
  141. struct acpi_generic_address data; /* Address of EC data register */
  142. u32 uid; /* Unique ID - must be same as the EC _UID method */
  143. u8 gpe; /* The GPE for the EC */
  144. u8 id[1]; /* Full namepath of the EC in the ACPI namespace */
  145. };
  146. /*******************************************************************************
  147. *
  148. * EINJ - Error Injection Table
  149. *
  150. ******************************************************************************/
  151. struct acpi_table_einj {
  152. struct acpi_table_header header; /* Common ACPI table header */
  153. u32 header_length;
  154. u32 reserved;
  155. u32 entries;
  156. };
  157. /* EINJ Injection Instruction Entries (actions) */
  158. struct acpi_einj_entry {
  159. struct acpi_whea_header whea_header; /* Common header for WHEA tables */
  160. };
  161. /* Values for Action field above */
  162. enum acpi_einj_actions {
  163. ACPI_EINJ_BEGIN_OPERATION = 0,
  164. ACPI_EINJ_GET_TRIGGER_TABLE = 1,
  165. ACPI_EINJ_SET_ERROR_TYPE = 2,
  166. ACPI_EINJ_GET_ERROR_TYPE = 3,
  167. ACPI_EINJ_END_OPERATION = 4,
  168. ACPI_EINJ_EXECUTE_OPERATION = 5,
  169. ACPI_EINJ_CHECK_BUSY_STATUS = 6,
  170. ACPI_EINJ_GET_COMMAND_STATUS = 7,
  171. ACPI_EINJ_ACTION_RESERVED = 8, /* 8 and greater are reserved */
  172. ACPI_EINJ_TRIGGER_ERROR = 0xFF /* Except for this value */
  173. };
  174. /* Values for Instruction field above */
  175. enum acpi_einj_instructions {
  176. ACPI_EINJ_READ_REGISTER = 0,
  177. ACPI_EINJ_READ_REGISTER_VALUE = 1,
  178. ACPI_EINJ_WRITE_REGISTER = 2,
  179. ACPI_EINJ_WRITE_REGISTER_VALUE = 3,
  180. ACPI_EINJ_NOOP = 4,
  181. ACPI_EINJ_INSTRUCTION_RESERVED = 5 /* 5 and greater are reserved */
  182. };
  183. /* EINJ Trigger Error Action Table */
  184. struct acpi_einj_trigger {
  185. u32 header_size;
  186. u32 revision;
  187. u32 table_size;
  188. u32 entry_count;
  189. };
  190. /*******************************************************************************
  191. *
  192. * ERST - Error Record Serialization Table
  193. *
  194. ******************************************************************************/
  195. struct acpi_table_erst {
  196. struct acpi_table_header header; /* Common ACPI table header */
  197. u32 header_length;
  198. u32 reserved;
  199. u32 entries;
  200. };
  201. /* ERST Serialization Entries (actions) */
  202. struct acpi_erst_entry {
  203. struct acpi_whea_header whea_header; /* Common header for WHEA tables */
  204. };
  205. /* Values for Action field above */
  206. enum acpi_erst_actions {
  207. ACPI_ERST_BEGIN_WRITE_OPERATION = 0,
  208. ACPI_ERST_BEGIN_READ_OPERATION = 1,
  209. ACPI_ERST_BETGIN_CLEAR_OPERATION = 2,
  210. ACPI_ERST_END_OPERATION = 3,
  211. ACPI_ERST_SET_RECORD_OFFSET = 4,
  212. ACPI_ERST_EXECUTE_OPERATION = 5,
  213. ACPI_ERST_CHECK_BUSY_STATUS = 6,
  214. ACPI_ERST_GET_COMMAND_STATUS = 7,
  215. ACPI_ERST_GET_RECORD_IDENTIFIER = 8,
  216. ACPI_ERST_SET_RECORD_IDENTIFIER = 9,
  217. ACPI_ERST_GET_RECORD_COUNT = 10,
  218. ACPI_ERST_BEGIN_DUMMY_WRIITE = 11,
  219. ACPI_ERST_NOT_USED = 12,
  220. ACPI_ERST_GET_ERROR_RANGE = 13,
  221. ACPI_ERST_GET_ERROR_LENGTH = 14,
  222. ACPI_ERST_GET_ERROR_ATTRIBUTES = 15,
  223. ACPI_ERST_ACTION_RESERVED = 16 /* 16 and greater are reserved */
  224. };
  225. /* Values for Instruction field above */
  226. enum acpi_erst_instructions {
  227. ACPI_ERST_READ_REGISTER = 0,
  228. ACPI_ERST_READ_REGISTER_VALUE = 1,
  229. ACPI_ERST_WRITE_REGISTER = 2,
  230. ACPI_ERST_WRITE_REGISTER_VALUE = 3,
  231. ACPI_ERST_NOOP = 4,
  232. ACPI_ERST_LOAD_VAR1 = 5,
  233. ACPI_ERST_LOAD_VAR2 = 6,
  234. ACPI_ERST_STORE_VAR1 = 7,
  235. ACPI_ERST_ADD = 8,
  236. ACPI_ERST_SUBTRACT = 9,
  237. ACPI_ERST_ADD_VALUE = 10,
  238. ACPI_ERST_SUBTRACT_VALUE = 11,
  239. ACPI_ERST_STALL = 12,
  240. ACPI_ERST_STALL_WHILE_TRUE = 13,
  241. ACPI_ERST_SKIP_NEXT_IF_TRUE = 14,
  242. ACPI_ERST_GOTO = 15,
  243. ACPI_ERST_SET_SRC_ADDRESS_BASE = 16,
  244. ACPI_ERST_SET_DST_ADDRESS_BASE = 17,
  245. ACPI_ERST_MOVE_DATA = 18,
  246. ACPI_ERST_INSTRUCTION_RESERVED = 19 /* 19 and greater are reserved */
  247. };
  248. /*******************************************************************************
  249. *
  250. * HEST - Hardware Error Source Table
  251. *
  252. ******************************************************************************/
  253. struct acpi_table_hest {
  254. struct acpi_table_header header; /* Common ACPI table header */
  255. u32 error_source_count;
  256. };
  257. /* HEST subtable header */
  258. struct acpi_hest_header {
  259. u16 type;
  260. };
  261. /* Values for Type field above for subtables */
  262. enum acpi_hest_types {
  263. ACPI_HEST_TYPE_XPF_MACHINE_CHECK = 0,
  264. ACPI_HEST_TYPE_XPF_CORRECTED_MACHINE_CHECK = 1,
  265. ACPI_HEST_TYPE_XPF_UNUSED = 2,
  266. ACPI_HEST_TYPE_XPF_NON_MASKABLE_INTERRUPT = 3,
  267. ACPI_HEST_TYPE_IPF_CORRECTED_MACHINE_CHECK = 4,
  268. ACPI_HEST_TYPE_IPF_CORRECTED_PLATFORM_ERROR = 5,
  269. ACPI_HEST_TYPE_AER_ROOT_PORT = 6,
  270. ACPI_HEST_TYPE_AER_ENDPOINT = 7,
  271. ACPI_HEST_TYPE_AER_BRIDGE = 8,
  272. ACPI_HEST_TYPE_GENERIC_HARDWARE_ERROR_SOURCE = 9,
  273. ACPI_HEST_TYPE_RESERVED = 10 /* 10 and greater are reserved */
  274. };
  275. /*
  276. * HEST Sub-subtables
  277. */
  278. /* XPF Machine Check Error Bank */
  279. struct acpi_hest_xpf_error_bank {
  280. u8 bank_number;
  281. u8 clear_status_on_init;
  282. u8 status_format;
  283. u8 config_write_enable;
  284. u32 control_register;
  285. u64 control_init_data;
  286. u32 status_register;
  287. u32 address_register;
  288. u32 misc_register;
  289. };
  290. /* Generic Error Status */
  291. struct acpi_hest_generic_status {
  292. u32 block_status;
  293. u32 raw_data_offset;
  294. u32 raw_data_length;
  295. u32 data_length;
  296. u32 error_severity;
  297. };
  298. /* Generic Error Data */
  299. struct acpi_hest_generic_data {
  300. u8 section_type[16];
  301. u32 error_severity;
  302. u16 revision;
  303. u8 validation_bits;
  304. u8 flags;
  305. u32 error_data_length;
  306. u8 fru_id[16];
  307. u8 fru_text[20];
  308. };
  309. /* Common HEST structure for PCI/AER types below (6,7,8) */
  310. struct acpi_hest_aer_common {
  311. u16 source_id;
  312. u16 config_write_enable;
  313. u8 flags;
  314. u8 enabled;
  315. u32 records_to_pre_allocate;
  316. u32 max_sections_per_record;
  317. u32 bus;
  318. u16 device;
  319. u16 function;
  320. u16 device_control;
  321. u16 reserved;
  322. u32 uncorrectable_error_mask;
  323. u32 uncorrectable_error_severity;
  324. u32 correctable_error_mask;
  325. u32 advanced_error_capabilities;
  326. };
  327. /* Hardware Error Notification */
  328. struct acpi_hest_notify {
  329. u8 type;
  330. u8 length;
  331. u16 config_write_enable;
  332. u32 poll_interval;
  333. u32 vector;
  334. u32 polling_threshold_value;
  335. u32 polling_threshold_window;
  336. u32 error_threshold_value;
  337. u32 error_threshold_window;
  338. };
  339. /* Values for Notify Type field above */
  340. enum acpi_hest_notify_types {
  341. ACPI_HEST_NOTIFY_POLLED = 0,
  342. ACPI_HEST_NOTIFY_EXTERNAL = 1,
  343. ACPI_HEST_NOTIFY_LOCAL = 2,
  344. ACPI_HEST_NOTIFY_SCI = 3,
  345. ACPI_HEST_NOTIFY_NMI = 4,
  346. ACPI_HEST_NOTIFY_RESERVED = 5 /* 5 and greater are reserved */
  347. };
  348. /*
  349. * HEST subtables
  350. *
  351. * From WHEA Design Document, 16 May 2007.
  352. * Note: There is no subtable type 2 in this version of the document,
  353. * and there are two different subtable type 3s.
  354. */
  355. /* 0: XPF Machine Check Exception */
  356. struct acpi_hest_xpf_machine_check {
  357. struct acpi_hest_header header;
  358. u16 source_id;
  359. u16 config_write_enable;
  360. u8 flags;
  361. u8 reserved1;
  362. u32 records_to_pre_allocate;
  363. u32 max_sections_per_record;
  364. u64 global_capability_data;
  365. u64 global_control_data;
  366. u8 num_hardware_banks;
  367. u8 reserved2[7];
  368. };
  369. /* 1: XPF Corrected Machine Check */
  370. struct acpi_table_hest_xpf_corrected {
  371. struct acpi_hest_header header;
  372. u16 source_id;
  373. u16 config_write_enable;
  374. u8 flags;
  375. u8 enabled;
  376. u32 records_to_pre_allocate;
  377. u32 max_sections_per_record;
  378. struct acpi_hest_notify notify;
  379. u8 num_hardware_banks;
  380. u8 reserved[3];
  381. };
  382. /* 3: XPF Non-Maskable Interrupt */
  383. struct acpi_hest_xpf_nmi {
  384. struct acpi_hest_header header;
  385. u16 source_id;
  386. u32 reserved;
  387. u32 records_to_pre_allocate;
  388. u32 max_sections_per_record;
  389. u32 max_raw_data_length;
  390. };
  391. /* 4: IPF Corrected Machine Check */
  392. struct acpi_hest_ipf_corrected {
  393. struct acpi_hest_header header;
  394. u8 enabled;
  395. u8 reserved;
  396. };
  397. /* 5: IPF Corrected Platform Error */
  398. struct acpi_hest_ipf_corrected_platform {
  399. struct acpi_hest_header header;
  400. u8 enabled;
  401. u8 reserved;
  402. };
  403. /* 6: PCI Express Root Port AER */
  404. struct acpi_hest_aer_root {
  405. struct acpi_hest_header header;
  406. struct acpi_hest_aer_common aer;
  407. u32 root_error_command;
  408. };
  409. /* 7: PCI Express AER (AER Endpoint) */
  410. struct acpi_hest_aer {
  411. struct acpi_hest_header header;
  412. struct acpi_hest_aer_common aer;
  413. };
  414. /* 8: PCI Express/PCI-X Bridge AER */
  415. struct acpi_hest_aer_bridge {
  416. struct acpi_hest_header header;
  417. struct acpi_hest_aer_common aer;
  418. u32 secondary_uncorrectable_error_mask;
  419. u32 secondary_uncorrectable_error_severity;
  420. u32 secondary_advanced_capabilities;
  421. };
  422. /* 9: Generic Hardware Error Source */
  423. struct acpi_hest_generic {
  424. struct acpi_hest_header header;
  425. u16 source_id;
  426. u16 related_source_id;
  427. u8 config_write_enable;
  428. u8 enabled;
  429. u32 records_to_pre_allocate;
  430. u32 max_sections_per_record;
  431. u32 max_raw_data_length;
  432. struct acpi_generic_address error_status_address;
  433. struct acpi_hest_notify notify;
  434. u32 error_status_block_length;
  435. };
  436. /*******************************************************************************
  437. *
  438. * MADT - Multiple APIC Description Table
  439. *
  440. ******************************************************************************/
  441. struct acpi_table_madt {
  442. struct acpi_table_header header; /* Common ACPI table header */
  443. u32 address; /* Physical address of local APIC */
  444. u32 flags;
  445. };
  446. /* Flags */
  447. #define ACPI_MADT_PCAT_COMPAT (1) /* 00: System also has dual 8259s */
  448. /* Values for PCATCompat flag */
  449. #define ACPI_MADT_DUAL_PIC 0
  450. #define ACPI_MADT_MULTIPLE_APIC 1
  451. /* Values for subtable type in struct acpi_subtable_header */
  452. enum acpi_madt_type {
  453. ACPI_MADT_TYPE_LOCAL_APIC = 0,
  454. ACPI_MADT_TYPE_IO_APIC = 1,
  455. ACPI_MADT_TYPE_INTERRUPT_OVERRIDE = 2,
  456. ACPI_MADT_TYPE_NMI_SOURCE = 3,
  457. ACPI_MADT_TYPE_LOCAL_APIC_NMI = 4,
  458. ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE = 5,
  459. ACPI_MADT_TYPE_IO_SAPIC = 6,
  460. ACPI_MADT_TYPE_LOCAL_SAPIC = 7,
  461. ACPI_MADT_TYPE_INTERRUPT_SOURCE = 8,
  462. ACPI_MADT_TYPE_LOCAL_X2APIC = 9,
  463. ACPI_MADT_TYPE_LOCAL_X2APIC_NMI = 10,
  464. ACPI_MADT_TYPE_RESERVED = 11 /* 11 and greater are reserved */
  465. };
  466. /*
  467. * MADT Sub-tables, correspond to Type in struct acpi_subtable_header
  468. */
  469. /* 0: Processor Local APIC */
  470. struct acpi_madt_local_apic {
  471. struct acpi_subtable_header header;
  472. u8 processor_id; /* ACPI processor id */
  473. u8 id; /* Processor's local APIC id */
  474. u32 lapic_flags;
  475. };
  476. /* 1: IO APIC */
  477. struct acpi_madt_io_apic {
  478. struct acpi_subtable_header header;
  479. u8 id; /* I/O APIC ID */
  480. u8 reserved; /* Reserved - must be zero */
  481. u32 address; /* APIC physical address */
  482. u32 global_irq_base; /* Global system interrupt where INTI lines start */
  483. };
  484. /* 2: Interrupt Override */
  485. struct acpi_madt_interrupt_override {
  486. struct acpi_subtable_header header;
  487. u8 bus; /* 0 - ISA */
  488. u8 source_irq; /* Interrupt source (IRQ) */
  489. u32 global_irq; /* Global system interrupt */
  490. u16 inti_flags;
  491. };
  492. /* 3: NMI Source */
  493. struct acpi_madt_nmi_source {
  494. struct acpi_subtable_header header;
  495. u16 inti_flags;
  496. u32 global_irq; /* Global system interrupt */
  497. };
  498. /* 4: Local APIC NMI */
  499. struct acpi_madt_local_apic_nmi {
  500. struct acpi_subtable_header header;
  501. u8 processor_id; /* ACPI processor id */
  502. u16 inti_flags;
  503. u8 lint; /* LINTn to which NMI is connected */
  504. };
  505. /* 5: Address Override */
  506. struct acpi_madt_local_apic_override {
  507. struct acpi_subtable_header header;
  508. u16 reserved; /* Reserved, must be zero */
  509. u64 address; /* APIC physical address */
  510. };
  511. /* 6: I/O Sapic */
  512. struct acpi_madt_io_sapic {
  513. struct acpi_subtable_header header;
  514. u8 id; /* I/O SAPIC ID */
  515. u8 reserved; /* Reserved, must be zero */
  516. u32 global_irq_base; /* Global interrupt for SAPIC start */
  517. u64 address; /* SAPIC physical address */
  518. };
  519. /* 7: Local Sapic */
  520. struct acpi_madt_local_sapic {
  521. struct acpi_subtable_header header;
  522. u8 processor_id; /* ACPI processor id */
  523. u8 id; /* SAPIC ID */
  524. u8 eid; /* SAPIC EID */
  525. u8 reserved[3]; /* Reserved, must be zero */
  526. u32 lapic_flags;
  527. u32 uid; /* Numeric UID - ACPI 3.0 */
  528. char uid_string[1]; /* String UID - ACPI 3.0 */
  529. };
  530. /* 8: Platform Interrupt Source */
  531. struct acpi_madt_interrupt_source {
  532. struct acpi_subtable_header header;
  533. u16 inti_flags;
  534. u8 type; /* 1=PMI, 2=INIT, 3=corrected */
  535. u8 id; /* Processor ID */
  536. u8 eid; /* Processor EID */
  537. u8 io_sapic_vector; /* Vector value for PMI interrupts */
  538. u32 global_irq; /* Global system interrupt */
  539. u32 flags; /* Interrupt Source Flags */
  540. };
  541. /* Flags field above */
  542. #define ACPI_MADT_CPEI_OVERRIDE (1)
  543. /* 9: Processor Local X2APIC (ACPI 4.0) */
  544. struct acpi_madt_local_x2apic {
  545. struct acpi_subtable_header header;
  546. u16 reserved; /* Reserved - must be zero */
  547. u32 local_apic_id; /* Processor x2APIC ID */
  548. u32 lapic_flags;
  549. u32 uid; /* ACPI processor UID */
  550. };
  551. /* 10: Local X2APIC NMI (ACPI 4.0) */
  552. struct acpi_madt_local_x2apic_nmi {
  553. struct acpi_subtable_header header;
  554. u16 inti_flags;
  555. u32 uid; /* ACPI processor UID */
  556. u8 lint; /* LINTn to which NMI is connected */
  557. u8 reserved[3];
  558. };
  559. /*
  560. * Common flags fields for MADT subtables
  561. */
  562. /* MADT Local APIC flags (lapic_flags) */
  563. #define ACPI_MADT_ENABLED (1) /* 00: Processor is usable if set */
  564. /* MADT MPS INTI flags (inti_flags) */
  565. #define ACPI_MADT_POLARITY_MASK (3) /* 00-01: Polarity of APIC I/O input signals */
  566. #define ACPI_MADT_TRIGGER_MASK (3<<2) /* 02-03: Trigger mode of APIC input signals */
  567. /* Values for MPS INTI flags */
  568. #define ACPI_MADT_POLARITY_CONFORMS 0
  569. #define ACPI_MADT_POLARITY_ACTIVE_HIGH 1
  570. #define ACPI_MADT_POLARITY_RESERVED 2
  571. #define ACPI_MADT_POLARITY_ACTIVE_LOW 3
  572. #define ACPI_MADT_TRIGGER_CONFORMS (0)
  573. #define ACPI_MADT_TRIGGER_EDGE (1<<2)
  574. #define ACPI_MADT_TRIGGER_RESERVED (2<<2)
  575. #define ACPI_MADT_TRIGGER_LEVEL (3<<2)
  576. /*******************************************************************************
  577. *
  578. * SBST - Smart Battery Specification Table
  579. *
  580. ******************************************************************************/
  581. struct acpi_table_sbst {
  582. struct acpi_table_header header; /* Common ACPI table header */
  583. u32 warning_level;
  584. u32 low_level;
  585. u32 critical_level;
  586. };
  587. /*******************************************************************************
  588. *
  589. * SLIT - System Locality Distance Information Table
  590. *
  591. ******************************************************************************/
  592. struct acpi_table_slit {
  593. struct acpi_table_header header; /* Common ACPI table header */
  594. u64 locality_count;
  595. u8 entry[1]; /* Real size = localities^2 */
  596. };
  597. /*******************************************************************************
  598. *
  599. * SRAT - System Resource Affinity Table
  600. *
  601. ******************************************************************************/
  602. struct acpi_table_srat {
  603. struct acpi_table_header header; /* Common ACPI table header */
  604. u32 table_revision; /* Must be value '1' */
  605. u64 reserved; /* Reserved, must be zero */
  606. };
  607. /* Values for subtable type in struct acpi_subtable_header */
  608. enum acpi_srat_type {
  609. ACPI_SRAT_TYPE_CPU_AFFINITY = 0,
  610. ACPI_SRAT_TYPE_MEMORY_AFFINITY = 1,
  611. ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY = 2,
  612. ACPI_SRAT_TYPE_RESERVED = 3 /* 3 and greater are reserved */
  613. };
  614. /*
  615. * SRAT Sub-tables, correspond to Type in struct acpi_subtable_header
  616. */
  617. /* 0: Processor Local APIC/SAPIC Affinity */
  618. struct acpi_srat_cpu_affinity {
  619. struct acpi_subtable_header header;
  620. u8 proximity_domain_lo;
  621. u8 apic_id;
  622. u32 flags;
  623. u8 local_sapic_eid;
  624. u8 proximity_domain_hi[3];
  625. u32 reserved; /* Reserved, must be zero */
  626. };
  627. /* 1: Memory Affinity */
  628. struct acpi_srat_mem_affinity {
  629. struct acpi_subtable_header header;
  630. u32 proximity_domain;
  631. u16 reserved; /* Reserved, must be zero */
  632. u64 base_address;
  633. u64 length;
  634. u32 reserved1;
  635. u32 flags;
  636. u64 reserved2; /* Reserved, must be zero */
  637. };
  638. /* Flags */
  639. #define ACPI_SRAT_MEM_ENABLED (1) /* 00: Use affinity structure */
  640. #define ACPI_SRAT_MEM_HOT_PLUGGABLE (1<<1) /* 01: Memory region is hot pluggable */
  641. #define ACPI_SRAT_MEM_NON_VOLATILE (1<<2) /* 02: Memory region is non-volatile */
  642. /* 2: Processor Local X2_APIC Affinity (ACPI 4.0) */
  643. struct acpi_srat_x2apic_cpu_affinity {
  644. struct acpi_subtable_header header;
  645. u16 reserved; /* Reserved, must be zero */
  646. u32 proximity_domain;
  647. u32 apic_id;
  648. u32 flags;
  649. u32 clock_domain;
  650. u32 reserved2;
  651. };
  652. /* Flags for struct acpi_srat_cpu_affinity and struct acpi_srat_x2apic_cpu_affinity */
  653. #define ACPI_SRAT_CPU_ENABLED (1) /* 00: Use affinity structure */
  654. /* Reset to default packing */
  655. #pragma pack()
  656. #endif /* __ACTBL1_H__ */