git: 4fffc56c6e4c - main - riscv: implement db_show_mdpcpu()

From: Mitchell Horne <mhorne_at_FreeBSD.org>
Date: Tue, 05 Jul 2022 15:08:55 UTC
The branch main has been updated by mhorne:

URL: https://cgit.FreeBSD.org/src/commit/?id=4fffc56c6e4c97aa76b31060e806ccdafb1afacd

commit 4fffc56c6e4c97aa76b31060e806ccdafb1afacd
Author:     Mitchell Horne <mhorne@FreeBSD.org>
AuthorDate: 2021-10-04 20:47:49 +0000
Commit:     Mitchell Horne <mhorne@FreeBSD.org>
CommitDate: 2022-07-05 14:51:14 +0000

    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
---
 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 af5eb6fd5c41..0165a271250f 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 291fd2c2d8fa..5c959792d368 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);
 }
 
 /*