diff options
Diffstat (limited to 'sys/amd64/acpica/acpi_machdep.c')
-rw-r--r-- | sys/amd64/acpica/acpi_machdep.c | 36 |
1 files changed, 16 insertions, 20 deletions
diff --git a/sys/amd64/acpica/acpi_machdep.c b/sys/amd64/acpica/acpi_machdep.c index bbeb7cef44c5..081fe89537bb 100644 --- a/sys/amd64/acpica/acpi_machdep.c +++ b/sys/amd64/acpica/acpi_machdep.c @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2001 Mitsuru IWASAKI * All rights reserved. @@ -26,9 +26,6 @@ * SUCH DAMAGE. */ -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - #include <sys/param.h> #include <sys/bus.h> #include <sys/kernel.h> @@ -103,17 +100,17 @@ map_table(vm_paddr_t pa, const char *sig) header = pmap_mapbios(pa, sizeof(ACPI_TABLE_HEADER)); if (strncmp(header->Signature, sig, ACPI_NAMESEG_SIZE) != 0) { - pmap_unmapbios((vm_offset_t)header, sizeof(ACPI_TABLE_HEADER)); + pmap_unmapbios(header, sizeof(ACPI_TABLE_HEADER)); return (NULL); } length = header->Length; - pmap_unmapbios((vm_offset_t)header, sizeof(ACPI_TABLE_HEADER)); + pmap_unmapbios(header, sizeof(ACPI_TABLE_HEADER)); table = pmap_mapbios(pa, length); - if (ACPI_FAILURE(AcpiTbChecksum(table, length))) { + if (ACPI_FAILURE(AcpiUtChecksum(table, length))) { if (bootverbose) printf("ACPI: Failed checksum for table %s\n", sig); #if (ACPI_CHECKSUM_ABORT) - pmap_unmapbios((vm_offset_t)table, length); + pmap_unmapbios(table, length); return (NULL); #endif } @@ -132,7 +129,7 @@ probe_table(vm_paddr_t address, const char *sig) table = pmap_mapbios(address, sizeof(ACPI_TABLE_HEADER)); ret = strncmp(table->Signature, sig, ACPI_NAMESEG_SIZE) == 0; - pmap_unmapbios((vm_offset_t)table, sizeof(ACPI_TABLE_HEADER)); + pmap_unmapbios(table, sizeof(ACPI_TABLE_HEADER)); return (ret); } @@ -154,7 +151,7 @@ acpi_unmap_table(void *table) ACPI_TABLE_HEADER *header; header = (ACPI_TABLE_HEADER *)table; - pmap_unmapbios((vm_offset_t)table, header->Length); + pmap_unmapbios(table, header->Length); } /* @@ -184,8 +181,7 @@ acpi_find_table(const char *sig) return (0); rsdp = pmap_mapbios(rsdp_ptr, sizeof(ACPI_TABLE_RSDP)); if (rsdp == NULL) { - if (bootverbose) - printf("ACPI: Failed to map RSDP\n"); + printf("ACPI: Failed to map RSDP\n"); return (0); } @@ -200,15 +196,15 @@ acpi_find_table(const char *sig) * the version 1.0 portion of the RSDP. Version 2.0 has * an additional checksum that we verify first. */ - if (AcpiTbChecksum((UINT8 *)rsdp, ACPI_RSDP_XCHECKSUM_LENGTH)) { - if (bootverbose) - printf("ACPI: RSDP failed extended checksum\n"); + if (AcpiUtChecksum((UINT8 *)rsdp, ACPI_RSDP_XCHECKSUM_LENGTH)) { + printf("ACPI: RSDP failed extended checksum\n"); + pmap_unmapbios(rsdp, sizeof(ACPI_TABLE_RSDP)); return (0); } xsdt = map_table(rsdp->XsdtPhysicalAddress, ACPI_SIG_XSDT); if (xsdt == NULL) { - if (bootverbose) - printf("ACPI: Failed to map XSDT\n"); + printf("ACPI: Failed to map XSDT\n"); + pmap_unmapbios(rsdp, sizeof(ACPI_TABLE_RSDP)); return (0); } count = (xsdt->Header.Length - sizeof(ACPI_TABLE_HEADER)) / @@ -222,8 +218,8 @@ acpi_find_table(const char *sig) } else { rsdt = map_table(rsdp->RsdtPhysicalAddress, ACPI_SIG_RSDT); if (rsdt == NULL) { - if (bootverbose) - printf("ACPI: Failed to map RSDT\n"); + printf("ACPI: Failed to map RSDT\n"); + pmap_unmapbios(rsdp, sizeof(ACPI_TABLE_RSDP)); return (0); } count = (rsdt->Header.Length - sizeof(ACPI_TABLE_HEADER)) / @@ -235,7 +231,7 @@ acpi_find_table(const char *sig) } acpi_unmap_table(rsdt); } - pmap_unmapbios((vm_offset_t)rsdp, sizeof(ACPI_TABLE_RSDP)); + pmap_unmapbios(rsdp, sizeof(ACPI_TABLE_RSDP)); if (addr == 0) return (0); |