ReactOS 0.4.16-dev-1946-g52006dd
utilities.h
Go to the documentation of this file.
1#pragma once
2
3#include <uacpi/status.h>
4#include <uacpi/types.h>
5#include <uacpi/namespace.h>
6
7#ifdef __cplusplus
8extern "C" {
9#endif
10
11#ifndef UACPI_BAREBONES_MODE
12
13/*
14 * Checks whether the device at 'node' matches any of the PNP ids provided in
15 * 'list' (terminated by a UACPI_NULL). This is done by first attempting to
16 * match the value returned from _HID and then the value(s) from _CID.
17 *
18 * Note that the presence of the device (_STA) is not verified here.
19 */
22 const uacpi_char *const *list
23);
24
25/*
26 * Find all the devices in the namespace starting at 'parent' matching the
27 * specified 'hids' (terminated by a UACPI_NULL) against any value from _HID or
28 * _CID. Only devices reported as present via _STA are checked. Any matching
29 * devices are then passed to the 'cb'.
30 */
33 const uacpi_char *const *hids,
35 void *user
36);
37
38/*
39 * Same as uacpi_find_devices_at, except this starts at the root and only
40 * matches one hid.
41 */
43 const uacpi_char *hid,
45 void *user
46);
47
53
55
62
68
71);
72
73typedef struct uacpi_id_string {
74 // size of the string including the null byte
79
80/*
81 * Evaluate a device's _HID method and get its value.
82 * The returned struture must be freed using uacpi_free_id_string.
83 */
85
86typedef struct uacpi_pnp_id_list {
87 // number of 'ids' in the list
89
90 // size of the 'ids' list including the string lengths
92
93 // list of PNP ids
97
98/*
99 * Evaluate a device's _CID method and get its value.
100 * The returned structure must be freed using uacpi_free_pnp_id_list.
101 */
103
104/*
105 * Evaluate a device's _STA method and get its value.
106 * If this method is not found, the value of 'flags' is set to all ones.
107 */
109
110/*
111 * Evaluate a device's _ADR method and get its value.
112 */
114
115/*
116 * Evaluate a device's _CLS method and get its value.
117 * The format of returned string is BBSSPP where:
118 * BB => Base Class (e.g. 01 => Mass Storage)
119 * SS => Sub-Class (e.g. 06 => SATA)
120 * PP => Programming Interface (e.g. 01 => AHCI)
121 * The returned struture must be freed using uacpi_free_id_string.
122 */
124
125/*
126 * Evaluate a device's _UID method and get its value.
127 * The returned struture must be freed using uacpi_free_id_string.
128 */
130
131
132// uacpi_namespace_node_info->flags
133#define UACPI_NS_NODE_INFO_HAS_ADR (1 << 0)
134#define UACPI_NS_NODE_INFO_HAS_HID (1 << 1)
135#define UACPI_NS_NODE_INFO_HAS_UID (1 << 2)
136#define UACPI_NS_NODE_INFO_HAS_CID (1 << 3)
137#define UACPI_NS_NODE_INFO_HAS_CLS (1 << 4)
138#define UACPI_NS_NODE_INFO_HAS_SXD (1 << 5)
139#define UACPI_NS_NODE_INFO_HAS_SXW (1 << 6)
140
142 // Size of the entire structure
144
145 // Object information
149
150 // UACPI_NS_NODE_INFO_HAS_*
152
153 /*
154 * A mapping of [S1..S4] to the shallowest D state supported by the device
155 * in that S state.
156 */
158
159 /*
160 * A mapping of [S0..S4] to the deepest D state supported by the device
161 * in that S state to be able to wake itself.
162 */
164
172
173/*
174 * Retrieve information about a namespace node. This includes the attached
175 * object's type, name, number of parameters (if it's a method), the result of
176 * evaluating _ADR, _UID, _CLS, _HID, _CID, as well as _SxD and _SxW.
177 *
178 * The returned structure must be freed with uacpi_free_namespace_node_info.
179 */
182);
183
184#endif // !UACPI_BAREBONES_MODE
185
186#ifdef __cplusplus
187}
188#endif
void user(int argc, const char *argv[])
Definition: cmds.c:1350
Definition: list.h:37
uacpi_iteration_decision(* uacpi_iteration_callback)(void *user, uacpi_namespace_node *node, uacpi_u32 node_depth)
Definition: namespace.h:98
size_t uacpi_size
Definition: types.h:37
uint32_t uacpi_u32
Definition: types.h:21
bool uacpi_bool
Definition: types.h:31
uint64_t uacpi_u64
Definition: types.h:22
char uacpi_char
Definition: types.h:44
uint8_t uacpi_u8
Definition: types.h:19
uacpi_status
Definition: status.h:10
uacpi_object_type
Definition: types.h:104
r parent
Definition: btrfs.c:3010
GLuint * ids
Definition: glext.h:5907
GLbitfield flags
Definition: glext.h:7161
struct output_fragment * out_list
Definition: write.c:75
static HMODULE MODULEINFO DWORD cb
Definition: module.c:33
uacpi_char * value
Definition: utilities.h:76
uacpi_u32 size
Definition: utilities.h:75
uacpi_id_string uid
Definition: utilities.h:167
uacpi_object_type type
Definition: utilities.h:147
uacpi_id_string hid
Definition: utilities.h:166
uacpi_pnp_id_list cid
Definition: utilities.h:169
uacpi_id_string cls
Definition: utilities.h:168
uacpi_object_name name
Definition: utilities.h:146
Definition: utilities.h:56
uacpi_namespace_node * source
Definition: utilities.h:59
uacpi_u32 index
Definition: utilities.h:58
uacpi_u32 address
Definition: utilities.h:57
uacpi_u8 pin
Definition: utilities.h:60
uacpi_pci_routing_table_entry entries[]
Definition: utilities.h:65
uacpi_size num_entries
Definition: utilities.h:64
uacpi_u32 num_ids
Definition: utilities.h:88
uacpi_u32 size
Definition: utilities.h:91
Definition: dlist.c:348
uacpi_status uacpi_eval_cid(uacpi_namespace_node *, uacpi_pnp_id_list **out_list)
Definition: utilities.c:444
uacpi_status uacpi_eval_uid(uacpi_namespace_node *, uacpi_id_string **out_uid)
Definition: utilities.c:655
uacpi_status uacpi_find_devices_at(uacpi_namespace_node *parent, const uacpi_char *const *hids, uacpi_iteration_callback cb, void *user)
Definition: utilities.c:956
uacpi_status uacpi_find_devices(const uacpi_char *hid, uacpi_iteration_callback cb, void *user)
Definition: utilities.c:975
uacpi_status uacpi_eval_hid(uacpi_namespace_node *, uacpi_id_string **out_id)
Definition: utilities.c:371
uacpi_status uacpi_eval_sta(uacpi_namespace_node *, uacpi_u32 *flags)
Definition: utilities.c:568
uacpi_status uacpi_eval_adr(uacpi_namespace_node *, uacpi_u64 *out)
Definition: utilities.c:591
void uacpi_free_pci_routing_table(uacpi_pci_routing_table *)
Definition: utilities.c:1123
void uacpi_free_id_string(uacpi_id_string *id)
Definition: utilities.c:436
uacpi_status uacpi_get_namespace_node_info(uacpi_namespace_node *node, uacpi_namespace_node_info **out_info)
Definition: utilities.c:786
uacpi_bool uacpi_device_matches_pnp_id(uacpi_namespace_node *node, const uacpi_char *const *list)
Definition: utilities.c:894
void uacpi_free_namespace_node_info(uacpi_namespace_node_info *)
Definition: utilities.c:886
uacpi_status uacpi_get_pci_routing_table(uacpi_namespace_node *parent, uacpi_pci_routing_table **out_table)
Definition: utilities.c:1011
void uacpi_free_pnp_id_list(uacpi_pnp_id_list *list)
Definition: utilities.c:560
uacpi_status uacpi_eval_cls(uacpi_namespace_node *, uacpi_id_string **out_id)
Definition: utilities.c:612
uacpi_status uacpi_set_interrupt_model(uacpi_interrupt_model)
Definition: utilities.c:986
uacpi_interrupt_model
Definition: utilities.h:48
@ UACPI_INTERRUPT_MODEL_PIC
Definition: utilities.h:49
@ UACPI_INTERRUPT_MODEL_IOSAPIC
Definition: utilities.h:51
@ UACPI_INTERRUPT_MODEL_IOAPIC
Definition: utilities.h:50
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
Definition: wcsftime.cpp:383