aboutsummaryrefslogtreecommitdiff
path: root/test/dm
diff options
context:
space:
mode:
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2023-11-21 15:41:27 +0100
committerTom Rini <trini@konsulko.com>2023-12-13 18:39:06 -0500
commitbda020e762c4c391e4bf13fd73c093e757f92b3e (patch)
treed0be5fcb67802fa0c7fe2ff46d3cd2715f602d83 /test/dm
parent049ee9090399679826a6294098efc2242f5e63ad (diff)
downloadu-boot-bda020e762c4c391e4bf13fd73c093e757f92b3e.zip
u-boot-bda020e762c4c391e4bf13fd73c093e757f92b3e.tar.gz
u-boot-bda020e762c4c391e4bf13fd73c093e757f92b3e.tar.bz2
acpi: fix struct acpi_xsdt
The size of the ACPI table header is not a multiple of 8. We have to mark struct acpi_xsdt as packed to correctly access field Entry. Add a unit test for the offsets of field Entry in the RSDT and XSDT tables. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'test/dm')
-rw-r--r--test/dm/acpi.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/dm/acpi.c b/test/dm/acpi.c
index 5236b39..7e661ee 100644
--- a/test/dm/acpi.c
+++ b/test/dm/acpi.c
@@ -747,3 +747,13 @@ static int dm_test_acpi_find_table(struct unit_test_state *uts)
return 0;
}
DM_TEST(dm_test_acpi_find_table, 0);
+
+/* Test offsets in RSDT, XSDT */
+static int dm_test_acpi_offsets(struct unit_test_state *uts)
+{
+ ut_asserteq(36, offsetof(struct acpi_rsdt, entry));
+ ut_asserteq(36, offsetof(struct acpi_xsdt, entry));
+
+ return 0;
+}
+DM_TEST(dm_test_acpi_offsets, 0);