arm64: use macros to access special register values

This commit is contained in:
Mitchell Horne 2021-01-28 13:53:00 -04:00
parent 45eabf5754
commit 39df2b5682

View File

@ -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",