From 4a796c39bbd7f093cbbb0b8a723db15c63f8edd8 Mon Sep 17 00:00:00 2001 From: hujun5 Date: Thu, 19 Sep 2024 20:42:16 +0800 Subject: [PATCH] xtensa: add parameters to xtensa_pause_handler reason: nxsched_smp_call_handler need these parameters Signed-off-by: hujun5 --- arch/xtensa/src/common/xtensa.h | 2 +- arch/xtensa/src/common/xtensa_cpupause.c | 4 +++- arch/xtensa/src/esp32/esp32_intercpu_interrupt.c | 11 +++++------ arch/xtensa/src/esp32s3/esp32s3_intercpu_interrupt.c | 11 +++++------ 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/arch/xtensa/src/common/xtensa.h b/arch/xtensa/src/common/xtensa.h index bae9bd1f81..ea776419d4 100644 --- a/arch/xtensa/src/common/xtensa.h +++ b/arch/xtensa/src/common/xtensa.h @@ -234,7 +234,7 @@ uint32_t *xtensa_user(int exccause, uint32_t *regs); #ifdef CONFIG_SMP int xtensa_intercpu_interrupt(int tocpu, int intcode); -void xtensa_pause_handler(void); +void xtensa_pause_handler(int irq, void *context, void *arg); #endif /* Signals */ diff --git a/arch/xtensa/src/common/xtensa_cpupause.c b/arch/xtensa/src/common/xtensa_cpupause.c index 1eeb13c584..9fdca0d5c3 100644 --- a/arch/xtensa/src/common/xtensa_cpupause.c +++ b/arch/xtensa/src/common/xtensa_cpupause.c @@ -208,11 +208,13 @@ int up_cpu_paused_restore(void) * ****************************************************************************/ -void xtensa_pause_handler(void) +void xtensa_pause_handler(int irq, void *context, void *arg) { struct tcb_s *tcb; int cpu = this_cpu(); + nxsched_smp_call_handler(irq, context, arg); + /* Check for false alarms. Such false could occur as a consequence of * some deadlock breaking logic that might have already serviced the * interrupt by calling up_cpu_paused. diff --git a/arch/xtensa/src/esp32/esp32_intercpu_interrupt.c b/arch/xtensa/src/esp32/esp32_intercpu_interrupt.c index d43a09ed3d..68f602d083 100644 --- a/arch/xtensa/src/esp32/esp32_intercpu_interrupt.c +++ b/arch/xtensa/src/esp32/esp32_intercpu_interrupt.c @@ -49,7 +49,8 @@ * ****************************************************************************/ -static int IRAM_ATTR esp32_fromcpu_interrupt(int fromcpu) +static int IRAM_ATTR esp32_fromcpu_interrupt(int irq, void *context, + void *arg, int fromcpu) { uintptr_t regaddr; @@ -64,7 +65,7 @@ static int IRAM_ATTR esp32_fromcpu_interrupt(int fromcpu) /* Call pause handler */ - xtensa_pause_handler(); + xtensa_pause_handler(irq, context, arg); return OK; } @@ -83,14 +84,12 @@ static int IRAM_ATTR esp32_fromcpu_interrupt(int fromcpu) int IRAM_ATTR esp32_fromcpu0_interrupt(int irq, void *context, void *arg) { - nxsched_smp_call_handler(irq, context, arg); - return esp32_fromcpu_interrupt(0); + return esp32_fromcpu_interrupt(irq, context, arg, 0); } int IRAM_ATTR esp32_fromcpu1_interrupt(int irq, void *context, void *arg) { - nxsched_smp_call_handler(irq, context, arg); - return esp32_fromcpu_interrupt(1); + return esp32_fromcpu_interrupt(irq, context, arg, 1); } /**************************************************************************** diff --git a/arch/xtensa/src/esp32s3/esp32s3_intercpu_interrupt.c b/arch/xtensa/src/esp32s3/esp32s3_intercpu_interrupt.c index f991d00310..60891afee8 100644 --- a/arch/xtensa/src/esp32s3/esp32s3_intercpu_interrupt.c +++ b/arch/xtensa/src/esp32s3/esp32s3_intercpu_interrupt.c @@ -50,7 +50,8 @@ * ****************************************************************************/ -static int IRAM_ATTR esp32s3_fromcpu_interrupt(int fromcpu) +static int IRAM_ATTR esp32s3_fromcpu_interrupt(int irq, void *context, + void *arg, int fromcpu) { uintptr_t regaddr; @@ -65,7 +66,7 @@ static int IRAM_ATTR esp32s3_fromcpu_interrupt(int fromcpu) /* Call pause handler */ - xtensa_pause_handler(); + xtensa_pause_handler(irq, context, arg); return OK; } @@ -84,14 +85,12 @@ static int IRAM_ATTR esp32s3_fromcpu_interrupt(int fromcpu) int IRAM_ATTR esp32s3_fromcpu0_interrupt(int irq, void *context, void *arg) { - nxsched_smp_call_handler(irq, context, arg); - return esp32s3_fromcpu_interrupt(0); + return esp32s3_fromcpu_interrupt(irq, context, arg, 0); } int IRAM_ATTR esp32s3_fromcpu1_interrupt(int irq, void *context, void *arg) { - nxsched_smp_call_handler(irq, context, arg); - return esp32s3_fromcpu_interrupt(1); + return esp32s3_fromcpu_interrupt(irq, context, arg, 1); } /****************************************************************************