[rtems commit] bsps/i386: SMP and per-CPU thread dispatch disable

Sebastian Huber sebh at rtems.org
Fri Aug 9 21:26:17 UTC 2013


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Fri Aug  2 16:28:23 2013 +0200

bsps/i386: SMP and per-CPU thread dispatch disable

Interrupt support for SMP and the per-CPU thread dispatch disable level.

---

 c/src/lib/libbsp/i386/shared/irq/irq_asm.S |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/c/src/lib/libbsp/i386/shared/irq/irq_asm.S b/c/src/lib/libbsp/i386/shared/irq/irq_asm.S
index f77dd7f..d73c517 100644
--- a/c/src/lib/libbsp/i386/shared/irq/irq_asm.S
+++ b/c/src/lib/libbsp/i386/shared/irq/irq_asm.S
@@ -144,7 +144,14 @@ ISR_STOP:
 .check_stack_switch:
 	movl      esp, ebp                  /* ebp = previous stack pointer */
 
+#ifdef RTEMS_SMP
+	call      SYM(_CPU_SMP_Get_current_processor)
+	sall      $PER_CPU_CONTROL_SIZE_LOG2, eax
+	addl      $SYM(_Per_CPU_Information), eax
+	movl      eax, ebx
+#else
 	movl      $SYM(_Per_CPU_Information), ebx
+#endif
 
 	/* is this the outermost interrupt? */
 	cmpl      $0, PER_CPU_ISR_NEST_LEVEL(ebx)
@@ -159,8 +166,8 @@ ISR_STOP:
 
 nested:
 	incl      PER_CPU_ISR_NEST_LEVEL(ebx)  /* one nest level deeper */
-	incl      SYM (_Thread_Dispatch_disable_level) /* disable multitasking */
-
+	incl      PER_CPU_THREAD_DISPATCH_DISABLE_LEVEL(ebx) /* disable
+	                                                        multitasking */
 	/*
 	 * GCC versions starting with 4.3 no longer place the cld
 	 * instruction before string operations.  We  need to ensure
@@ -215,7 +222,7 @@ nested:
 	                                    /* If interrupts are nested, */
 	                                    /*   then dispatching is disabled */
 
-	decl      SYM (_Thread_Dispatch_disable_level)
+	decl      PER_CPU_THREAD_DISPATCH_DISABLE_LEVEL(ebx)
 	                                    /* unnest multitasking */
 	                                    /* Is dispatch disabled */
 	jne       .exit                     /* Yes, then exit */




More information about the vc mailing list