1 1.16 jmcneill /* $NetBSD: acpi_util.h,v 1.16 2025/01/11 11:40:43 jmcneill Exp $ */ 2 1.1 jruoho 3 1.1 jruoho /*- 4 1.1 jruoho * Copyright (c) 2003, 2007 The NetBSD Foundation, Inc. 5 1.1 jruoho * All rights reserved. 6 1.1 jruoho * 7 1.1 jruoho * This code is derived from software contributed to The NetBSD Foundation 8 1.1 jruoho * by Charles M. Hannum of By Noon Software, Inc. 9 1.1 jruoho * 10 1.1 jruoho * Redistribution and use in source and binary forms, with or without 11 1.1 jruoho * modification, are permitted provided that the following conditions 12 1.1 jruoho * are met: 13 1.1 jruoho * 1. Redistributions of source code must retain the above copyright 14 1.1 jruoho * notice, this list of conditions and the following disclaimer. 15 1.1 jruoho * 2. Redistributions in binary form must reproduce the above copyright 16 1.1 jruoho * notice, this list of conditions and the following disclaimer in the 17 1.1 jruoho * documentation and/or other materials provided with the distribution. 18 1.1 jruoho * 19 1.1 jruoho * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 20 1.1 jruoho * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 21 1.1 jruoho * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22 1.1 jruoho * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 23 1.1 jruoho * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 1.1 jruoho * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 1.1 jruoho * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 1.1 jruoho * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 1.1 jruoho * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 1.1 jruoho * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 1.1 jruoho * POSSIBILITY OF SUCH DAMAGE. 30 1.1 jruoho */ 31 1.1 jruoho 32 1.1 jruoho /* 33 1.1 jruoho * Copyright 2001, 2003 Wasabi Systems, Inc. 34 1.1 jruoho * All rights reserved. 35 1.1 jruoho * 36 1.1 jruoho * Written by Jason R. Thorpe for Wasabi Systems, Inc. 37 1.1 jruoho * 38 1.1 jruoho * Redistribution and use in source and binary forms, with or without 39 1.1 jruoho * modification, are permitted provided that the following conditions 40 1.1 jruoho * are met: 41 1.1 jruoho * 1. Redistributions of source code must retain the above copyright 42 1.1 jruoho * notice, this list of conditions and the following disclaimer. 43 1.1 jruoho * 2. Redistributions in binary form must reproduce the above copyright 44 1.1 jruoho * notice, this list of conditions and the following disclaimer in the 45 1.1 jruoho * documentation and/or other materials provided with the distribution. 46 1.1 jruoho * 3. All advertising materials mentioning features or use of this software 47 1.1 jruoho * must display the following acknowledgement: 48 1.1 jruoho * This product includes software developed for the NetBSD Project by 49 1.1 jruoho * Wasabi Systems, Inc. 50 1.1 jruoho * 4. The name of Wasabi Systems, Inc. may not be used to endorse 51 1.1 jruoho * or promote products derived from this software without specific prior 52 1.1 jruoho * written permission. 53 1.1 jruoho * 54 1.1 jruoho * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND 55 1.1 jruoho * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 56 1.1 jruoho * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 57 1.1 jruoho * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC 58 1.1 jruoho * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 59 1.1 jruoho * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 60 1.1 jruoho * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 61 1.1 jruoho * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 62 1.1 jruoho * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 63 1.1 jruoho * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 64 1.1 jruoho * POSSIBILITY OF SUCH DAMAGE. 65 1.1 jruoho */ 66 1.1 jruoho 67 1.1 jruoho #ifndef _SYS_DEV_ACPI_ACPI_UTIL_H 68 1.1 jruoho #define _SYS_DEV_ACPI_ACPI_UTIL_H 69 1.1 jruoho 70 1.14 thorpej devhandle_t devhandle_from_acpi(devhandle_t, ACPI_HANDLE); 71 1.11 thorpej ACPI_HANDLE devhandle_to_acpi(devhandle_t); 72 1.11 thorpej 73 1.11 thorpej #define ACPI_DEVICE_CALL_REGISTER(_n_, _c_) \ 74 1.11 thorpej DEVICE_CALL_REGISTER(acpi_device_calls, _n_, _c_) 75 1.11 thorpej 76 1.1 jruoho ACPI_STATUS acpi_eval_integer(ACPI_HANDLE, const char *, ACPI_INTEGER *); 77 1.1 jruoho ACPI_STATUS acpi_eval_set_integer(ACPI_HANDLE handle, const char *path, 78 1.1 jruoho ACPI_INTEGER arg); 79 1.1 jruoho ACPI_STATUS acpi_eval_string(ACPI_HANDLE, const char *, char **); 80 1.1 jruoho ACPI_STATUS acpi_eval_struct(ACPI_HANDLE, const char *, ACPI_BUFFER *); 81 1.1 jruoho ACPI_STATUS acpi_eval_reference_handle(ACPI_OBJECT *, ACPI_HANDLE *); 82 1.1 jruoho 83 1.1 jruoho ACPI_STATUS acpi_foreach_package_object(ACPI_OBJECT *, 84 1.1 jruoho ACPI_STATUS (*)(ACPI_OBJECT *, void *), void *); 85 1.1 jruoho ACPI_STATUS acpi_get(ACPI_HANDLE, ACPI_BUFFER *, 86 1.1 jruoho ACPI_STATUS (*)(ACPI_HANDLE, ACPI_BUFFER *)); 87 1.3 jruoho 88 1.5 jruoho struct acpi_devnode *acpi_match_node(ACPI_HANDLE handle); 89 1.5 jruoho void acpi_match_node_init(struct acpi_devnode *ad); 90 1.1 jruoho 91 1.4 jruoho const char *acpi_name(ACPI_HANDLE); 92 1.4 jruoho int acpi_match_hid(ACPI_DEVICE_INFO *, const char * const *); 93 1.6 jmcneill int acpi_match_class(ACPI_HANDLE, uint8_t, uint8_t, uint8_t); 94 1.4 jruoho ACPI_HANDLE acpi_match_cpu_info(struct cpu_info *); 95 1.4 jruoho struct cpu_info *acpi_match_cpu_handle(ACPI_HANDLE); 96 1.1 jruoho 97 1.15 thorpej char *acpi_pack_compat_list(struct acpi_devnode *ad, size_t *); 98 1.9 thorpej 99 1.7 jmcneill ACPI_STATUS acpi_dsd_integer(ACPI_HANDLE, const char *, ACPI_INTEGER *); 100 1.8 jmcneill ACPI_STATUS acpi_dsd_string(ACPI_HANDLE, const char *, char **); 101 1.12 jmcneill ACPI_STATUS acpi_dsd_bool(ACPI_HANDLE, const char *, bool *); 102 1.7 jmcneill 103 1.9 thorpej ACPI_STATUS acpi_dsm(ACPI_HANDLE, uint8_t *, ACPI_INTEGER, 104 1.9 thorpej ACPI_INTEGER, const ACPI_OBJECT *, ACPI_OBJECT **); 105 1.9 thorpej ACPI_STATUS acpi_dsm_typed(ACPI_HANDLE, uint8_t *, ACPI_INTEGER, 106 1.9 thorpej ACPI_INTEGER, const ACPI_OBJECT *, 107 1.9 thorpej ACPI_OBJECT_TYPE, ACPI_OBJECT **); 108 1.9 thorpej ACPI_STATUS acpi_dsm_integer(ACPI_HANDLE, uint8_t *, ACPI_INTEGER, 109 1.9 thorpej ACPI_INTEGER, const ACPI_OBJECT *, 110 1.9 thorpej ACPI_INTEGER *); 111 1.13 jmcneill ACPI_STATUS acpi_dsm_query(ACPI_HANDLE, uint8_t *, ACPI_INTEGER, 112 1.13 jmcneill ACPI_INTEGER *); 113 1.9 thorpej 114 1.16 jmcneill ACPI_STATUS acpi_claim_childdevs(device_t, struct acpi_devnode *, 115 1.16 jmcneill const char *); 116 1.10 jmcneill 117 1.1 jruoho #endif /* !_SYS_DEV_ACPI_ACPI_UTIL_H */ 118