From 1fa31688a0e237dec1170dcea9e8f0a0571a25e5 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Wed, 15 Apr 2026 08:55:03 +0200 Subject: acpi: add basic MADT tests --- libs/acpi/test_data/basic_madt.asl | 29 +++++++++++++++++++++++++++++ libs/acpi/test_data/basic_rsdt.asl | 26 ++++++++++++++++++++++++++ libs/acpi/test_data/tables.S | 14 ++++++++++++++ libs/acpi/test_data/tables.hpp | 25 +++++++++++++++++++++++++ 4 files changed, 94 insertions(+) create mode 100644 libs/acpi/test_data/basic_madt.asl create mode 100644 libs/acpi/test_data/basic_rsdt.asl create mode 100644 libs/acpi/test_data/tables.S create mode 100644 libs/acpi/test_data/tables.hpp (limited to 'libs/acpi/test_data') diff --git a/libs/acpi/test_data/basic_madt.asl b/libs/acpi/test_data/basic_madt.asl new file mode 100644 index 0000000..cd6958a --- /dev/null +++ b/libs/acpi/test_data/basic_madt.asl @@ -0,0 +1,29 @@ +/* + * Intel ACPI Component Architecture + * iASL Compiler/Disassembler version 20251212 (64-bit version) + * Copyright (c) 2000 - 2025 Intel Corporation + * + * Template for [APIC] ACPI Table (static data table) + * Format: [ByteLength] FieldName : HexFieldValue + */ +[0004] Signature : "APIC" [Multiple APIC Description Table (MADT)] +[0004] Table Length : 00000000 +[0001] Revision : 07 +[0001] Checksum : 00 +[0006] Oem ID : "INTEL " +[0008] Oem Table ID : "Template" +[0004] Oem Revision : 00000001 +[0004] Asl Compiler ID : "INTL" +[0004] Asl Compiler Revision : 20230628 + +[0004] Local Apic Address : FEE00000 +[0004] Flags (decoded below) : 00000001 + PC-AT Compatibility : 1 + +[0001] Subtable Type : 00 [Processor Local APIC] +[0001] Length : 08 +[0001] Processor ID : 00 +[0001] Local Apic ID : 00 +[0004] Flags (decoded below) : 00000001 + Processor Enabled : 1 + Runtime Online Capable : 0 diff --git a/libs/acpi/test_data/basic_rsdt.asl b/libs/acpi/test_data/basic_rsdt.asl new file mode 100644 index 0000000..6cf4c7a --- /dev/null +++ b/libs/acpi/test_data/basic_rsdt.asl @@ -0,0 +1,26 @@ +/* + * Intel ACPI Component Architecture + * iASL Compiler/Disassembler version 20251212 (64-bit version) + * Copyright (c) 2000 - 2025 Intel Corporation + * + * Template for [RSDT] ACPI Table (static data table) + * Format: [ByteLength] FieldName : HexFieldValue + */ +[0004] Signature : "RSDT" [Root System Description Table] +[0004] Table Length : 00000000 +[0001] Revision : 01 +[0001] Checksum : 00 +[0006] Oem ID : "INTEL " +[0008] Oem Table ID : "TEMPLATE" +[0004] Oem Revision : 00000001 +[0004] Asl Compiler ID : "INTL" +[0004] Asl Compiler Revision : 20100528 + +[0004] ACPI Table Address 0 : 00000010 +[0004] ACPI Table Address 1 : 00000020 +[0004] ACPI Table Address 2 : 00000030 +[0004] ACPI Table Address 3 : 00000040 +[0004] ACPI Table Address 4 : 00000050 +[0004] ACPI Table Address 5 : 00000060 +[0004] ACPI Table Address 6 : 00000070 +[0004] ACPI Table Address 7 : 00000080 diff --git a/libs/acpi/test_data/tables.S b/libs/acpi/test_data/tables.S new file mode 100644 index 0000000..af58109 --- /dev/null +++ b/libs/acpi/test_data/tables.S @@ -0,0 +1,14 @@ +.section .rodata + +.balign 16 + +#define TABLE(name, file) \ + .global name##_start; \ + .global name##_end; \ + name##_start: .incbin file; \ + name##_end: + +TABLE(basic_madt, "basic_madt.aml") +TABLE(basic_rsdt, "basic_rsdt.aml") + +#undef TABLE diff --git a/libs/acpi/test_data/tables.hpp b/libs/acpi/test_data/tables.hpp new file mode 100644 index 0000000..2b3874f --- /dev/null +++ b/libs/acpi/test_data/tables.hpp @@ -0,0 +1,25 @@ +#ifndef ACPI_TEST_DATA_TABLES_HPP +#define ACPI_TEST_DATA_TABLES_HPP + +#include +#include + +#define TABLE(name) \ + extern "C" std::byte const name##_start; \ + extern "C" std::byte const name##_end; \ + auto inline name()->std::span \ + { \ + return {&name##_start, &name##_end}; \ + } + +namespace acpi::test_data::tables +{ + + TABLE(basic_madt); + TABLE(basic_rsdt); + +} // namespace acpi::test_data::tables + +#undef TABLE + +#endif -- cgit v1.2.3 From 1113e812359a66591b0854a9f723ab8cd8b09274 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Wed, 15 Apr 2026 09:04:35 +0200 Subject: acpi: add rsdp test data --- libs/acpi/test_data/basic_rsdp.asl | 16 ++++++++++++++++ libs/acpi/test_data/tables.S | 1 + libs/acpi/test_data/tables.hpp | 1 + 3 files changed, 18 insertions(+) create mode 100644 libs/acpi/test_data/basic_rsdp.asl (limited to 'libs/acpi/test_data') diff --git a/libs/acpi/test_data/basic_rsdp.asl b/libs/acpi/test_data/basic_rsdp.asl new file mode 100644 index 0000000..8274c0f --- /dev/null +++ b/libs/acpi/test_data/basic_rsdp.asl @@ -0,0 +1,16 @@ +/* + * Intel ACPI Component Architecture + * iASL Compiler/Disassembler version 20251212 (64-bit version) + * Copyright (c) 2000 - 2025 Intel Corporation + * + * Template for [RSDP] ACPI Table (AML byte code table) + */ +[0008] Signature : "RSD PTR " +[0001] Checksum : 43 +[0006] Oem ID : "INTEL " +[0001] Revision : 02 +[0004] RSDT Address : 00000000 +[0004] Length : 00000024 +[0008] XSDT Address : 0000000000000000 +[0001] Extended Checksum : DC +[0003] Reserved : 000000 diff --git a/libs/acpi/test_data/tables.S b/libs/acpi/test_data/tables.S index af58109..f40f070 100644 --- a/libs/acpi/test_data/tables.S +++ b/libs/acpi/test_data/tables.S @@ -10,5 +10,6 @@ TABLE(basic_madt, "basic_madt.aml") TABLE(basic_rsdt, "basic_rsdt.aml") +TABLE(basic_rsdp, "basic_rsdp.aml") #undef TABLE diff --git a/libs/acpi/test_data/tables.hpp b/libs/acpi/test_data/tables.hpp index 2b3874f..510cbda 100644 --- a/libs/acpi/test_data/tables.hpp +++ b/libs/acpi/test_data/tables.hpp @@ -17,6 +17,7 @@ namespace acpi::test_data::tables TABLE(basic_madt); TABLE(basic_rsdt); + TABLE(basic_rsdp); } // namespace acpi::test_data::tables -- cgit v1.2.3 From 6344a2a81b94a00aaaa987d0e0d40993ed581d5e Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Wed, 15 Apr 2026 16:19:00 +0200 Subject: acpi: reimplement the common table header --- libs/acpi/test_data/table_header.asl | 9 +++++++++ libs/acpi/test_data/tables.S | 1 + libs/acpi/test_data/tables.hpp | 1 + 3 files changed, 11 insertions(+) create mode 100644 libs/acpi/test_data/table_header.asl (limited to 'libs/acpi/test_data') diff --git a/libs/acpi/test_data/table_header.asl b/libs/acpi/test_data/table_header.asl new file mode 100644 index 0000000..8cddc03 --- /dev/null +++ b/libs/acpi/test_data/table_header.asl @@ -0,0 +1,9 @@ +[0004] Signature : "TEST" +[0004] Table Length : 00000000 +[0001] Revision : 01 +[0001] Checksum : 00 +[0006] Oem ID : "FEMO " +[0008] Oem Table ID : "HDRTEST " +[0004] Oem Revision : 00000001 +[0004] Asl Compiler ID : "INTL" +[0004] Asl Compiler Revision : 00000000 diff --git a/libs/acpi/test_data/tables.S b/libs/acpi/test_data/tables.S index f40f070..da9a12f 100644 --- a/libs/acpi/test_data/tables.S +++ b/libs/acpi/test_data/tables.S @@ -11,5 +11,6 @@ TABLE(basic_madt, "basic_madt.aml") TABLE(basic_rsdt, "basic_rsdt.aml") TABLE(basic_rsdp, "basic_rsdp.aml") +TABLE(table_header, "table_header.aml") #undef TABLE diff --git a/libs/acpi/test_data/tables.hpp b/libs/acpi/test_data/tables.hpp index 510cbda..dc39b37 100644 --- a/libs/acpi/test_data/tables.hpp +++ b/libs/acpi/test_data/tables.hpp @@ -18,6 +18,7 @@ namespace acpi::test_data::tables TABLE(basic_madt); TABLE(basic_rsdt); TABLE(basic_rsdp); + TABLE(table_header); } // namespace acpi::test_data::tables -- cgit v1.2.3 From 776ab2749d5af0a34fd2aa6103a377ddc04d4c53 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Thu, 16 Apr 2026 10:03:35 +0200 Subject: acpi: introduce XSDT type --- libs/acpi/test_data/basic_xsdt.asl | 26 ++++++++++++++++++++++++++ libs/acpi/test_data/tables.S | 1 + libs/acpi/test_data/tables.hpp | 1 + 3 files changed, 28 insertions(+) create mode 100644 libs/acpi/test_data/basic_xsdt.asl (limited to 'libs/acpi/test_data') diff --git a/libs/acpi/test_data/basic_xsdt.asl b/libs/acpi/test_data/basic_xsdt.asl new file mode 100644 index 0000000..d8589f9 --- /dev/null +++ b/libs/acpi/test_data/basic_xsdt.asl @@ -0,0 +1,26 @@ +/* + * Intel ACPI Component Architecture + * iASL Compiler/Disassembler version 20251212 (64-bit version) + * Copyright (c) 2000 - 2025 Intel Corporation + * + * Template for [XSDT] ACPI Table (static data table) + * Format: [ByteLength] FieldName : HexFieldValue + */ +[0004] Signature : "XSDT" [Extended System Description Table] +[0004] Table Length : 00000064 +[0001] Revision : 01 +[0001] Checksum : 8B +[0006] Oem ID : "INTEL " +[0008] Oem Table ID : "TEMPLATE" +[0004] Oem Revision : 00000001 +[0004] Asl Compiler ID : "INTL" +[0004] Asl Compiler Revision : 20100528 + +[0008] ACPI Table Address 0 : 0000000000000010 +[0008] ACPI Table Address 1 : 0000000000000020 +[0008] ACPI Table Address 2 : 0000000000000030 +[0008] ACPI Table Address 3 : 0000000000000040 +[0008] ACPI Table Address 4 : 0000000000000050 +[0008] ACPI Table Address 5 : 0000000000000060 +[0008] ACPI Table Address 6 : 0000000000000070 +[0008] ACPI Table Address 7 : 0000000000000080 diff --git a/libs/acpi/test_data/tables.S b/libs/acpi/test_data/tables.S index da9a12f..641db6a 100644 --- a/libs/acpi/test_data/tables.S +++ b/libs/acpi/test_data/tables.S @@ -11,6 +11,7 @@ TABLE(basic_madt, "basic_madt.aml") TABLE(basic_rsdt, "basic_rsdt.aml") TABLE(basic_rsdp, "basic_rsdp.aml") +TABLE(basic_xsdt, "basic_xsdt.aml") TABLE(table_header, "table_header.aml") #undef TABLE diff --git a/libs/acpi/test_data/tables.hpp b/libs/acpi/test_data/tables.hpp index dc39b37..e91f1a5 100644 --- a/libs/acpi/test_data/tables.hpp +++ b/libs/acpi/test_data/tables.hpp @@ -18,6 +18,7 @@ namespace acpi::test_data::tables TABLE(basic_madt); TABLE(basic_rsdt); TABLE(basic_rsdp); + TABLE(basic_xsdt); TABLE(table_header); } // namespace acpi::test_data::tables -- cgit v1.2.3 From d906d70c94c2a40d5fc6fd26056c7bc57d540002 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Thu, 23 Apr 2026 17:16:34 +0200 Subject: acpi: move test data header --- libs/acpi/test_data/tables.S | 17 ----------------- libs/acpi/test_data/tables.hpp | 28 ---------------------------- 2 files changed, 45 deletions(-) delete mode 100644 libs/acpi/test_data/tables.S delete mode 100644 libs/acpi/test_data/tables.hpp (limited to 'libs/acpi/test_data') diff --git a/libs/acpi/test_data/tables.S b/libs/acpi/test_data/tables.S deleted file mode 100644 index 641db6a..0000000 --- a/libs/acpi/test_data/tables.S +++ /dev/null @@ -1,17 +0,0 @@ -.section .rodata - -.balign 16 - -#define TABLE(name, file) \ - .global name##_start; \ - .global name##_end; \ - name##_start: .incbin file; \ - name##_end: - -TABLE(basic_madt, "basic_madt.aml") -TABLE(basic_rsdt, "basic_rsdt.aml") -TABLE(basic_rsdp, "basic_rsdp.aml") -TABLE(basic_xsdt, "basic_xsdt.aml") -TABLE(table_header, "table_header.aml") - -#undef TABLE diff --git a/libs/acpi/test_data/tables.hpp b/libs/acpi/test_data/tables.hpp deleted file mode 100644 index e91f1a5..0000000 --- a/libs/acpi/test_data/tables.hpp +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef ACPI_TEST_DATA_TABLES_HPP -#define ACPI_TEST_DATA_TABLES_HPP - -#include -#include - -#define TABLE(name) \ - extern "C" std::byte const name##_start; \ - extern "C" std::byte const name##_end; \ - auto inline name()->std::span \ - { \ - return {&name##_start, &name##_end}; \ - } - -namespace acpi::test_data::tables -{ - - TABLE(basic_madt); - TABLE(basic_rsdt); - TABLE(basic_rsdp); - TABLE(basic_xsdt); - TABLE(table_header); - -} // namespace acpi::test_data::tables - -#undef TABLE - -#endif -- cgit v1.2.3