From a773b841f25a2c5cc5195b2c1135c43159ec4e10 Mon Sep 17 00:00:00 2001 From: Nate Lawson Date: Fri, 28 May 2004 07:25:23 +0000 Subject: [PATCH] Unify the start/size parameters for the RSDP search area. Don't bother trying to exclude the top end of the range since it should hurt to overlap by 4 bytes in the off-chance the RSDP signature appears incorrectly at the very top of our search space. --- usr.sbin/acpi/acpidump/acpi_user.c | 4 +++- usr.sbin/acpi/acpidump/acpidump.h | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/usr.sbin/acpi/acpidump/acpi_user.c b/usr.sbin/acpi/acpidump/acpi_user.c index 2166e884c800..550420c677ea 100644 --- a/usr.sbin/acpi/acpidump/acpi_user.c +++ b/usr.sbin/acpi/acpidump/acpi_user.c @@ -142,7 +142,9 @@ acpi_scan_rsd_ptr(void) for (; addr < end; addr += 16) if ((rsdp = acpi_get_rsdp(addr)) != NULL) return (rsdp); - for (addr = RSDP_HI_START; addr < RSDP_HI_END; addr += 16) + addr = RSDP_HI_START; + end = addr + RSDP_HI_SIZE; + for (; addr < end; addr += 16) if ((rsdp = acpi_get_rsdp(addr)) != NULL) return (rsdp); #endif /* __i386__ */ diff --git a/usr.sbin/acpi/acpidump/acpidump.h b/usr.sbin/acpi/acpidump/acpidump.h index 6cd7a8e7b18a..1ebc56d8e006 100644 --- a/usr.sbin/acpi/acpidump/acpidump.h +++ b/usr.sbin/acpi/acpidump/acpidump.h @@ -296,13 +296,13 @@ struct ECDTbody { /* * Addresses to scan on ia32 for the RSD PTR. According to section 5.2.2 * of the ACPI spec, we only consider two regions for the base address: - * 1. EBDA (0x0 - 0x3FF) + * 1. EBDA (1 KB area addressed to by 16 bit pointer at 0x40E) * 2. High memory (0xE0000 - 0xFFFFF) */ #define RSDP_EBDA_PTR 0x40E -#define RSDP_EBDA_SIZE (1024 - sizeof(struct ACPIrsdp)) +#define RSDP_EBDA_SIZE 0x400 #define RSDP_HI_START 0xE0000 -#define RSDP_HI_END (0x100000 - sizeof(struct ACPIrsdp)) +#define RSDP_HI_SIZE 0x20000 /* Find and map the RSD PTR structure and return it for parsing */ struct ACPIsdt *sdt_load_devmem(void);