diff options
author | Damien Zammit <damien@zamaudio.com> | 2023-02-01 10:06:05 +0000 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-02-01 18:59:36 +0100 |
commit | 497d1de6283d6ebb057f800376303c057a8f5192 (patch) | |
tree | 4aca5d309d83d32152ba30ac7da7e5e417db604b | |
parent | f728cc0ce24020f644ad48f0088783f0f68dd11a (diff) | |
download | gnumach-497d1de6283d6ebb057f800376303c057a8f5192.tar.gz gnumach-497d1de6283d6ebb057f800376303c057a8f5192.tar.bz2 gnumach-497d1de6283d6ebb057f800376303c057a8f5192.zip |
kdb: Fix ON_INT_STACK() macro to be cpu_number aware
Message-Id: <20230201100519.784297-5-damien@zamaudio.com>
-rw-r--r-- | i386/i386/db_trace.c | 3 | ||||
-rw-r--r-- | 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); |