From d756fcf644e9e1bf8aa070f44c7be9a2d32ddbe7 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Fri, 8 Jan 2010 16:06:22 +0000 Subject: [PATCH] acpi_check_rsdt(), acpi_find_table(): Unmap the mapped page again, if we don't need it. That prevents us from ending up with the page being mapped multiple times (under VMware at least) and thus fixes #5208. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34948 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/boot/platform/bios_ia32/acpi.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/system/boot/platform/bios_ia32/acpi.cpp b/src/system/boot/platform/bios_ia32/acpi.cpp index a4f2544ce3..f27f3ee18b 100644 --- a/src/system/boot/platform/bios_ia32/acpi.cpp +++ b/src/system/boot/platform/bios_ia32/acpi.cpp @@ -44,8 +44,10 @@ acpi_check_rsdt(acpi_rsdp *rsdp) // map and validate the root system description table acpi_descriptor_header *rsdt = (acpi_descriptor_header *)mmu_map_physical_memory( - rsdp->rsdt_address, B_PAGE_SIZE, kDefaultPageFlags); + rsdp->rsdt_address, sizeof(acpi_descriptor_header), kDefaultPageFlags); if (rsdt == NULL || strncmp(rsdt->signature, ACPI_RSDT_SIGNATURE, 4) != 0) { + if (rsdt != NULL) + mmu_free(rsdt, sizeof(acpi_descriptor_header)); TRACE(("acpi: invalid root system description table\n")); return B_ERROR; } @@ -78,9 +80,12 @@ acpi_find_table(const char *signature) for (int32 j = 0; j < numEntries; j++, pointer++) { acpi_descriptor_header *header = (acpi_descriptor_header *) - mmu_map_physical_memory(*pointer, B_PAGE_SIZE, kDefaultPageFlags); + mmu_map_physical_memory(*pointer, sizeof(acpi_descriptor_header), + kDefaultPageFlags); if (header == NULL || strncmp(header->signature, signature, 4) != 0) { // not interesting for us + if (header != NULL) + mmu_free(header, sizeof(acpi_descriptor_header)); TRACE(("acpi: Looking for '%.4s'. Skipping '%.4s'\n", signature, header->signature)); continue;