aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSimon Glass2021-12-01 09:02:50 -0700
committerSimon Glass2022-01-25 11:44:36 -0700
commit94ba15a3f13ff5b510d426d13854014bb9cb4713 (patch)
tree4037486b4814b9fe7f1a8c1d6ea7d2d1d90c7599 /test
parent31c27eb83084e77921b82e7e631ecd6ae8b904da (diff)
x86: Move base tables to a writer function
Use the new ACPI writer to write the base tables at the start of the area, moving this code from the x86 implementation. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'test')
-rw-r--r--test/dm/acpi.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/test/dm/acpi.c b/test/dm/acpi.c
index 49b71bec3c0..da728692528 100644
--- a/test/dm/acpi.c
+++ b/test/dm/acpi.c
@@ -53,10 +53,15 @@ struct testacpi_plat {
*
* @ctx: Context to set up
*/
-static int setup_ctx_and_base_tables(struct acpi_ctx *ctx, ulong start)
+static int setup_ctx_and_base_tables(struct unit_test_state *uts,
+ struct acpi_ctx *ctx, ulong start)
{
+ struct acpi_writer *entry = ACPI_WRITER_GET(0base);
+
acpi_setup_ctx(ctx, start);
- acpi_setup_base_tables(ctx);
+
+ ctx->tab_start = ctx->current;
+ ut_assertok(acpi_write_one(ctx, entry));
return 0;
}
@@ -264,7 +269,7 @@ static int dm_test_acpi_write_tables(struct unit_test_state *uts)
ut_assertnonnull(buf);
addr = map_to_sysmem(buf);
- setup_ctx_and_base_tables(&ctx, addr);
+ ut_assertok(setup_ctx_and_base_tables(uts, &ctx, addr));
dmar = ctx.current;
ut_assertok(acpi_write_dev_tables(&ctx));
@@ -339,7 +344,7 @@ static int dm_test_setup_ctx_and_base_tables(struct unit_test_state *uts)
buf = memalign(64, BUF_SIZE);
ut_assertnonnull(buf);
addr = map_to_sysmem(buf);
- setup_ctx_and_base_tables(&ctx, addr + 4);
+ ut_assertok(setup_ctx_and_base_tables(uts, &ctx, addr + 4));
ut_asserteq(map_to_sysmem(PTR_ALIGN(buf + 4, 16)), gd_acpi_start());
rsdp = buf + 16;
@@ -382,7 +387,7 @@ static int dm_test_acpi_cmd_list(struct unit_test_state *uts)
buf = memalign(16, BUF_SIZE);
ut_assertnonnull(buf);
addr = map_to_sysmem(buf);
- setup_ctx_and_base_tables(&ctx, addr);
+ ut_assertok(setup_ctx_and_base_tables(uts, &ctx, addr));
ut_assertok(acpi_write_dev_tables(&ctx));
@@ -424,7 +429,7 @@ static int dm_test_acpi_cmd_dump(struct unit_test_state *uts)
buf = memalign(16, BUF_SIZE);
ut_assertnonnull(buf);
addr = map_to_sysmem(buf);
- setup_ctx_and_base_tables(&ctx, addr);
+ ut_assertok(setup_ctx_and_base_tables(uts, &ctx, addr));
ut_assertok(acpi_write_dev_tables(&ctx));