From 83e17e29456ec9b6d45f4d9f2634eb280c6f414f Mon Sep 17 00:00:00 2001 From: stefan Date: Wed, 19 Apr 2023 20:50:10 -0400 Subject: ticket locks --- sys/kern/init.c | 51 --------------------------------------------------- 1 file changed, 51 deletions(-) delete mode 100644 sys/kern/init.c (limited to 'sys/kern/init.c') diff --git a/sys/kern/init.c b/sys/kern/init.c deleted file mode 100644 index a58d3bc..0000000 --- a/sys/kern/init.c +++ /dev/null @@ -1,51 +0,0 @@ -#include -#include -#include -#include -#include -#include - -extern uint64_t HEAP_START; - -#define HLT()\ - for (;;)\ - asm("wfi") - -void -init(unsigned long hartid, struct fdt_header *fdt) -{ - - printf("booting from hart #%d\n", hartid); - asm volatile ("mv tp, %0" : : "r"(hartid)); - if (fdt_uint32(fdt->magic) == FDT_HEADER_MAGIC) - printf("found flattened device tree at %p!\n", (uint64_t)fdt); - - printf("parsing device tree!\n"); - fdt_walk(fdt); - - printf("setting up the heap at %p\n", HEAP_START); - kalloc_init(); - printf("done!\n"); - // printf("printing free pages:\n"); - ///walkfree(); - printf("bringing up other harts...\n"); - // todo: detect harts from device tree can also be used for more conservative stack allocation - for (int i = 0; i < NPROC; ++i) { - if (i == hartid) { - printf("skipping hart #%d\n", i); - continue; - } - printf("starting hart #%d\n", i); - struct sbiret r = _start_hart(i, (unsigned long)LOAD_ADDR); - if (r.err != SBI_SUCCESS) - printf("ERROR"); - } -} - -void -mpinit(unsigned long hartid) -{ - printf("mpinit: %d", hartid); - HLT(); -} - -- cgit v1.2.3