Path: blob/main/sys/compat/linuxkpi/common/include/acpi/acpi_bus.h
39604 views
/*-1* SPDX-License-Identifier: BSD-2-Clause2*3* Copyright (c) 2020 Vladimir Kondratyev <[email protected]>4*5* Redistribution and use in source and binary forms, with or without6* modification, are permitted provided that the following conditions are7* 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 in12* the documentation and/or other materials provided with the13* distribution.14*15* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND16* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE17* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE18* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE19* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL20* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS21* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)22* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT23* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY24* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF25* SUCH DAMAGE.26*/2728#ifndef _LINUXKPI_ACPI_ACPI_BUS_H_29#define _LINUXKPI_ACPI_ACPI_BUS_H_3031/* Aliase struct acpi_device to device_t */32#define acpi_device _device3334typedef char acpi_device_class[20];3536struct acpi_bus_event {37acpi_device_class device_class;38uint32_t type;39uint32_t data;40};4142#define acpi_dev_present(...) lkpi_acpi_dev_present(__VA_ARGS__)43#define acpi_dev_get_first_match_dev(...) \44lkpi_acpi_dev_get_first_match_dev(__VA_ARGS__)4546ACPI_HANDLE bsd_acpi_get_handle(device_t bsddev);47bool acpi_check_dsm(ACPI_HANDLE handle, const guid_t *uuid, int rev,48uint64_t funcs);49ACPI_OBJECT * acpi_evaluate_dsm_typed(ACPI_HANDLE handle, const guid_t *uuid,50int rev, int func, ACPI_OBJECT *argv4,51ACPI_OBJECT_TYPE type);52int register_acpi_notifier(struct notifier_block *nb);53int unregister_acpi_notifier(struct notifier_block *nb);54uint32_t acpi_target_system_state(void);55bool lkpi_acpi_dev_present(const char *hid, const char *uid,56int64_t hrv);57struct acpi_device *lkpi_acpi_dev_get_first_match_dev(const char *hid,58const char *uid, int64_t hrv);5960union linuxkpi_acpi_object;6162union linuxkpi_acpi_object *63acpi_evaluate_dsm(ACPI_HANDLE ObjHandle, const guid_t *guid,64UINT64 rev, UINT64 func, union linuxkpi_acpi_object *arg);6566#endif /* _LINUXKPI_ACPI_ACPI_BUS_H_ */676869