File tree Expand file tree Collapse file tree 2 files changed +43
-0
lines changed Expand file tree Collapse file tree 2 files changed +43
-0
lines changed Original file line number Diff line number Diff line change @@ -1007,3 +1007,15 @@ SRST
10071007 ``info cryptodev``
10081008 Show the crypto devices.
10091009ERST
1010+
1011+ {
1012+ .name = "ibex",
1013+ .args_type = "",
1014+ .params = "",
1015+ .help = "Show Ibex vCPU info",
1016+ },
1017+
1018+ SRST
1019+ ``info ibex``
1020+ Show Ibex vCPU information.
1021+ ERST
Original file line number Diff line number Diff line change 2424#include "qemu/error-report.h"
2525#include "qemu/log.h"
2626#include "cpu.h"
27+ #include "disas/disas.h"
2728#include "elf.h"
2829#include "exec/hwaddr.h"
2930#include "hw/boards.h"
3334#include "hw/qdev-properties.h"
3435#include "hw/riscv/ibex_common.h"
3536#include "hw/sysbus.h"
37+ #include "monitor/monitor.h"
3638
3739
3840static void ibex_mmio_map_device (SysBusDevice * dev , MemoryRegion * mr ,
@@ -293,3 +295,32 @@ void ibex_log_vcpu_registers(uint64_t regbm)
293295 }
294296 }
295297}
298+
299+ /*
300+ * Note: this is not specific to Ibex, and might apply to any vCPU.
301+ */
302+ static void hmp_info_ibex (Monitor * mon , const QDict * qdict )
303+ {
304+ CPUState * cpu ;
305+
306+ CPU_FOREACH (cpu ) {
307+ vaddr pc ;
308+ const char * symbol ;
309+ if (cpu -> cc -> get_pc ) {
310+ pc = cpu -> cc -> get_pc (cpu );
311+ symbol = lookup_symbol (pc );
312+ } else {
313+ pc = -1 ;
314+ symbol = "?" ;
315+ }
316+ monitor_printf (mon , "* CPU #%d: 0x%" PRIx64 " in '%s'\n" ,
317+ cpu -> cpu_index , (uint64_t )pc , symbol );
318+ }
319+ }
320+
321+ static void ibex_register_types (void )
322+ {
323+ monitor_register_hmp ("ibex" , true, & hmp_info_ibex );
324+ }
325+
326+ type_init (ibex_register_types )
You can’t perform that action at this time.
0 commit comments