From d5e073cde70211b2471e4366be397370e9f6ce48 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 11 Nov 2016 14:37:51 +0100 Subject: score: Allow interrupts during thread dispatch Use a processor-specific interrupt frame during context switches in case the executing thread is longer executes on the processor and the heir thread is about to start execution. During this period we must not use a thread stack for interrupt processing. Update #2809. --- cpukit/score/cpu/arm/cpu_asm.S | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'cpukit/score/cpu/arm/cpu_asm.S') diff --git a/cpukit/score/cpu/arm/cpu_asm.S b/cpukit/score/cpu/arm/cpu_asm.S index cf94822eaf..1ad3a51b14 100644 --- a/cpukit/score/cpu/arm/cpu_asm.S +++ b/cpukit/score/cpu/arm/cpu_asm.S @@ -69,8 +69,14 @@ DEFINE_FUNCTION_ARM(_CPU_Context_switch) #endif #ifdef RTEMS_SMP - /* The executing context no longer executes on this processor */ + /* + * The executing thread no longer executes on this processor. Switch + * the stack to the temporary interrupt stack of this processor. Mark + * the context of the executing thread as not executing. + */ dmb + GET_SELF_CPU_CONTROL r2 + add sp, r2, #(PER_CPU_INTERRUPT_FRAME_AREA + CPU_INTERRUPT_FRAME_SIZE) mov r3, #0 strb r3, [r0, #ARM_CONTEXT_CONTROL_IS_EXECUTING_OFFSET] @@ -128,8 +134,6 @@ DEFINE_FUNCTION_ARM(_CPU_Context_restore) #ifdef RTEMS_SMP .L_get_potential_new_heir: - GET_SELF_CPU_CONTROL r2 - /* We may have a new heir */ /* Read the executing and heir */ -- cgit v1.2.3