The branch main has been updated by mhorne:

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

commit 39df2b568230e02350684e4f4d8353023daa1749
Author:     Mitchell Horne <[email protected]>
AuthorDate: 2021-01-28 17:53:00 +0000
Commit:     Mitchell Horne <[email protected]>
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",
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to