ReactOS 0.4.17-dev-1196-gb6224c3
namespace.c File Reference
Include dependency graph for namespace.c:

Go to the source code of this file.

Macros

#define UACPI_REV_VALUE   2
 
#define UACPI_OS_VALUE   "Microsoft Windows NT"
 
#define MAKE_PREDEFINED(c0, c1, c2, c3)    { .name.text = { c0, c1, c2, c3 } }
 

Enumerations

enum  action { ACTION_REACQUIRE , ACTION_PUT }
 

Functions

uacpi_status uacpi_namespace_read_lock (void)
 
uacpi_status uacpi_namespace_read_unlock (void)
 
uacpi_status uacpi_namespace_write_lock (void)
 
uacpi_status uacpi_namespace_write_unlock (void)
 
static uacpi_object * make_object_for_predefined (enum uacpi_predefined_namespace ns)
 
static void namespace_node_detach_object (uacpi_namespace_node *node)
 
static void free_namespace_node (uacpi_handle handle)
 
uacpi_status uacpi_initialize_namespace (void)
 
void uacpi_deinitialize_namespace (void)
 
uacpi_namespace_node * uacpi_namespace_root (void)
 
uacpi_namespace_node * uacpi_namespace_get_predefined (enum uacpi_predefined_namespace ns)
 
uacpi_namespace_node * uacpi_namespace_node_alloc (uacpi_object_name name)
 
void uacpi_namespace_node_unref (uacpi_namespace_node *node)
 
uacpi_status uacpi_namespace_node_install (uacpi_namespace_node *parent, uacpi_namespace_node *node)
 
uacpi_bool uacpi_namespace_node_is_alias (uacpi_namespace_node *node)
 
uacpi_bool uacpi_namespace_node_is_dangling (uacpi_namespace_node *node)
 
uacpi_bool uacpi_namespace_node_is_temporary (uacpi_namespace_node *node)
 
uacpi_bool uacpi_namespace_node_is_predefined (uacpi_namespace_node *node)
 
uacpi_status uacpi_namespace_node_uninstall (uacpi_namespace_node *node)
 
uacpi_namespace_node * uacpi_namespace_node_find_sub_node (uacpi_namespace_node *parent, uacpi_object_name name)
 
static uacpi_object_name segment_to_name (const uacpi_char **string, uacpi_size *in_out_size)
 
uacpi_status uacpi_namespace_node_resolve (uacpi_namespace_node *parent, const uacpi_char *path, enum uacpi_should_lock should_lock, enum uacpi_may_search_above_parent may_search_above_parent, enum uacpi_permanent_only permanent_only, uacpi_namespace_node **out_node)
 
uacpi_status uacpi_namespace_node_find (uacpi_namespace_node *parent, const uacpi_char *path, uacpi_namespace_node **out_node)
 
uacpi_status uacpi_namespace_node_resolve_from_aml_namepath (uacpi_namespace_node *scope, const uacpi_char *path, uacpi_namespace_node **out_node)
 
uacpi_object * uacpi_namespace_node_get_object (const uacpi_namespace_node *node)
 
uacpi_object * uacpi_namespace_node_get_object_typed (const uacpi_namespace_node *node, uacpi_object_type_bits type_mask)
 
uacpi_status uacpi_namespace_node_acquire_object_typed (const uacpi_namespace_node *node, uacpi_object_type_bits type_mask, uacpi_object **out_obj)
 
uacpi_status uacpi_namespace_node_acquire_object (const uacpi_namespace_node *node, uacpi_object **out_obj)
 
static uacpi_status object_mutate_refcount (uacpi_object *obj, void(*cb)(uacpi_object *))
 
uacpi_status uacpi_namespace_node_reacquire_object (uacpi_object *obj)
 
uacpi_status uacpi_namespace_node_release_object (uacpi_object *obj)
 
uacpi_object_name uacpi_namespace_node_name (const uacpi_namespace_node *node)
 
uacpi_status uacpi_namespace_node_type_unlocked (const uacpi_namespace_node *node, uacpi_object_type *out_type)
 
uacpi_status uacpi_namespace_node_type (const uacpi_namespace_node *node, uacpi_object_type *out_type)
 
uacpi_status uacpi_namespace_node_is_one_of_unlocked (const uacpi_namespace_node *node, uacpi_object_type_bits type_mask, uacpi_bool *out)
 
uacpi_status uacpi_namespace_node_is_one_of (const uacpi_namespace_node *node, uacpi_object_type_bits type_mask, uacpi_bool *out)
 
uacpi_status uacpi_namespace_node_is (const uacpi_namespace_node *node, uacpi_object_type type, uacpi_bool *out)
 
uacpi_status uacpi_namespace_do_for_each_child (uacpi_namespace_node *node, uacpi_iteration_callback descending_callback, uacpi_iteration_callback ascending_callback, uacpi_object_type_bits type_mask, uacpi_u32 max_depth, enum uacpi_should_lock should_lock, enum uacpi_permanent_only permanent_only, void *user)
 
uacpi_status uacpi_namespace_for_each_child_simple (uacpi_namespace_node *parent, uacpi_iteration_callback callback, void *user)
 
uacpi_status uacpi_namespace_for_each_child (uacpi_namespace_node *parent, uacpi_iteration_callback descending_callback, uacpi_iteration_callback ascending_callback, uacpi_object_type_bits type_mask, uacpi_u32 max_depth, void *user)
 
uacpi_status uacpi_namespace_node_next_typed_unlocked (uacpi_namespace_node *parent, uacpi_namespace_node **iter, uacpi_object_type_bits type_mask)
 
uacpi_status uacpi_namespace_node_next_typed (uacpi_namespace_node *parent, uacpi_namespace_node **iter, uacpi_object_type_bits type_mask)
 
uacpi_status uacpi_namespace_node_next (uacpi_namespace_node *parent, uacpi_namespace_node **iter)
 
uacpi_size uacpi_namespace_node_depth (const uacpi_namespace_node *node)
 
uacpi_namespace_node * uacpi_namespace_node_parent (uacpi_namespace_node *node)
 
const uacpi_char * uacpi_namespace_node_generate_absolute_path (const uacpi_namespace_node *node)
 
void uacpi_free_absolute_path (const uacpi_char *path)
 

Variables

static uacpi_namespace_node predefined_namespaces [UACPI_PREDEFINED_NAMESPACE_MAX+1]
 
static struct uacpi_rw_lock namespace_lock
 

Macro Definition Documentation

◆ MAKE_PREDEFINED

#define MAKE_PREDEFINED (   c0,
  c1,
  c2,
  c3 
)     { .name.text = { c0, c1, c2, c3 } }

Definition at line 17 of file namespace.c.

◆ UACPI_OS_VALUE

#define UACPI_OS_VALUE   "Microsoft Windows NT"

Definition at line 15 of file namespace.c.

◆ UACPI_REV_VALUE

#define UACPI_REV_VALUE   2

Definition at line 14 of file namespace.c.

Enumeration Type Documentation

◆ action

Enumerator
ACTION_REACQUIRE 
ACTION_PUT 

Definition at line 714 of file namespace.c.

714 {
717};
@ ACTION_REACQUIRE
Definition: namespace.c:715
@ ACTION_PUT
Definition: namespace.c:716

Function Documentation

◆ free_namespace_node()

static void free_namespace_node ( uacpi_handle  handle)
static

Definition at line 140 of file namespace.c.

141{
143
145 uacpi_free(node, sizeof(*node));
146 return;
147 }
148
149 node->flags = 0;
150 node->object = UACPI_NULL;
151 node->parent = UACPI_NULL;
152 node->child = UACPI_NULL;
154}
#define uacpi_free(mem, _)
Definition: stdlib.h:96
#define uacpi_likely(expr)
Definition: compiler.h:89
#define UACPI_NULL
Definition: types.h:33
uacpi_bool uacpi_namespace_node_is_predefined(uacpi_namespace_node *node)
Definition: namespace.c:350
Definition: dlist.c:348
void * next
Definition: dlist.c:360

Referenced by uacpi_deinitialize_namespace(), and uacpi_namespace_node_unref().

◆ make_object_for_predefined()

static uacpi_object * make_object_for_predefined ( enum uacpi_predefined_namespace  ns)
static

Definition at line 56 of file namespace.c.

59{
61
62 switch (ns) {
64 /*
65 * The real root object is stored in the global context, whereas the \
66 * node gets a placeholder uninitialized object instead. This is to
67 * protect against CopyObject(JUNK, \‍), so that all of the opregion and
68 * notify handlers are preserved if AML decides to do that.
69 */
71 if (uacpi_unlikely(g_uacpi_rt_ctx.root_object == UACPI_NULL))
72 return UACPI_NULL;
73
75 break;
76
80 return obj;
81
82 obj->buffer->text = uacpi_kernel_alloc(sizeof(UACPI_OS_VALUE));
83 if (uacpi_unlikely(obj->buffer->text == UACPI_NULL)) {
85 return UACPI_NULL;
86 }
87
88 obj->buffer->size = sizeof(UACPI_OS_VALUE);
89 uacpi_memcpy(obj->buffer->text, UACPI_OS_VALUE, obj->buffer->size);
90 break;
91
95 return obj;
96
97 obj->integer = UACPI_REV_VALUE;
98 break;
99
102 if (uacpi_likely(obj != UACPI_NULL)) {
103 uacpi_shareable_ref(obj->mutex);
104 g_uacpi_rt_ctx.global_lock_mutex = obj->mutex;
105 }
106 break;
107
111 return obj;
112
113 obj->method->native_call = UACPI_TRUE;
114 obj->method->handler = uacpi_osi;
115 obj->method->args = 1;
116 break;
117
118 default:
120 break;
121 }
122
123 return obj;
124}
struct uacpi_runtime_context g_uacpi_rt_ctx
Definition: uacpi.c:18
#define uacpi_memcpy
Definition: stdlib.h:34
uacpi_object * uacpi_create_object(uacpi_object_type type)
Definition: types.c:328
@ UACPI_PREDEFINED_NAMESPACE_REV
Definition: namespace.h:26
@ UACPI_PREDEFINED_NAMESPACE_ROOT
Definition: namespace.h:17
@ UACPI_PREDEFINED_NAMESPACE_OSI
Definition: namespace.h:25
@ UACPI_PREDEFINED_NAMESPACE_GL
Definition: namespace.h:23
@ UACPI_PREDEFINED_NAMESPACE_OS
Definition: namespace.h:24
#define uacpi_unlikely(expr)
Definition: compiler.h:88
#define UACPI_TRUE
Definition: types.h:29
@ UACPI_OBJECT_METHOD
Definition: types.h:119
@ UACPI_OBJECT_STRING
Definition: types.h:113
@ UACPI_OBJECT_DEVICE
Definition: types.h:117
@ UACPI_OBJECT_UNINITIALIZED
Definition: types.h:111
@ UACPI_OBJECT_MUTEX
Definition: types.h:120
@ UACPI_OBJECT_INTEGER
Definition: types.h:112
void uacpi_object_unref(uacpi_object *obj)
Definition: types.c:761
#define UACPI_OS_VALUE
Definition: namespace.c:15
#define UACPI_REV_VALUE
Definition: namespace.c:14
uacpi_status uacpi_osi(uacpi_handle handle, uacpi_object *retval)
Definition: interpreter.c:6566
void * uacpi_kernel_alloc(uacpi_size size)
Definition: uacpiosl.c:111
static uacpi_u32 uacpi_shareable_ref(uacpi_handle handle)
Definition: shareable.h:40
Definition: mxnamespace.c:38

Referenced by uacpi_initialize_namespace().

◆ namespace_node_detach_object()

static void namespace_node_detach_object ( uacpi_namespace_node *  node)
static

Definition at line 126 of file namespace.c.

127{
129
131 if (object != UACPI_NULL) {
134
135 uacpi_object_unref(node->object);
136 node->object = UACPI_NULL;
137 }
138}
@ UACPI_OBJECT_OPERATION_REGION
Definition: types.h:121
uacpi_object * uacpi_namespace_node_get_object(const uacpi_namespace_node *node)
Definition: namespace.c:653
void uacpi_opregion_uninstall_handler(uacpi_namespace_node *node)
Definition: opregion.c:492
enum object_type type

Referenced by uacpi_deinitialize_namespace(), and uacpi_namespace_node_uninstall().

◆ object_mutate_refcount()

static uacpi_status object_mutate_refcount ( uacpi_object *  obj,
void(*)(uacpi_object *)  cb 
)
static

Definition at line 719 of file namespace.c.

722{
724
726 cb(obj);
727 return ret;
728 }
729
730 /*
731 * Reference objects must be (un)referenced under at least a read lock, as
732 * this requires walking down the entire reference chain and dropping each
733 * object ref-count by 1. This might race with the interpreter and
734 * object_replace_child in case an object in the chain is CopyObject'ed
735 * into.
736 */
739 return ret;
740
741 cb(obj);
742
744 return ret;
745}
static MonoProfilerRuntimeShutdownBeginCallback cb
Definition: metahost.c:118
#define uacpi_unlikely_error(expr)
Definition: status.h:50
uacpi_status
Definition: status.h:10
@ UACPI_STATUS_OK
Definition: status.h:11
@ UACPI_OBJECT_REFERENCE
Definition: types.h:128
uacpi_bool uacpi_object_is(uacpi_object *, uacpi_object_type)
Definition: types.c:991
return ret
Definition: mutex.c:147
uacpi_status uacpi_namespace_read_unlock(void)
Definition: namespace.c:41
uacpi_status uacpi_namespace_read_lock(void)
Definition: namespace.c:36

Referenced by uacpi_namespace_node_reacquire_object(), and uacpi_namespace_node_release_object().

◆ segment_to_name()

static uacpi_object_name segment_to_name ( const uacpi_char **  string,
uacpi_size *  in_out_size 
)
static

Definition at line 475 of file namespace.c.

478{
479 uacpi_object_name out_name;
480 const uacpi_char *cursor = *string;
481 uacpi_size offset, bytes_left = *in_out_size;
482
483 for (offset = 0; offset < 4; offset++) {
484 if (bytes_left < 1 || *cursor == '.') {
485 out_name.text[offset] = '_';
486 continue;
487 }
488
489 out_name.text[offset] = *cursor++;
490 bytes_left--;
491 }
492
493 *string = cursor;
494 *in_out_size = bytes_left;
495 return out_name;
496}
size_t uacpi_size
Definition: types.h:37
char uacpi_char
Definition: types.h:44
GLintptr offset
Definition: glext.h:5920
const char cursor[]
Definition: icontest.c:13
char string[160]
Definition: util.h:11
uacpi_char text[4]
Definition: types.h:24

Referenced by uacpi_namespace_node_resolve().

◆ uacpi_deinitialize_namespace()

void uacpi_deinitialize_namespace ( void  )

Definition at line 205 of file namespace.c.

206{
209 uacpi_u32 depth = 1;
210
212
214
215 while (depth) {
216 next = next == UACPI_NULL ? current->child : next->next;
217
218 /*
219 * The previous value of 'next' was the last child of this subtree,
220 * we can now remove the entire scope of 'current->child'
221 */
222 if (next == UACPI_NULL) {
223 depth--;
224
225 // Wipe the subtree
226 while (current->child != UACPI_NULL)
228
229 // Reset the pointers back as if this iteration never happened
230 next = current;
231 current = current->parent;
232
233 continue;
234 }
235
236 /*
237 * We have more nodes to process, proceed to the next one, either the
238 * child of the 'next' node, if one exists, or its peer
239 */
240 if (next->child) {
241 depth++;
242 current = next;
244 }
245
246 // This node has no children, move on to its peer
247 }
248
251
252 if (ret == UACPI_STATUS_OK)
254
256 g_uacpi_rt_ctx.root_object = UACPI_NULL;
257
258 uacpi_mutex_unref(g_uacpi_rt_ctx.global_lock_mutex);
259 g_uacpi_rt_ctx.global_lock_mutex = UACPI_NULL;
260
262}
uacpi_status uacpi_rw_lock_deinit(struct uacpi_rw_lock *lock)
Definition: mutex.c:331
void uacpi_mutex_unref(uacpi_mutex *)
Definition: types.c:496
uint32_t uacpi_u32
Definition: types.h:21
uacpi_status uacpi_namespace_write_unlock(void)
Definition: namespace.c:51
static void free_namespace_node(uacpi_handle handle)
Definition: namespace.c:140
static struct uacpi_rw_lock namespace_lock
Definition: namespace.c:34
uacpi_status uacpi_namespace_node_uninstall(uacpi_namespace_node *node)
Definition: namespace.c:356
uacpi_namespace_node * uacpi_namespace_root(void)
Definition: namespace.c:264
uacpi_status uacpi_namespace_write_lock(void)
Definition: namespace.c:46
static void namespace_node_detach_object(uacpi_namespace_node *node)
Definition: namespace.c:126
GLint GLint GLsizei GLsizei GLsizei depth
Definition: gl.h:1546
struct task_struct * current
Definition: linux.c:32
PSYMCRYPT_PARALLEL_HASH_OPERATION next
PSYMCRYPT_PARALLEL_HASH_OPERATION next

Referenced by uacpi_state_reset().

◆ uacpi_free_absolute_path()

void uacpi_free_absolute_path ( const uacpi_char *  path)

Definition at line 1093 of file namespace.c.

1094{
1096}
void uacpi_free_dynamic_string(const uacpi_char *str)
Definition: utilities.c:1148

Referenced by exec_op().

◆ uacpi_initialize_namespace()

uacpi_status uacpi_initialize_namespace ( void  )

Definition at line 156 of file namespace.c.

157{
162
165 return ret;
166
167 for (ns = 0; ns <= UACPI_PREDEFINED_NAMESPACE_MAX; ns++) {
170
174
177 );
178 if (uacpi_unlikely(node->object == UACPI_NULL)) {
181 }
182
184 }
185
188
189 /*
190 * Skip the installation of \_OSI if it was disabled by user.
191 * We still create the object, but it's not attached to the namespace.
192 */
195 continue;
196
199 );
200 }
201
202 return UACPI_STATUS_OK;
203}
uacpi_status uacpi_rw_lock_init(struct uacpi_rw_lock *lock)
Definition: mutex.c:314
static uacpi_bool uacpi_check_flag(uacpi_u64 flag)
Definition: context.h:90
struct uacpi_object * uacpi_create_internal_reference(enum uacpi_reference_kind kind, uacpi_object *child)
Definition: types.c:1456
@ UACPI_REFERENCE_KIND_NAMED
Definition: types.h:14
uacpi_predefined_namespace
Definition: namespace.h:16
@ UACPI_PREDEFINED_NAMESPACE_GPE
Definition: namespace.h:18
@ UACPI_PREDEFINED_NAMESPACE_MAX
Definition: namespace.h:27
@ UACPI_STATUS_OUT_OF_MEMORY
Definition: status.h:13
static uacpi_object * make_object_for_predefined(enum uacpi_predefined_namespace ns)
Definition: namespace.c:56
uacpi_status uacpi_namespace_node_install(uacpi_namespace_node *parent, uacpi_namespace_node *node)
Definition: namespace.c:299
static uacpi_namespace_node predefined_namespaces[UACPI_PREDEFINED_NAMESPACE_MAX+1]
Definition: namespace.c:21
static void uacpi_shareable_init(uacpi_handle handle)
Definition: shareable.h:14
#define UACPI_FLAG_NO_OSI
Definition: uacpi.h:100

Referenced by uacpi_initialize().

◆ uacpi_namespace_do_for_each_child()

uacpi_status uacpi_namespace_do_for_each_child ( uacpi_namespace_node *  node,
uacpi_iteration_callback  descending_callback,
uacpi_iteration_callback  ascending_callback,
uacpi_object_type_bits  type_mask,
uacpi_u32  max_depth,
enum uacpi_should_lock  should_lock,
enum uacpi_permanent_only  permanent_only,
void *  user 
)

Definition at line 841 of file namespace.c.

848{
853 uacpi_u32 depth = 1;
854
856
857 if (uacpi_unlikely(descending_callback == UACPI_NULL &&
858 ascending_callback == UACPI_NULL))
860
861 if (uacpi_unlikely(node == UACPI_NULL || max_depth == 0))
863
864 if (should_lock == UACPI_SHOULD_LOCK_YES) {
867 return ret;
868 }
869
870 if (node->child == UACPI_NULL)
871 goto out;
872
873 node = node->child;
874
875 while (depth) {
877 if (!matches) {
879 goto do_next;
880 }
881
882 if (permanent_only == UACPI_PERMANENT_ONLY_YES &&
885 goto do_next;
886 }
887
888 cb = walking_up ? ascending_callback : descending_callback;
889 if (cb != UACPI_NULL) {
890 if (should_lock == UACPI_SHOULD_LOCK_YES) {
893 return ret;
894 }
895
896 decision = cb(user, node, depth);
897 if (decision == UACPI_ITERATION_DECISION_BREAK)
898 return ret;
899
900 if (should_lock == UACPI_SHOULD_LOCK_YES) {
903 return ret;
904 }
905 } else {
907 }
908
909 do_next:
910 if (walking_up) {
911 if (node->next) {
912 node = node->next;
913 walking_up = UACPI_FALSE;
914 continue;
915 }
916
917 depth--;
918 node = node->parent;
919 continue;
920 }
921
922 switch (decision) {
924 if ((depth != max_depth) && (node->child != UACPI_NULL)) {
925 node = node->child;
926 depth++;
927 continue;
928 }
931 walking_up = UACPI_TRUE;
932 continue;
933 default:
935 goto out;
936 }
937 }
938
939out:
940 if (should_lock == UACPI_SHOULD_LOCK_YES)
942 return ret;
943}
void user(int argc, const char *argv[])
Definition: cmds.c:1350
#define UACPI_ENSURE_INIT_LEVEL_AT_LEAST(lvl)
Definition: context.h:127
@ UACPI_PERMANENT_ONLY_YES
Definition: namespace.h:94
@ UACPI_SHOULD_LOCK_YES
Definition: namespace.h:99
uacpi_iteration_decision(* uacpi_iteration_callback)(void *user, uacpi_namespace_node *node, uacpi_u32 node_depth)
Definition: namespace.h:98
#define UACPI_FALLTHROUGH
Definition: compiler.h:100
bool uacpi_bool
Definition: types.h:31
#define UACPI_FALSE
Definition: types.h:30
@ UACPI_STATUS_INVALID_ARGUMENT
Definition: status.h:18
uacpi_iteration_decision
Definition: types.h:28
@ UACPI_ITERATION_DECISION_BREAK
Definition: types.h:30
@ UACPI_ITERATION_DECISION_NEXT_PEER
Definition: types.h:39
@ UACPI_ITERATION_DECISION_CONTINUE
Definition: types.h:29
@ UACPI_INIT_LEVEL_SUBSYSTEM_INITIALIZED
Definition: types.h:72
uacpi_bool uacpi_namespace_node_is_temporary(uacpi_namespace_node *node)
Definition: namespace.c:345
uacpi_status uacpi_namespace_node_is_one_of_unlocked(const uacpi_namespace_node *node, uacpi_object_type_bits type_mask, uacpi_bool *out)
Definition: namespace.c:797
#define matches(FN)
Definition: match.h:70
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
Definition: wcsftime.cpp:383

Referenced by create_gpe_block(), object_replace_child(), reg_all_opregions(), run_orphan_ec_regs(), uacpi_events_match_post_dynamic_table_load(), uacpi_install_address_space_handler_with_flags(), uacpi_namespace_for_each_child(), uacpi_namespace_for_each_child_simple(), and uacpi_uninstall_address_space_handler().

◆ uacpi_namespace_for_each_child()

uacpi_status uacpi_namespace_for_each_child ( uacpi_namespace_node *  parent,
uacpi_iteration_callback  descending_callback,
uacpi_iteration_callback  ascending_callback,
uacpi_object_type_bits  type_mask,
uacpi_u32  max_depth,
void *  user 
)

Depth-first iterate the namespace starting at the first child of 'parent'.

'descending_callback' is invoked the first time a node is visited when walking down. 'ascending_callback' is invoked the second time a node is visited after we reach the leaf node without children and start walking up. Either of the callbacks may be NULL, but not both at the same time.

Only nodes matching 'type_mask' are passed to the callbacks.

'max_depth' is used to limit the maximum reachable depth from 'parent', where 1 is only direct children of 'parent', 2 is children of first-level children etc. Use UACPI_MAX_DEPTH_ANY or -1 to specify infinite depth.

Definition at line 955 of file namespace.c.

960{
962 parent, descending_callback, ascending_callback, type_mask, max_depth,
964 );
965}
uacpi_status uacpi_namespace_do_for_each_child(uacpi_namespace_node *node, uacpi_iteration_callback descending_callback, uacpi_iteration_callback ascending_callback, uacpi_object_type_bits type_mask, uacpi_u32 max_depth, enum uacpi_should_lock should_lock, enum uacpi_permanent_only permanent_only, void *user)
Definition: namespace.c:841
r parent
Definition: btrfs.c:3010

Referenced by uacpi_find_devices_at(), and uacpi_namespace_initialize().

◆ uacpi_namespace_for_each_child_simple()

uacpi_status uacpi_namespace_for_each_child_simple ( uacpi_namespace_node *  parent,
uacpi_iteration_callback  callback,
void *  user 
)

Depth-first iterate the namespace starting at the first child of 'parent'.

Definition at line 945 of file namespace.c.

948{
952 );
953}
#define UACPI_MAX_DEPTH_ANY
Definition: namespace.h:102
@ UACPI_OBJECT_ANY_BIT
Definition: types.h:152
static IPrintDialogCallback callback
Definition: printdlg.c:325

◆ uacpi_namespace_get_predefined()

uacpi_namespace_node * uacpi_namespace_get_predefined ( enum uacpi_predefined_namespace  ns)

Definition at line 269 of file namespace.c.

272{
274 uacpi_warn("requested invalid predefined namespace %u", ns);
275 return UACPI_NULL;
276 }
277
278 return &predefined_namespaces[ns];
279}
#define uacpi_warn(...)
Definition: log.h:35

Referenced by do_sta_ini(), eval_sst(), initialize_gpes(), sanitize_device_and_find_gpe(), and uacpi_namespace_initialize().

◆ uacpi_namespace_node_acquire_object()

uacpi_status uacpi_namespace_node_acquire_object ( const uacpi_namespace_node *  node,
uacpi_object **  out_obj 
)

Definition at line 705 of file namespace.c.

708{
710 node, UACPI_OBJECT_ANY_BIT, out_obj
711 );
712}
uacpi_status uacpi_namespace_node_acquire_object_typed(const uacpi_namespace_node *node, uacpi_object_type_bits type_mask, uacpi_object **out_obj)
Definition: namespace.c:677

◆ uacpi_namespace_node_acquire_object_typed()

uacpi_status uacpi_namespace_node_acquire_object_typed ( const uacpi_namespace_node *  node,
uacpi_object_type_bits  type_mask,
uacpi_object **  out_obj 
)

Definition at line 677 of file namespace.c.

681{
684
687 return ret;
688
690
691 if (uacpi_unlikely(obj == UACPI_NULL) ||
692 !uacpi_object_is_one_of(obj, type_mask)) {
694 goto out;
695 }
696
698 *out_obj = obj;
699
700out:
702 return ret;
703}
void uacpi_object_ref(uacpi_object *obj)
Definition: types.c:733
uacpi_bool uacpi_object_is_one_of(uacpi_object *, uacpi_object_type_bits type_mask)
Definition: types.c:996

Referenced by uacpi_install_notify_handler(), uacpi_namespace_node_acquire_object(), and uacpi_uninstall_notify_handler().

◆ uacpi_namespace_node_alloc()

uacpi_namespace_node * uacpi_namespace_node_alloc ( uacpi_object_name  name)

Definition at line 281 of file namespace.c.

282{
284
287 return ret;
288
290 ret->name = name;
291 return ret;
292}
#define uacpi_kernel_alloc_zeroed
Definition: stdlib.h:127
Definition: name.c:39

Referenced by resolve_name_string().

◆ uacpi_namespace_node_depth()

uacpi_size uacpi_namespace_node_depth ( const uacpi_namespace_node *  node)

Definition at line 1034 of file namespace.c.

1035{
1036 uacpi_size depth = 0;
1037
1038 while (node->parent) {
1039 depth++;
1040 node = node->parent;
1041 }
1042
1043 return depth;
1044}

Referenced by uacpi_namespace_node_generate_absolute_path().

◆ uacpi_namespace_node_find()

uacpi_status uacpi_namespace_node_find ( uacpi_namespace_node *  parent,
const uacpi_char *  path,
uacpi_namespace_node **  out_node 
)

Definition at line 630 of file namespace.c.

634{
638 );
639}
@ UACPI_MAY_SEARCH_ABOVE_PARENT_NO
Definition: namespace.h:88
uacpi_status uacpi_namespace_node_resolve(uacpi_namespace_node *parent, const uacpi_char *path, enum uacpi_should_lock should_lock, enum uacpi_may_search_above_parent may_search_above_parent, enum uacpi_permanent_only permanent_only, uacpi_namespace_node **out_node)
Definition: namespace.c:498

◆ uacpi_namespace_node_find_sub_node()

uacpi_namespace_node * uacpi_namespace_node_find_sub_node ( uacpi_namespace_node *  parent,
uacpi_object_name  name 
)

Definition at line 453 of file namespace.c.

457{
459
460 if (parent == UACPI_NULL)
462
463 node = parent->child;
464
465 while (node) {
466 if (node->name.id == name.id)
467 return node;
468
469 node = node->next;
470 }
471
472 return UACPI_NULL;
473}

Referenced by resolve_name_string(), and uacpi_namespace_node_resolve().

◆ uacpi_namespace_node_generate_absolute_path()

const uacpi_char * uacpi_namespace_node_generate_absolute_path ( const uacpi_namespace_node *  node)

Definition at line 1053 of file namespace.c.

1056{
1058 uacpi_size bytes_needed;
1060
1062
1063 // \ only needs 1 byte, the rest is 4 bytes
1064 bytes_needed = 1 + (depth - 1) * sizeof(uacpi_object_name);
1065
1066 // \ and the first NAME don't need a '.', every other segment does
1067 bytes_needed += depth > 2 ? depth - 2 : 0;
1068
1069 // Null terminator
1070 bytes_needed += 1;
1071
1072 path = uacpi_kernel_alloc(bytes_needed);
1074 return path;
1075
1076 path[0] = '\\';
1077
1078 offset = bytes_needed - 1;
1079 path[offset] = '\0';
1080
1081 while (node != uacpi_namespace_root()) {
1082 offset -= sizeof(uacpi_object_name);
1083 uacpi_memcpy(&path[offset], node->name.text, sizeof(uacpi_object_name));
1084
1085 node = node->parent;
1086 if (node != uacpi_namespace_root())
1087 path[--offset] = '.';
1088 }
1089
1090 return path;
1091}
uacpi_size uacpi_namespace_node_depth(const uacpi_namespace_node *node)
Definition: namespace.c:1034

Referenced by exec_op(), handle_notify(), run_reg(), trace_invalid_return_type(), trace_method_abort(), trace_named_object_lookup_or_creation_failure(), trace_region_io(), uacpi_dispatch_opregion_io(), uacpi_eval_dstate_method_template(), and uacpi_trace_region_error().

◆ uacpi_namespace_node_get_object()

◆ uacpi_namespace_node_get_object_typed()

◆ uacpi_namespace_node_install()

uacpi_status uacpi_namespace_node_install ( uacpi_namespace_node *  parent,
uacpi_namespace_node *  node 
)

Definition at line 299 of file namespace.c.

303{
304 if (parent == UACPI_NULL)
306
308 uacpi_warn("attempting to install a dangling namespace node %.4s",
309 node->name.text);
311 }
312
313 if (parent->child == UACPI_NULL) {
314 parent->child = node;
315 } else {
316 uacpi_namespace_node *prev = parent->child;
317
318 for (;;) {
319 if (uacpi_unlikely(prev->name.id == node->name.id))
321
322 if (prev->next == UACPI_NULL)
323 break;
324
325 prev = prev->next;
326 }
327
328 prev->next = node;
329 }
330
331 node->parent = parent;
332 return UACPI_STATUS_OK;
333}
@ UACPI_STATUS_AML_OBJECT_ALREADY_EXISTS
Definition: status.h:36
@ UACPI_STATUS_NAMESPACE_NODE_DANGLING
Definition: status.h:24
uacpi_bool uacpi_namespace_node_is_dangling(uacpi_namespace_node *node)
Definition: namespace.c:340
uacpi_object_name name
Definition: namespace.h:29
struct uacpi_namespace_node * next
Definition: namespace.h:34
uacpi_u32 id
Definition: types.h:25

Referenced by do_install_node_item(), and uacpi_initialize_namespace().

◆ uacpi_namespace_node_is()

uacpi_status uacpi_namespace_node_is ( const uacpi_namespace_node *  node,
uacpi_object_type  type,
uacpi_bool *  out 
)

Returns UACPI_TRUE via 'out' if the type of the object stored at the namespace node matches the provided value, UACPI_FALSE otherwise.

NOTE: due to the existance of the CopyObject operator in AML, the return value of this function is subject to TOCTOU bugs.

Definition at line 832 of file namespace.c.

835{
837 node, 1u << type, out
838 );
839}
uacpi_status uacpi_namespace_node_is_one_of(const uacpi_namespace_node *node, uacpi_object_type_bits type_mask, uacpi_bool *out)
Definition: namespace.c:815
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545

Referenced by eval_resource_helper(), uacpi_install_gpe_block(), uacpi_setup_gpe_for_wake(), and uacpi_uninstall_gpe_block().

◆ uacpi_namespace_node_is_alias()

uacpi_bool uacpi_namespace_node_is_alias ( uacpi_namespace_node *  node)

Returns UACPI_TRUE if the provided 'node' is an alias.

Definition at line 335 of file namespace.c.

336{
338}
#define UACPI_NAMESPACE_NODE_FLAG_ALIAS
Definition: namespace.h:10

Referenced by do_sta_ini().

◆ uacpi_namespace_node_is_dangling()

uacpi_bool uacpi_namespace_node_is_dangling ( uacpi_namespace_node *  node)

Definition at line 340 of file namespace.c.

341{
343}
#define UACPI_NAMESPACE_NODE_FLAG_DANGLING
Definition: namespace.h:19

Referenced by uacpi_namespace_node_install(), uacpi_namespace_node_uninstall(), and uacpi_opregion_attach().

◆ uacpi_namespace_node_is_one_of()

uacpi_status uacpi_namespace_node_is_one_of ( const uacpi_namespace_node *  node,
uacpi_object_type_bits  type_mask,
uacpi_bool *  out 
)

Returns UACPI_TRUE via 'out' if the type of the object stored at the namespace node matches any of the type bits in the provided value, UACPI_FALSE otherwise.

NOTE: due to the existance of the CopyObject operator in AML, the return value of this function is subject to TOCTOU bugs.

Definition at line 815 of file namespace.c.

819{
821
824 return ret;
825
827
829 return ret;
830}

Referenced by uacpi_namespace_node_is().

◆ uacpi_namespace_node_is_one_of_unlocked()

uacpi_status uacpi_namespace_node_is_one_of_unlocked ( const uacpi_namespace_node *  node,
uacpi_object_type_bits  type_mask,
uacpi_bool *  out 
)

◆ uacpi_namespace_node_is_predefined()

uacpi_bool uacpi_namespace_node_is_predefined ( uacpi_namespace_node *  node)

Definition at line 350 of file namespace.c.

Referenced by free_namespace_node().

◆ uacpi_namespace_node_is_temporary()

uacpi_bool uacpi_namespace_node_is_temporary ( uacpi_namespace_node *  node)

Definition at line 345 of file namespace.c.

346{
348}
#define UACPI_NAMESPACE_NODE_FLAG_TEMPORARY
Definition: namespace.h:25

Referenced by uacpi_namespace_do_for_each_child(), uacpi_namespace_node_next_typed_unlocked(), and uacpi_namespace_node_resolve().

◆ uacpi_namespace_node_name()

uacpi_object_name uacpi_namespace_node_name ( const uacpi_namespace_node *  node)

Definition at line 759 of file namespace.c.

760{
761 return node->name;
762}

Referenced by async_run_gpe_handler(), uacpi_eval_cid(), uacpi_eval_hid(), uacpi_eval_uid(), and uacpi_get_namespace_node_info().

◆ uacpi_namespace_node_next()

uacpi_status uacpi_namespace_node_next ( uacpi_namespace_node *  parent,
uacpi_namespace_node **  iter 
)

Retrieve the next peer namespace node of '*iter', or, if '*iter' is UACPI_NULL, retrieve the first child of 'parent' instead. The resulting namespace node is stored at '*iter'.

This API can be used to implement an "iterator" version of the for_each_child helpers.

Example usage: void recurse(uacpi_namespace_node *parent) { uacpi_namespace_node *iter = UACPI_NULL;

while (uacpi_namespace_node_next(parent, &iter) == UACPI_STATUS_OK) { // Do something with iter... descending_callback(iter);

// Recurse down to walk over the children of iter recurse(iter); } }

Prefer the for_each_child family of helpers if possible instead of this API as they avoid recursion and/or the need to use dynamic data structures entirely.

Definition at line 1025 of file namespace.c.

1028{
1031 );
1032}
uacpi_status uacpi_namespace_node_next_typed(uacpi_namespace_node *parent, uacpi_namespace_node **iter, uacpi_object_type_bits type_mask)
Definition: namespace.c:1003

◆ uacpi_namespace_node_next_typed()

uacpi_status uacpi_namespace_node_next_typed ( uacpi_namespace_node *  parent,
uacpi_namespace_node **  iter,
uacpi_object_type_bits  type_mask 
)

Retrieve the next peer namespace node of '*iter', or, if '*iter' is UACPI_NULL, retrieve the first child of 'parent' instead. The resulting namespace node is stored at '*iter'. Only nodes which type matches one of the types set in 'type_mask' are returned.

See comment above 'uacpi_namespace_node_next' for usage examples.

Prefer the for_each_child family of helpers if possible instead of this API as they avoid recursion and/or the need to use dynamic data structures entirely.

Definition at line 1003 of file namespace.c.

1007{
1009
1011
1012 if (uacpi_unlikely(parent == UACPI_NULL && *iter == UACPI_NULL))
1014
1017 return ret;
1018
1020
1022 return ret;
1023}
uacpi_status uacpi_namespace_node_next_typed_unlocked(uacpi_namespace_node *parent, uacpi_namespace_node **iter, uacpi_object_type_bits type_mask)
Definition: namespace.c:967

Referenced by uacpi_namespace_node_next().

◆ uacpi_namespace_node_next_typed_unlocked()

uacpi_status uacpi_namespace_node_next_typed_unlocked ( uacpi_namespace_node *  parent,
uacpi_namespace_node **  iter,
uacpi_object_type_bits  type_mask 
)

Definition at line 967 of file namespace.c.

971{
975
976 node = *iter;
977 if (node == UACPI_NULL)
978 node = parent->child;
979 else
980 node = node->next;
981
982 for (; node != UACPI_NULL; node = node->next) {
984 continue;
985
987 node, type_mask, &is_one_of
988 );
990 break;
991 if (is_one_of)
992 break;
993 }
994
995 if (node == UACPI_NULL)
997
999 *iter = node;
1000 return ret;
1001}
#define uacpi_likely_success(expr)
Definition: status.h:54
static uacpi_bool is_one_of(uacpi_char c, const uacpi_char *list)
Definition: stdlib.c:436

Referenced by run_orphan_reg(), and uacpi_namespace_node_next_typed().

◆ uacpi_namespace_node_parent()

uacpi_namespace_node * uacpi_namespace_node_parent ( uacpi_namespace_node *  node)

Definition at line 1046 of file namespace.c.

1049{
1050 return node->parent;
1051}

◆ uacpi_namespace_node_reacquire_object()

uacpi_status uacpi_namespace_node_reacquire_object ( uacpi_object *  obj)

Definition at line 747 of file namespace.c.

750{
752}
static uacpi_status object_mutate_refcount(uacpi_object *obj, void(*cb)(uacpi_object *))
Definition: namespace.c:719

◆ uacpi_namespace_node_release_object()

uacpi_status uacpi_namespace_node_release_object ( uacpi_object *  obj)

Definition at line 754 of file namespace.c.

Referenced by free_notification_ctx().

◆ uacpi_namespace_node_resolve()

uacpi_status uacpi_namespace_node_resolve ( uacpi_namespace_node *  parent,
const uacpi_char *  path,
enum uacpi_should_lock  should_lock,
enum uacpi_may_search_above_parent  may_search_above_parent,
enum uacpi_permanent_only  permanent_only,
uacpi_namespace_node **  out_node 
)

Definition at line 498 of file namespace.c.

505{
506 uacpi_namespace_node *cur_node = parent;
508 const uacpi_char *cursor = path;
509 uacpi_size bytes_left;
510 uacpi_char prev_char = 0;
511 uacpi_bool single_nameseg = UACPI_TRUE;
512
513 if (cur_node == UACPI_NULL)
514 cur_node = uacpi_namespace_root();
515
516 bytes_left = uacpi_strlen(path);
517
518 if (should_lock == UACPI_SHOULD_LOCK_YES) {
521 return ret;
522 }
523
524 for (;;) {
525 if (bytes_left == 0)
526 goto out;
527
528 switch (*cursor) {
529 case '\\':
530 single_nameseg = UACPI_FALSE;
531
532 if (prev_char == '^') {
534 goto out;
535 }
536
537 cur_node = uacpi_namespace_root();
538 break;
539 case '^':
540 single_nameseg = UACPI_FALSE;
541
542 // Tried to go behind root
543 if (uacpi_unlikely(cur_node == uacpi_namespace_root())) {
545 goto out;
546 }
547
548 cur_node = cur_node->parent;
549 break;
550 default:
551 break;
552 }
553
554 prev_char = *cursor;
555
556 switch (prev_char) {
557 case '^':
558 case '\\':
559 cursor++;
560 bytes_left--;
561 break;
562 default:
563 break;
564 }
565
566 if (prev_char != '^')
567 break;
568 }
569
570 while (bytes_left != 0) {
571 uacpi_object_name nameseg;
572
573 if (*cursor == '.') {
574 cursor++;
575 bytes_left--;
576 }
577
578 nameseg = segment_to_name(&cursor, &bytes_left);
579 if (bytes_left != 0 && single_nameseg)
580 single_nameseg = UACPI_FALSE;
581
582 cur_node = uacpi_namespace_node_find_sub_node(cur_node, nameseg);
583 if (cur_node == UACPI_NULL) {
584 if (may_search_above_parent == UACPI_MAY_SEARCH_ABOVE_PARENT_NO ||
585 !single_nameseg)
586 goto out;
587
588 parent = parent->parent;
589
590 while (parent) {
591 cur_node = uacpi_namespace_node_find_sub_node(parent, nameseg);
592 if (cur_node != UACPI_NULL)
593 goto out;
594
595 parent = parent->parent;
596 }
597
598 goto out;
599 }
600 }
601
602out:
604 uacpi_warn("invalid path '%s'", path);
605 goto out_read_unlock;
606 }
607
608 if (cur_node == UACPI_NULL) {
610 goto out_read_unlock;
611 }
612
613 if (uacpi_namespace_node_is_temporary(cur_node) &&
614 permanent_only == UACPI_PERMANENT_ONLY_YES) {
615 uacpi_warn("denying access to temporary namespace node '%.4s'",
616 cur_node->name.text);
618 goto out_read_unlock;
619 }
620
621 if (out_node != UACPI_NULL)
622 *out_node = cur_node;
623
624out_read_unlock:
625 if (should_lock == UACPI_SHOULD_LOCK_YES)
627 return ret;
628}
uacpi_size uacpi_strlen(const uacpi_char *str)
Definition: stdlib.c:72
@ UACPI_STATUS_DENIED
Definition: status.h:31
static uacpi_object_name segment_to_name(const uacpi_char **string, uacpi_size *in_out_size)
Definition: namespace.c:475
uacpi_namespace_node * uacpi_namespace_node_find_sub_node(uacpi_namespace_node *parent, uacpi_object_name name)
Definition: namespace.c:453
struct uacpi_namespace_node * parent
Definition: namespace.h:32

Referenced by handle_load_table(), run_reg(), uacpi_eval(), uacpi_namespace_node_find(), and uacpi_namespace_node_resolve_from_aml_namepath().

◆ uacpi_namespace_node_resolve_from_aml_namepath()

uacpi_status uacpi_namespace_node_resolve_from_aml_namepath ( uacpi_namespace_node *  scope,
const uacpi_char *  path,
uacpi_namespace_node **  out_node 
)

Same as uacpi_namespace_node_find, except the search recurses upwards when the namepath consists of only a single nameseg. Usually, this behavior is only desired if resolving a namepath specified in an aml-provided object, such as a package element.

Definition at line 641 of file namespace.c.

646{
650 );
651}
@ UACPI_MAY_SEARCH_ABOVE_PARENT_YES
Definition: namespace.h:89

Referenced by uacpi_object_resolve_as_aml_namepath().

◆ uacpi_namespace_node_type()

uacpi_status uacpi_namespace_node_type ( const uacpi_namespace_node *  node,
uacpi_object_type *  out_type 
)

Returns the type of object stored at the namespace node.

NOTE: due to the existance of the CopyObject operator in AML, the return value of this function is subject to TOCTOU bugs.

Definition at line 781 of file namespace.c.

784{
786
789 return ret;
790
792
794 return ret;
795}
uacpi_status uacpi_namespace_node_type_unlocked(const uacpi_namespace_node *node, uacpi_object_type *out_type)
Definition: namespace.c:764

Referenced by do_sta_ini(), pci_region_attach(), and pci_region_collect_devices().

◆ uacpi_namespace_node_type_unlocked()

uacpi_status uacpi_namespace_node_type_unlocked ( const uacpi_namespace_node *  node,
uacpi_object_type *  out_type 
)

Definition at line 764 of file namespace.c.

767{
769
772
776
777 *out_type = obj->type;
778 return UACPI_STATUS_OK;
779}

Referenced by uacpi_namespace_node_type().

◆ uacpi_namespace_node_uninstall()

uacpi_status uacpi_namespace_node_uninstall ( uacpi_namespace_node *  node)

Definition at line 356 of file namespace.c.

357{
359
361 uacpi_warn("attempting to uninstall a dangling namespace node %.4s",
362 node->name.text);
364 }
365
366 /*
367 * The way to trigger this is as follows:
368 *
369 * Method (FOO) {
370 * // Temporary device, will be deleted upon returning from FOO
371 * Device (\BAR) {
372 * }
373 *
374 * //
375 * // Load TBL where TBL is:
376 * // Scope (\BAR) {
377 * // Name (TEST, 123)
378 * // }
379 * //
380 * Load(TBL)
381 * }
382 *
383 * In the above example, TEST is a permanent node attached by bad AML to a
384 * temporary node created inside the FOO method at \BAR. The cleanup code
385 * will attempt to remove the \BAR device upon exit from FOO, but that is
386 * no longer possible as there's now a permanent child attached to it.
387 */
388 if (uacpi_unlikely(node->child != UACPI_NULL)) {
390 "refusing to uninstall node %.4s with a child (%.4s)",
391 node->name.text, node->child->name.text
392 );
393 return UACPI_STATUS_DENIED;
394 }
395
396 /*
397 * Even though namespace_node is reference-counted it still has an 'invalid'
398 * state that is entered after it is uninstalled from the global namespace.
399 *
400 * Reference counting is only needed to combat dangling pointer issues
401 * whereas bad AML might try to prolong a local object lifetime by
402 * returning it from a method, or CopyObject it somewhere. In that case the
403 * namespace node object itself is still alive, but no longer has a valid
404 * object associated with it.
405 *
406 * Example:
407 * Method (BAD) {
408 * OperationRegion(REG, SystemMemory, 0xDEADBEEF, 4)
409 * Field (REG, AnyAcc, NoLock) {
410 * FILD, 8,
411 * }
412 *
413 * Return (RefOf(FILD))
414 * }
415 *
416 * // Local0 is now the sole owner of the 'FILD' object that under the
417 * // hood is still referencing the 'REG' operation region object from
418 * // the 'BAD' method.
419 * Local0 = DerefOf(BAD())
420 *
421 * This is done to prevent potential very deep recursion where an object
422 * frees a namespace node that frees an attached object that frees a
423 * namespace node as well as potential infinite cycles between a namespace
424 * node and an object.
425 */
427
428 prev = node->parent ? node->parent->child : UACPI_NULL;
429
430 if (prev == node) {
431 node->parent->child = node->next;
432 } else {
433 while (uacpi_likely(prev != UACPI_NULL) && prev->next != node)
434 prev = prev->next;
435
436 if (uacpi_unlikely(prev == UACPI_NULL)) {
438 "trying to uninstall a node %.4s (%p) not linked to any peer",
439 node->name.text, node
440 );
442 }
443
444 prev->next = node->next;
445 }
446
449
450 return UACPI_STATUS_OK;
451}
@ UACPI_STATUS_INTERNAL_ERROR
Definition: status.h:21
void uacpi_namespace_node_unref(uacpi_namespace_node *node)
Definition: namespace.c:294

Referenced by call_frame_clear(), and uacpi_deinitialize_namespace().

◆ uacpi_namespace_node_unref()

void uacpi_namespace_node_unref ( uacpi_namespace_node *  node)

Definition at line 294 of file namespace.c.

295{
297}
static void uacpi_shareable_unref_and_delete_if_last(uacpi_handle handle, void(*do_free)(uacpi_handle))
Definition: shareable.h:60

Referenced by exec_op(), free_field_unit(), free_notification_ctx(), pop_item(), region_uninstall_handler(), and uacpi_namespace_node_uninstall().

◆ uacpi_namespace_read_lock()

◆ uacpi_namespace_read_unlock()

◆ uacpi_namespace_root()

◆ uacpi_namespace_write_lock()

◆ uacpi_namespace_write_unlock()

Variable Documentation

◆ namespace_lock

◆ predefined_namespaces

uacpi_namespace_node predefined_namespaces[UACPI_PREDEFINED_NAMESPACE_MAX+1]
static
Initial value:
= {
}
@ UACPI_PREDEFINED_NAMESPACE_PR
Definition: namespace.h:19
@ UACPI_PREDEFINED_NAMESPACE_SB
Definition: namespace.h:20
@ UACPI_PREDEFINED_NAMESPACE_SI
Definition: namespace.h:21
@ UACPI_PREDEFINED_NAMESPACE_TZ
Definition: namespace.h:22
#define MAKE_PREDEFINED(c0, c1, c2, c3)
Definition: namespace.c:17

Definition at line 21 of file namespace.c.

Referenced by uacpi_initialize_namespace(), uacpi_namespace_get_predefined(), uacpi_namespace_node_is_predefined(), and uacpi_namespace_root().