summaryrefslogtreecommitdiffstats
path: root/sys/ia64/acpica
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2002-12-18 08:47:07 +0000
committermarcel <marcel@FreeBSD.org>2002-12-18 08:47:07 +0000
commit6317601ef14489de8cd162dd0d3bad000dc813f4 (patch)
tree3c86ef77c277a2467ec5d918fe211214b6b81973 /sys/ia64/acpica
parent61e39e41d0d8f8ab8241ef19d0498df3b9ca7069 (diff)
downloadFreeBSD-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/ia64/acpica')
-rw-r--r--sys/ia64/acpica/OsdEnvironment.c33
1 files changed, 23 insertions, 10 deletions
diff --git a/sys/ia64/acpica/OsdEnvironment.c b/sys/ia64/acpica/OsdEnvironment.c
index 724968e..e4e664e 100644
--- a/sys/ia64/acpica/OsdEnvironment.c
+++ b/sys/ia64/acpica/OsdEnvironment.c
@@ -30,12 +30,20 @@
/*
* 6.1 : Environmental support
*/
+#include <sys/types.h>
+#include <sys/linker_set.h>
+#include <sys/sysctl.h>
#include "acpi.h"
extern u_int64_t ia64_efi_acpi_table;
extern u_int64_t ia64_efi_acpi20_table;
+u_long ia64_acpi_root;
+
+SYSCTL_ULONG(_machdep, OID_AUTO, acpi_root, CTLFLAG_RD, &ia64_acpi_root, 0,
+ "The physical address of the RSDP");
+
ACPI_STATUS
AcpiOsInitialize(void)
{
@@ -54,17 +62,22 @@ ACPI_STATUS
AcpiOsGetRootPointer(UINT32 Flags, ACPI_POINTER *RsdpAddress)
{
- if (ia64_efi_acpi20_table) {
- RsdpAddress->PointerType = ACPI_PHYSICAL_POINTER;
- RsdpAddress->Pointer.Physical = ia64_efi_acpi20_table;
-
- }
- else if (ia64_efi_acpi_table) {
- RsdpAddress->PointerType = ACPI_PHYSICAL_POINTER;
- RsdpAddress->Pointer.Physical = ia64_efi_acpi_table;
+ if (ia64_acpi_root == 0) {
+ if (ia64_efi_acpi20_table) {
+ /* XXX put under bootverbose. */
+ printf("Using ACPI2.0 table at 0x%lx\n",
+ ia64_efi_acpi20_table);
+ ia64_acpi_root = ia64_efi_acpi20_table;
+ } else if (ia64_efi_acpi_table) {
+ /* XXX put under bootverbose. */
+ printf("Using ACPI1.x table at 0x%lx\n",
+ ia64_efi_acpi_table);
+ ia64_acpi_root = ia64_efi_acpi_table;
+ } else
+ return(AE_NOT_FOUND);
}
- else
- return(AE_NOT_FOUND);
+ RsdpAddress->PointerType = ACPI_PHYSICAL_POINTER;
+ RsdpAddress->Pointer.Physical = ia64_acpi_root;
return(AE_OK);
}
OpenPOWER on IntegriCloud