diff options
author | jkim <jkim@FreeBSD.org> | 2010-11-09 00:14:39 +0000 |
---|---|---|
committer | jkim <jkim@FreeBSD.org> | 2010-11-09 00:14:39 +0000 |
commit | 36651dc0f06343169a69e006361c5b933ee37567 (patch) | |
tree | a2359e43e7a60e9e2e05cc75bf94b30f306e9fd6 /sys/ia64/acpica | |
parent | 1d77e31425860c5adf9e625c70a2ba03bbc272b6 (diff) | |
download | FreeBSD-src-36651dc0f06343169a69e006361c5b933ee37567.zip FreeBSD-src-36651dc0f06343169a69e006361c5b933ee37567.tar.gz |
Reduce diff between platforms and fix style(9) bugs.
Diffstat (limited to 'sys/ia64/acpica')
-rw-r--r-- | sys/ia64/acpica/OsdEnvironment.c | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/sys/ia64/acpica/OsdEnvironment.c b/sys/ia64/acpica/OsdEnvironment.c index 209e343..654ffad 100644 --- a/sys/ia64/acpica/OsdEnvironment.c +++ b/sys/ia64/acpica/OsdEnvironment.c @@ -35,8 +35,6 @@ __FBSDID("$FreeBSD$"); #include <contrib/dev/acpica/include/acpi.h> -static struct uuid acpi_root_uuid = EFI_TABLE_ACPI20; - static u_long acpi_root_phys; SYSCTL_ULONG(_machdep, OID_AUTO, acpi_root, CTLFLAG_RD, &acpi_root_phys, 0, @@ -46,27 +44,35 @@ ACPI_STATUS AcpiOsInitialize(void) { - return(AE_OK); + return (AE_OK); } ACPI_STATUS AcpiOsTerminate(void) { - return(AE_OK); + return (AE_OK); +} + +static u_long +acpi_get_root_from_efi(void) +{ + static struct uuid acpi_root_uuid = EFI_TABLE_ACPI20; + void *acpi_root; + + acpi_root = efi_get_table(&acpi_root_uuid); + if (acpi_root != NULL) + return (IA64_RR_MASK((uintptr_t)acpi_root)); + + return (0); } ACPI_PHYSICAL_ADDRESS AcpiOsGetRootPointer(void) { - void *acpi_root; - if (acpi_root_phys == 0) { - acpi_root = efi_get_table(&acpi_root_uuid); - if (acpi_root == NULL) - return (0); - acpi_root_phys = IA64_RR_MASK((u_long)acpi_root); - } + if (acpi_root_phys == 0) + acpi_root_phys = acpi_get_root_from_efi(); return (acpi_root_phys); } |