git: 39df2b568230 - main - arm64: use macros to access special register values

Mitchell Horne mhorne at FreeBSD.org
Wed Feb 17 16:10:47 UTC 2021


The branch main has been updated by mhorne:

URL: https://cgit.FreeBSD.org/src/commit/?id=39df2b568230e02350684e4f4d8353023daa1749

commit 39df2b568230e02350684e4f4d8353023daa1749
Author:     Mitchell Horne <mhorne at FreeBSD.org>
AuthorDate: 2021-01-28 17:53:00 +0000
Commit:     Mitchell Horne <mhorne at FreeBSD.org>
CommitDate: 2021-02-17 16:09:45 +0000

    arm64: use macros to access special register values
---
 sys/arm64/arm64/debug_monitor.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/sys/arm64/arm64/debug_monitor.c b/sys/arm64/arm64/debug_monitor.c
index dcb3645cf5d4..eb5d19567697 100644
--- a/sys/arm64/arm64/debug_monitor.c
+++ b/sys/arm64/arm64/debug_monitor.c
@@ -471,11 +471,13 @@ dbg_register_sync(struct debug_monitor_state *monitor)
 void
 dbg_monitor_init(void)
 {
+	uint64_t aa64dfr0;
 	u_int i;
 
 	/* Find out many breakpoints and watchpoints we can use */
-	dbg_watchpoint_num = ((READ_SPECIALREG(id_aa64dfr0_el1) >> 20) & 0xf) + 1;
-	dbg_breakpoint_num = ((READ_SPECIALREG(id_aa64dfr0_el1) >> 12) & 0xf) + 1;
+	aa64dfr0 = READ_SPECIALREG(id_aa64dfr0_el1);
+	dbg_watchpoint_num = ID_AA64DFR0_WRPs_VAL(aa64dfr0);
+	dbg_breakpoint_num = ID_AA64DFR0_BRPs_VAL(aa64dfr0);
 
 	if (bootverbose && PCPU_GET(cpuid) == 0) {
 		printf("%d watchpoints and %d breakpoints supported\n",


More information about the dev-commits-src-main mailing list