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