/*-1* Copyright (c) 2000,2001 Michael Smith2* Copyright (c) 2000 BSDi3* All rights reserved.4*5* Redistribution and use in source and binary forms, with or without6* modification, are permitted provided that the following conditions7* are met:8* 1. Redistributions of source code must retain the above copyright9* notice, this list of conditions and the following disclaimer.10* 2. Redistributions in binary form must reproduce the above copyright11* notice, this list of conditions and the following disclaimer in the12* documentation and/or other materials provided with the distribution.13*14* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND15* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE16* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE17* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE18* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL19* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS20* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)21* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT22* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY23* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF24* SUCH DAMAGE.25*/2627#include <sys/types.h>28#include <sys/bus.h>29#include <sys/kernel.h>30#include <sys/sysctl.h>3132#include <contrib/dev/acpica/include/acpi.h>33#include <contrib/dev/acpica/include/aclocal.h>34#include <contrib/dev/acpica/include/actables.h>3536static u_long acpi_root_phys;3738SYSCTL_ULONG(_machdep, OID_AUTO, acpi_root, CTLFLAG_RD, &acpi_root_phys, 0,39"The physical address of the RSDP");4041ACPI_STATUS42AcpiOsInitialize(void)43{4445return (AE_OK);46}4748ACPI_STATUS49AcpiOsTerminate(void)50{5152return (AE_OK);53}5455static u_long56acpi_get_root_from_loader(void)57{58long acpi_root;5960if (TUNABLE_ULONG_FETCH("acpi.rsdp", &acpi_root))61return (acpi_root);6263/*64* The hints mechanism is considered legacy and has been replaced65* by the tunable method, but is used here as a fallback to66* retain maximum compatibility between old loaders and new67* kernels. It can be removed after 14.0R.68*/69if (resource_long_value("acpi", 0, "rsdp", &acpi_root) == 0)70return (acpi_root);7172return (0);73}7475ACPI_PHYSICAL_ADDRESS76AcpiOsGetRootPointer(void)77{7879if (acpi_root_phys == 0)80acpi_root_phys = acpi_get_root_from_loader();8182return (acpi_root_phys);83}848586