Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Feb 2021 16:10:46 GMT
From:      Mitchell Horne <mhorne@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 39df2b568230 - main - arm64: use macros to access special register values
Message-ID:  <202102171610.11HGAkZY009020@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by mhorne:

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

commit 39df2b568230e02350684e4f4d8353023daa1749
Author:     Mitchell Horne <mhorne@FreeBSD.org>
AuthorDate: 2021-01-28 17:53:00 +0000
Commit:     Mitchell Horne <mhorne@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",


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202102171610.11HGAkZY009020>