bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 4/5 gnumach] kdb: Fix ON_INT_STACK() macro to be cpu_number aware


From: Damien Zammit
Subject: [PATCH 4/5 gnumach] kdb: Fix ON_INT_STACK() macro to be cpu_number aware
Date: Wed, 01 Feb 2023 10:06:05 +0000

---
 i386/i386/db_trace.c    | 3 ++-
 i386/i386at/model_dep.h | 4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/i386/i386/db_trace.c b/i386/i386/db_trace.c
index 99cb8c48..04c868af 100644
--- a/i386/i386/db_trace.c
+++ b/i386/i386/db_trace.c
@@ -37,6 +37,7 @@
 #include <machine/machspl.h>
 #include <machine/db_interface.h>
 #include <machine/db_trace.h>
+#include <machine/cpu_number.h>
 #include <i386at/model_dep.h>

 #include <ddb/db_access.h>
@@ -147,7 +148,7 @@ db_i386_reg_value(
            if (thread == current_thread()) {
                if (ddb_regs.cs & 0x3)
                    dp = vp->valuep;
-               else if (ON_INT_STACK(ddb_regs.ebp))
+               else if (ON_INT_STACK(ddb_regs.ebp, cpu_number()))
                    db_error("cannot get/set user registers in nested 
interrupt\n");
            }
        } else {
diff --git a/i386/i386at/model_dep.h b/i386/i386at/model_dep.h
index df327ca2..3d5b6645 100644
--- a/i386/i386at/model_dep.h
+++ b/i386/i386at/model_dep.h
@@ -27,8 +27,8 @@
  */
 extern vm_offset_t int_stack_top[NCPUS], int_stack_base[NCPUS];

-/* Check whether P points to the interrupt stack.  */
-#define ON_INT_STACK(P)        (((P) & ~(INTSTACK_SIZE-1)) == 
int_stack_base[0])
+/* Check whether P points to the per-cpu interrupt stack.  */
+#define ON_INT_STACK(P, CPU)   (((P) & ~(INTSTACK_SIZE-1)) == 
int_stack_base[CPU])

 extern vm_offset_t timemmap(dev_t dev, vm_offset_t off, vm_prot_t prot);

--
2.34.1





reply via email to

[Prev in Thread] Current Thread [Next in Thread]