1#pragma once
2
3#include <uacpi/types.h>
4#include <uacpi/status.h>
5#include <uacpi/namespace.h>
6
7#define UACPI_NAMESPACE_NODE_FLAG_ALIAS (1 << 0)
8
9/*
10 * This node has been uninstalled and has no object associated with it.
11 *
12 * This is used to handle edge cases where an object needs to reference
13 * a namespace node, where the node might end up going out of scope before
14 * the object lifetime ends.
15 */
16#define UACPI_NAMESPACE_NODE_FLAG_DANGLING (1 << 1)
17
18typedef struct uacpi_namespace_node {
19 struct uacpi_shareable shareable;
20 uacpi_object_name name;
21 uacpi_u32 flags;
22 uacpi_object *object;
23 struct uacpi_namespace_node *parent;
24 struct uacpi_namespace_node *child;
25 struct uacpi_namespace_node *next;
26} uacpi_namespace_node;
27
28uacpi_status uacpi_namespace_initialize_predefined(void);
29
30uacpi_namespace_node *uacpi_namespace_node_alloc(uacpi_object_name name);
31void uacpi_namespace_node_unref(uacpi_namespace_node *node);
32
33uacpi_status uacpi_node_install(uacpi_namespace_node *parent, uacpi_namespace_node *node);
34void uacpi_node_uninstall(uacpi_namespace_node *node);
35
36uacpi_namespace_node *uacpi_namespace_node_find_sub_node(
37 uacpi_namespace_node *parent,
38 uacpi_object_name name
39);
40
41uacpi_bool uacpi_namespace_node_is_dangling(uacpi_namespace_node *node);
42