From d101d5732143455d98bf756d728bb2f5a1947a9b Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Wed, 13 Apr 2022 16:08:21 -0700 Subject: [PATCH] arm dbg: Use PCPU_GET(cpuid) directly in assertions. --- sys/arm/arm/debug_monitor.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/sys/arm/arm/debug_monitor.c b/sys/arm/arm/debug_monitor.c index 7f4dd829b4f..1d00c0473dd 100644 --- a/sys/arm/arm/debug_monitor.c +++ b/sys/arm/arm/debug_monitor.c @@ -1013,7 +1013,6 @@ CTASSERT(sizeof(struct dbreg) == sizeof(((struct pcpu *)NULL)->pc_dbreg)); void dbg_monitor_init_secondary(void) { - u_int cpuid; int err; /* * This flag is set on the primary CPU @@ -1022,8 +1021,6 @@ dbg_monitor_init_secondary(void) if (!dbg_capable()) return; - cpuid = PCPU_GET(cpuid); - err = dbg_reset_state(); if (err != 0) { /* @@ -1031,7 +1028,7 @@ dbg_monitor_init_secondary(void) * WPs/BPs will not work correctly on this CPU. */ KASSERT(0, ("%s: Failed to reset Debug Architecture " - "state on CPU%d", __func__, cpuid)); + "state on CPU%d", __func__, PCPU_GET(cpuid))); /* Disable HW debug capabilities for all CPUs */ atomic_set_int(&dbg_capable_var, 0); return; @@ -1039,7 +1036,7 @@ dbg_monitor_init_secondary(void) err = dbg_enable_monitor(); if (err != 0) { KASSERT(0, ("%s: Failed to enable Debug Monitor" - " on CPU%d", __func__, cpuid)); + " on CPU%d", __func__, PCPU_GET(cpuid))); atomic_set_int(&dbg_capable_var, 0); } }