diff options
author | Simon Glass <sjg@chromium.org> | 2023-12-31 08:25:54 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2024-01-07 13:45:07 -0700 |
commit | a8efebe71978b3b21e04c7f104987ada879e0800 (patch) | |
tree | bd0394b2a6d67b3e40d13fe538576e91259a1708 /cmd | |
parent | 5e3adc44a4da72b25fa78e9f9847a8c297b3ebaf (diff) | |
download | u-boot-a8efebe71978b3b21e04c7f104987ada879e0800.tar.gz u-boot-a8efebe71978b3b21e04c7f104987ada879e0800.tar.bz2 u-boot-a8efebe71978b3b21e04c7f104987ada879e0800.zip |
acpi: Write pointers to tables instead of addresses
Sandbox uses an API to map between addresses and pointers. This allows
it to have (emulated) memory at zero and avoid arch-specific addressing
details. It also allows memory-mapped peripherals to work.
As an example, on many machines sandbox maps address 100 to pointer
value 10000000.
However this is not correct for ACPI, if sandbox starts another program
(e.g EFI app) and passes it the tables. That app has no knowledge of
sandbox's address mapping. So to make this work we want to store
10000000 as the value in the table.
Add two new 'nomap' functions which clearly make this exeption to how
sandbox works.
This should allow EFI apps to access ACPI tables with sandbox, e.g. for
testing purposes.
Signed-off-by: Simon Glass <sjg@chromium.org>
Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/acpi.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/cmd/acpi.c b/cmd/acpi.c index 0c14409242..79e9335b5d 100644 --- a/cmd/acpi.c +++ b/cmd/acpi.c @@ -45,7 +45,7 @@ static int dump_table_name(const char *sig) if (!hdr) return -ENOENT; printf("%.*s @ %16lx\n", ACPI_NAME_LEN, hdr->signature, - (ulong)map_to_sysmem(hdr)); + (ulong)nomap_to_sysmem(hdr)); print_buffer(0, hdr, 1, hdr->length, 0); return 0; @@ -54,9 +54,9 @@ static int dump_table_name(const char *sig) static void list_fadt(struct acpi_fadt *fadt) { if (fadt->dsdt) - dump_hdr(map_sysmem(fadt->dsdt, 0)); + dump_hdr(nomap_sysmem(fadt->dsdt, 0)); if (fadt->firmware_ctrl) - dump_hdr(map_sysmem(fadt->firmware_ctrl, 0)); + dump_hdr(nomap_sysmem(fadt->firmware_ctrl, 0)); } static void list_rsdt(struct acpi_rsdp *rsdp) @@ -66,11 +66,11 @@ static void list_rsdt(struct acpi_rsdp *rsdp) struct acpi_xsdt *xsdt; if (rsdp->rsdt_address) { - rsdt = map_sysmem(rsdp->rsdt_address, 0); + rsdt = nomap_sysmem(rsdp->rsdt_address, 0); dump_hdr(&rsdt->header); } if (rsdp->xsdt_address) { - xsdt = map_sysmem(rsdp->xsdt_address, 0); + xsdt = nomap_sysmem(rsdp->xsdt_address, 0); dump_hdr(&xsdt->header); len = xsdt->header.length - sizeof(xsdt->header); count = len / sizeof(u64); @@ -91,7 +91,7 @@ static void list_rsdt(struct acpi_rsdp *rsdp) entry = rsdt->entry[i]; if (!entry) break; - hdr = map_sysmem(entry, 0); + hdr = nomap_sysmem(entry, 0); dump_hdr(hdr); if (!memcmp(hdr->signature, "FACP", ACPI_NAME_LEN)) list_fadt((struct acpi_fadt *)hdr); |