Helper to backtrace a user context
[akaros.git] / kern / arch / riscv / cpuinfo.c
index 066c05b..ba71bc1 100644 (file)
@@ -9,18 +9,24 @@
 static void
 static_asserts_can_go_here()
 {
-       static_assert(SIZEOF_TRAPFRAME_T == sizeof(trapframe_t));
+       static_assert(SIZEOF_HW_TRAPFRAME == sizeof(struct hw_trapframe));
 }
 
 void
 print_cpuinfo(void)
 {
-       cprintf("CPU Info: Not Just Any Other RISC-V Core (TM)\n");
+       int id = mfpcr(PCR_IMPL);
+       const char* name = "(unknown implementation)";
+       if (id == 1)
+         name = "ISA Simulator";
+       else if (id == 2)
+         name = "Rocket64";
+       cprintf("CPU Info: RISC-V %s\n", name);
 }
 
-void show_mapping(uintptr_t start, size_t size)
+#warning "convert pgdir* to pgdir_t"
+void show_mapping(pgdir_t *pt, uintptr_t start, size_t size)
 {
-  pde_t* pt = (pde_t*)KADDR(rcr3());
        pte_t* pte;
        uintptr_t i;
        page_t* page;