git: 760fb765b5bb - stable/13 - riscv: implement db_show_mdpcpu()

From: Mitchell Horne <mhorne_at_FreeBSD.org>
Date: Thu, 11 Aug 2022 14:32:46 UTC
The branch stable/13 has been updated by mhorne:

URL: https://cgit.FreeBSD.org/src/commit/?id=760fb765b5bb75d68f0455e408ec79a0e328d8de

commit 760fb765b5bb75d68f0455e408ec79a0e328d8de
Author:     Mitchell Horne <mhorne@FreeBSD.org>
AuthorDate: 2021-10-04 20:47:49 +0000
Commit:     Mitchell Horne <mhorne@FreeBSD.org>
CommitDate: 2022-08-11 14:21:41 +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
    
    (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 5068596462fc..bdb2a4e2c5df 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);
 }
 
 /*