aboutsummaryrefslogtreecommitdiff
path: root/common/mem.c
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2021-12-29 23:23:36 +0200
committerKimplul <kimi.h.kuparinen@gmail.com>2021-12-29 23:53:06 +0200
commit4f4d9fdc89c27aa3346467a24b621954f4564d3b (patch)
treec4ba4fb583a43b8fb27730b4cdb9b4b1395da91c /common/mem.c
parent4e5595a089c815febd7a0d42ab62940bf13f73ac (diff)
downloadkmi-4f4d9fdc89c27aa3346467a24b621954f4564d3b.tar.gz
kmi-4f4d9fdc89c27aa3346467a24b621954f4564d3b.zip
Refactoring
+ Mainly just moving stuff out or arch/riscv/ that should be handled in common/ + Prepared separate process stack/call stack for server callbacks, rest to be implemeted soon ish
Diffstat (limited to 'common/mem.c')
-rw-r--r--common/mem.c22
1 files changed, 0 insertions, 22 deletions
diff --git a/common/mem.c b/common/mem.c
index cff11b7..7a7eff6 100644
--- a/common/mem.c
+++ b/common/mem.c
@@ -24,25 +24,3 @@ void init_mem(size_t max_order, size_t bits[10], size_t page_shift)
__mm_sizes[i] = 1UL << __mm_shifts[i] << __mm_page_shift;
}
}
-
-enum mm_mode_t get_mmode(void *fdt)
-{
- int mmu_offset = fdt_path_offset(fdt, "/cpus/cpu");
- const char *mmu = fdt_getprop(fdt, mmu_offset, "mmu-type", NULL);
-
- if(strncmp("riscv,sv48", mmu, 10) == 0)
- return Sv48;
-
- if(strncmp("riscv,sv39", mmu, 10) == 0)
- return Sv39;
-
- if(strncmp("riscv,sv32", mmu, 10) == 0)
- return Sv32;
-
- /* fdt is missing mmu-type for some reason, but we can probably use
- * these values as fallback */
- if(__riscv_xlen == 32)
- return Sv32;
- else
- return Sv39;
-}