summaryrefslogtreecommitdiff
path: root/sys/dev/dev_init.c
diff options
context:
space:
mode:
authorstefan <stefan@s00.xyz>2023-04-29 17:37:05 -0400
committerstefan <stefan@s00.xyz>2023-04-29 17:37:05 -0400
commit2a20e3596a446df55cfe4b34b45b4cd8eae594db (patch)
treed64632a8d804a9af9b1cbda49bb9f8d763d93719 /sys/dev/dev_init.c
parenta3c174ee4c08d1d5e7a89ce187f52e3c0807a7eb (diff)
downloadsv-2a20e3596a446df55cfe4b34b45b4cd8eae594db.tar.gz
some work on paging
Diffstat (limited to 'sys/dev/dev_init.c')
-rw-r--r--sys/dev/dev_init.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/sys/dev/dev_init.c b/sys/dev/dev_init.c
index 9933c2a..bacf427 100644
--- a/sys/dev/dev_init.c
+++ b/sys/dev/dev_init.c
@@ -26,6 +26,19 @@ mem_init(struct fdt_header *fdt, struct devicetree *dt)
printf("[mem_init] found %d memory reserve map entries\n", n);
}
+static void
+cpu_init(struct fdt_header *fdt, struct devicetree *dt)
+{
+
+ int cpus = fdt_path_offset(fdt, "/cpus");
+ if (cpus < 0)
+ printf("[dev_init] failed to find cpus node\n");
+
+ int node = 0;
+ fdt_for_each_subnode(node, fdt, cpus) {
+
+ }
+}
struct devicetree
dev_init(struct fdt_header *fdt)
@@ -39,6 +52,7 @@ dev_init(struct fdt_header *fdt)
printf("[dev_init] detecting memory...\n");
mem_init(fdt, &dt);
+ cpu_init(fdt, &dt);
// int offset = fdt_next_node(fdt, offset, 0);
// do {