From 760fb765b5bb75d68f0455e408ec79a0e328d8de Mon Sep 17 00:00:00 2001 From: Mitchell Horne Date: Mon, 4 Oct 2021 17:47:49 -0300 Subject: [PATCH] riscv: implement db_show_mdpcpu() This prints the machine-dependent members of struct pcpu when executing the 'show pcpu' or 'show all pcpu' ddb(4) commands. MFC after: 3 days (cherry picked from commit 4fffc56c6e4c97aa76b31060e806ccdafb1afacd) --- sys/riscv/include/pcpu.h | 1 + sys/riscv/riscv/db_interface.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/sys/riscv/include/pcpu.h b/sys/riscv/include/pcpu.h index 5068596462f..bdb2a4e2c5d 100644 --- a/sys/riscv/include/pcpu.h +++ b/sys/riscv/include/pcpu.h @@ -44,6 +44,7 @@ #define ALT_STACK_SIZE 128 +/* Keep in sync with db_show_mdpcpu() */ #define PCPU_MD_FIELDS \ struct pmap *pc_curpmap; /* Currently active pmap */ \ uint32_t pc_pending_ipis; /* IPIs pending to this CPU */ \ diff --git a/sys/riscv/riscv/db_interface.c b/sys/riscv/riscv/db_interface.c index 291fd2c2d8f..5c959792d36 100644 --- a/sys/riscv/riscv/db_interface.c +++ b/sys/riscv/riscv/db_interface.c @@ -106,6 +106,9 @@ struct db_variable *db_eregs = db_regs + nitems(db_regs); void db_show_mdpcpu(struct pcpu *pc) { + db_printf("curpmap = %p\n", pc->pc_curpmap); + db_printf("pending_ipis = %x\n", pc->pc_pending_ipis); + db_printf("hart = %u\n", pc->pc_hart); } /*