[rtems commit] bsp/pc386: Disable interrupt nesting for job handler

Chris Johns chrisj at rtems.org
Wed Jun 17 01:55:03 UTC 2020


Module:    rtems
Branch:    master
Commit:    96d9823ddda26481bd0e8f8105826b7adf7fe121
Changeset: http://git.rtems.org/rtems/commit/?id=96d9823ddda26481bd0e8f8105826b7adf7fe121

Author:    Jan Sommer <jan.sommer at dlr.de>
Date:      Sun May 31 16:22:59 2020 +0200

bsp/pc386: Disable interrupt nesting for job handler

- Fixes timeout for smpipi01 where:
    + Main thread sends perform jobs to worker cpu while it is already
    performing jobs
    + Interrupt on worker cpu performs jobs, but with empty job list
    + Worker cpu continues to execut previous job and adds new job list
    to itself, which is never performed, since the interrupt has already
    been handled
    + Main thread blocks forever on barrier D

---

 bsps/i386/pc386/start/smp-imps.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/bsps/i386/pc386/start/smp-imps.c b/bsps/i386/pc386/start/smp-imps.c
index de593f3..0985b8f 100644
--- a/bsps/i386/pc386/start/smp-imps.c
+++ b/bsps/i386/pc386/start/smp-imps.c
@@ -768,7 +768,17 @@ static void bsp_inter_processor_interrupt(void *arg)
 
   smp_apic_ack();
 
+  /*
+   * Disallow nesting.
+   */
+   __asm__ __volatile__("cli");
+
   _SMP_Inter_processor_interrupt_handler(_Per_CPU_Get());
+
+   /*
+   * Allow nesting.
+   */
+   __asm__ __volatile__("sti");
 }
 
 void



More information about the vc mailing list