1#include <asm.h>
2#include <console/printf.h>
3#include <mem/vmm.h>
4#include <string.h>
5#include <types/types.h>
6#include <uacpi/acpi.h>
7#include <uacpi/namespace.h>
8#include <uacpi/status.h>
9#include <uacpi/tables.h>
10#include <uacpi/uacpi.h>
11
12static uacpi_iteration_decision
13walk_callback(void *, uacpi_namespace_node *node, uacpi_u32) {
14 char name[5] = {0};
15 memcpy(name, uacpi_namespace_node_name(node).text, 4);
16 printf(format: "searching %s\n", name);
17
18 struct uacpi_object *out = NULL;
19 enum uacpi_status ret = uacpi_eval_simple(parent: node, path: "_CST", ret: &out);
20
21 if (ret != UACPI_STATUS_OK) {
22 return UACPI_ITERATION_DECISION_CONTINUE;
23 } else {
24 struct uacpi_data_view dview = {0};
25 printf(format: "Found _CST on %s\n", name);
26 uacpi_object_get_string(out, out: &dview);
27 printf(format: "got %s\n", dview.text);
28 return UACPI_ITERATION_DECISION_CONTINUE;
29 }
30}
31
32void acpi_find_cst(void) {
33 return;
34 uacpi_namespace_node *root = uacpi_namespace_root();
35 uacpi_namespace_for_each_child_simple(parent: root, callback: walk_callback, NULL);
36 hcf();
37}
38