[rtems commit] bsp/leon3: Install IPI handler early

Sebastian Huber sebh at rtems.org
Wed Feb 5 14:40:13 UTC 2014


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Wed Feb  5 13:59:07 2014 +0100

bsp/leon3: Install IPI handler early

Install inter-processor interrupt (IPI) handler before secondary CPUs
are started.  This ensures that secondary CPUs fetch the newly installed
handler.

Remove superfluous return statement.

---

 c/src/lib/libbsp/sparc/leon3/smp/smp_leon3.c |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/c/src/lib/libbsp/sparc/leon3/smp/smp_leon3.c b/c/src/lib/libbsp/sparc/leon3/smp/smp_leon3.c
index 7a04492..0a87dad 100644
--- a/c/src/lib/libbsp/sparc/leon3/smp/smp_leon3.c
+++ b/c/src/lib/libbsp/sparc/leon3/smp/smp_leon3.c
@@ -82,8 +82,10 @@ uint32_t bsp_smp_initialize( uint32_t configured_cpu_count )
     }
   #endif
 
-  if ( found_cpus == 1 )
-    return 1;
+  if ( found_cpus > 1 ) {
+    LEON_Unmask_interrupt(LEON3_MP_IRQ);
+    set_vector(bsp_ap_ipi_isr, LEON_TRAP_TYPE(LEON3_MP_IRQ), 1);
+  }
 
   for ( cpu=1 ; cpu < found_cpus ; cpu++ ) {
     const Per_CPU_Control *per_cpu = _Per_CPU_Get_by_index( cpu );
@@ -107,11 +109,6 @@ uint32_t bsp_smp_initialize( uint32_t configured_cpu_count )
       );
     #endif
   }
-
-  if ( found_cpus > 1 ) {
-    LEON_Unmask_interrupt(LEON3_MP_IRQ);
-    set_vector(bsp_ap_ipi_isr, LEON_TRAP_TYPE(LEON3_MP_IRQ), 1);
-  }
   return found_cpus;
 }
 




More information about the vc mailing list