Rename rtems_smp_secondary_cpu_initialize() into _SMP_Start_multitasking_on_secondary_processor(). Move declaration to <rtems/score/smpimpl.h>. --- .../libbsp/arm/shared/include/arm-a9mpcore-start.h | 3 +- c/src/lib/libbsp/i386/shared/smp/smp-imps.c | 3 +- c/src/lib/libbsp/powerpc/qoriq/startup/smp.c | 3 +- c/src/lib/libbsp/sparc/leon3/smp/smp_leon3.c | 3 +- cpukit/score/include/rtems/bspsmp.h | 25 ------------------ cpukit/score/include/rtems/score/smpimpl.h | 27 ++++++++++++++++++++ cpukit/score/src/smp.c | 2 +- 7 files changed, 36 insertions(+), 30 deletions(-)
diff --git a/c/src/lib/libbsp/arm/shared/include/arm-a9mpcore-start.h b/c/src/lib/libbsp/arm/shared/include/arm-a9mpcore-start.h index 9ebc5a5..e11bc71 100644 --- a/c/src/lib/libbsp/arm/shared/include/arm-a9mpcore-start.h +++ b/c/src/lib/libbsp/arm/shared/include/arm-a9mpcore-start.h @@ -24,6 +24,7 @@ #define LIBBSP_ARM_SHARED_ARM_A9MPCORE_START_H #include <rtems/bspsmp.h> +#include <rtems/score/smpimpl.h> #include <libcpu/arm-cp15.h> @@ -109,7 +110,7 @@ BSP_START_TEXT_SECTION static inline arm_a9mpcore_start_hook_0(void) ctrl |= ARM_CP15_CTRL_I | ARM_CP15_CTRL_C | ARM_CP15_CTRL_M; arm_cp15_set_control(ctrl); - rtems_smp_secondary_cpu_initialize(); + _SMP_Start_multitasking_on_secondary_processor(); } else { /* FIXME: Shutdown processor */ while (1) { diff --git a/c/src/lib/libbsp/i386/shared/smp/smp-imps.c b/c/src/lib/libbsp/i386/shared/smp/smp-imps.c index 6170beb..1ed5d41 100644 --- a/c/src/lib/libbsp/i386/shared/smp/smp-imps.c +++ b/c/src/lib/libbsp/i386/shared/smp/smp-imps.c @@ -56,6 +56,7 @@ #include <bsp/apic.h> #include <bsp/smp-imps.h> #include <bsp/irq.h> +#include <rtems/score/smpimpl.h> /* * XXXXX The following absolutely must be defined!!! @@ -783,7 +784,7 @@ static void secondary_cpu_initialize(void) enable_sse(); #endif - rtems_smp_secondary_cpu_initialize(); + _SMP_Start_multitasking_on_secondary_processor(); } #include <rtems/bspsmp.h> diff --git a/c/src/lib/libbsp/powerpc/qoriq/startup/smp.c b/c/src/lib/libbsp/powerpc/qoriq/startup/smp.c index d124303..4260c2b 100644 --- a/c/src/lib/libbsp/powerpc/qoriq/startup/smp.c +++ b/c/src/lib/libbsp/powerpc/qoriq/startup/smp.c @@ -15,6 +15,7 @@ #include <assert.h> #include <rtems/bspsmp.h> +#include <rtems/score/smpimpl.h> #include <libcpu/powerpc-utility.h> @@ -133,7 +134,7 @@ void qoriq_secondary_cpu_initialize(void) bsp_interrupt_vector_enable(QORIQ_IRQ_IPI_0); - rtems_smp_secondary_cpu_initialize(); + _SMP_Start_multitasking_on_secondary_processor(); } static void ipi_handler(void *arg) 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 dccca81..aac0396 100644 --- a/c/src/lib/libbsp/sparc/leon3/smp/smp_leon3.c +++ b/c/src/lib/libbsp/sparc/leon3/smp/smp_leon3.c @@ -17,6 +17,7 @@ #include <leon.h> #include <rtems/bspIo.h> #include <rtems/bspsmp.h> +#include <rtems/score/smpimpl.h> #include <stdlib.h> static inline void sparc_leon3_set_cctrl( unsigned int val ) @@ -44,7 +45,7 @@ void leon3_secondary_cpu_initialize(uint32_t cpu) LEON_Unmask_interrupt(LEON3_MP_IRQ); LEON3_IrqCtrl_Regs->mask[cpu] |= 1 << LEON3_MP_IRQ; - rtems_smp_secondary_cpu_initialize(); + _SMP_Start_multitasking_on_secondary_processor(); } uint32_t _CPU_SMP_Initialize( uint32_t configured_cpu_count ) diff --git a/cpukit/score/include/rtems/bspsmp.h b/cpukit/score/include/rtems/bspsmp.h index c7502ec..37c0380 100644 --- a/cpukit/score/include/rtems/bspsmp.h +++ b/cpukit/score/include/rtems/bspsmp.h @@ -52,31 +52,6 @@ extern "C" { #ifndef ASM /** - * @brief Performs high-level initialization of a secondary processor and runs - * the application threads. - * - * The low-level initialization code must call this function to hand over the - * control of this processor to RTEMS. Interrupts must be disabled. It must - * be possible to send inter-processor interrupts to this processor. Since - * interrupts are disabled the inter-processor interrupt delivery is postponed - * until interrupts are enabled the first time. Interrupts are enabled during - * the execution begin of threads in case they have interrupt level zero (this - * is the default). - * - * The pre-requisites for the call to this function are - * - disabled interrupts, - * - delivery of inter-processor interrupts is possible, - * - a valid stack pointer and enough stack space, - * - a valid code memory, and - * - a valid BSS section. - * - * This function must not be called by the main processor. This function does - * not return to the caller. - */ -void rtems_smp_secondary_cpu_initialize( void ) - RTEMS_COMPILER_NO_RETURN_ATTRIBUTE; - -/** * @brief Process the incoming interprocessor request. * * This is the method called by the BSP's interrupt handler diff --git a/cpukit/score/include/rtems/score/smpimpl.h b/cpukit/score/include/rtems/score/smpimpl.h index 59f2b10..dc51cdf 100644 --- a/cpukit/score/include/rtems/score/smpimpl.h +++ b/cpukit/score/include/rtems/score/smpimpl.h @@ -63,6 +63,33 @@ typedef enum { #if defined( RTEMS_SMP ) /** + * @brief Performs high-level initialization of a secondary processor and runs + * the application threads. + * + * The low-level initialization code must call this function to hand over the + * control of this processor to RTEMS. Interrupts must be disabled. It must + * be possible to send inter-processor interrupts to this processor. Since + * interrupts are disabled the inter-processor interrupt delivery is postponed + * until interrupts are enabled the first time. Interrupts are enabled during + * the execution begin of threads in case they have interrupt level zero (this + * is the default). + * + * The pre-requisites for the call to this function are + * - disabled interrupts, + * - delivery of inter-processor interrupts is possible, + * - a valid stack pointer and enough stack space, + * - a valid code memory, and + * - a valid BSS section. + * + * This function must not be called by the main processor. The main processor + * uses _Thread_Start_multitasking() instead. + * + * This function does not return to the caller. + */ +void _SMP_Start_multitasking_on_secondary_processor( void ) + RTEMS_COMPILER_NO_RETURN_ATTRIBUTE; + +/** * @brief Sends a SMP message to a processor. * * The target processor may be the sending processor. diff --git a/cpukit/score/src/smp.c b/cpukit/score/src/smp.c index 6c2f78b..86e9cd2 100644 --- a/cpukit/score/src/smp.c +++ b/cpukit/score/src/smp.c @@ -30,7 +30,7 @@ #include <rtems/bspIo.h> #endif -void rtems_smp_secondary_cpu_initialize( void ) +void _SMP_Start_multitasking_on_secondary_processor( void ) { Per_CPU_Control *self_cpu = _Per_CPU_Get(); -- 1.7.7 _______________________________________________ rtems-devel mailing list rtems-devel@rtems.org http://www.rtems.org/mailman/listinfo/rtems-devel