From 3ef2d175fa56e418a928f8abf3c92b7cd9639245 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Wed, 5 Feb 2014 13:59:07 +0100 Subject: [PATCH] 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 file 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 7a0449222f..0a87dad4c2 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; }