The monitor's trace coretf can query all cores
[akaros.git] / kern / arch / riscv / cpuinfo.c
index cfe56b9..2ca3e54 100644 (file)
@@ -9,13 +9,19 @@
 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)
@@ -43,9 +49,3 @@ void show_mapping(uintptr_t start, size_t size)
                        cprintf("%016p\n",0);
        }
 }
-
-void
-backtrace(void)
-{
-  panic("No backtrace yet!");
-}