BXE: min->MIN, plus an spatch
[akaros.git] / kern / arch / riscv / cpuinfo.c
index cfe56b9..6766761 100644 (file)
@@ -9,18 +9,23 @@
 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)
+void show_mapping(pde_t *pt, uintptr_t start, size_t size)
 {
-  pde_t* pt = (pde_t*)KADDR(rcr3());
        pte_t* pte;
        uintptr_t i;
        page_t* page;
@@ -43,9 +48,3 @@ void show_mapping(uintptr_t start, size_t size)
                        cprintf("%016p\n",0);
        }
 }
-
-void
-backtrace(void)
-{
-  panic("No backtrace yet!");
-}