diff options
author | marcel <marcel@FreeBSD.org> | 2002-12-18 08:47:07 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2002-12-18 08:47:07 +0000 |
commit | 6317601ef14489de8cd162dd0d3bad000dc813f4 (patch) | |
tree | 3c86ef77c277a2467ec5d918fe211214b6b81973 /sys/amd64/acpica/OsdEnvironment.c | |
parent | 61e39e41d0d8f8ab8241ef19d0498df3b9ca7069 (diff) | |
download | FreeBSD-src-6317601ef14489de8cd162dd0d3bad000dc813f4.zip FreeBSD-src-6317601ef14489de8cd162dd0d3bad000dc813f4.tar.gz |
Export the physical address of the RSDP to userland by means
of the `machdep.acpi_root' sysctl. This is required on ia64
because the root pointer hardly ever, if at all, lives in the
first MB of memory and also because scanning the first MB of
memory can cause machine checks.
This provides a save and reliable way for ACPI tools to work
with the tables if ACPI support is present in the kernel. On
ia64 ACPI is non-optional.
Diffstat (limited to 'sys/amd64/acpica/OsdEnvironment.c')
-rw-r--r-- | sys/amd64/acpica/OsdEnvironment.c | 40 |
1 files changed, 29 insertions, 11 deletions
diff --git a/sys/amd64/acpica/OsdEnvironment.c b/sys/amd64/acpica/OsdEnvironment.c index 4e3ae44..a3d3661 100644 --- a/sys/amd64/acpica/OsdEnvironment.c +++ b/sys/amd64/acpica/OsdEnvironment.c @@ -30,32 +30,50 @@ /* * 6.1 : Environmental support */ +#include <sys/types.h> +#include <sys/linker_set.h> +#include <sys/sysctl.h> #include "acpi.h" #include <machine/pc/bios.h> +u_long i386_acpi_root; + +SYSCTL_ULONG(_machdep, OID_AUTO, acpi_root, CTLFLAG_RD, &i386_acpi_root, 0, + "The physical address of the RSDP"); + ACPI_STATUS AcpiOsInitialize(void) { - return(0); + return(0); } ACPI_STATUS AcpiOsTerminate(void) { - return(0); + return(0); } ACPI_STATUS -AcpiOsGetRootPointer( - UINT32 Flags, - ACPI_POINTER *RsdpPhysicalAddress) +AcpiOsGetRootPointer(UINT32 Flags, ACPI_POINTER *RsdpPhysicalAddress) { - /* - * The loader passes the physical address at which it found the - * RSDP in a hint. We could recover this rather than searching - * manually here. - */ - return(AcpiFindRootPointer(Flags, RsdpPhysicalAddress)); + ACPI_POINTER ptr; + ACPI_STATUS status; + + if (i386_acpi_root == 0) { + /* + * The loader passes the physical address at which it found the + * RSDP in a hint. We could recover this rather than searching + * manually here. + */ + status = AcpiFindRootPointer(Flags, &ptr); + if (status == AE_OK) + i386_acpi_root = ptr.Pointer.Physical; + } else + status = AE_OK; + + RsdpPhysicalAddress->PointerType = ACPI_PHYSICAL_POINTER; + RsdpPhysicalAddress->Pointer.Physical = i386_acpi_root; + return (status); } |