[PATCH 13/17] score: Rename bsp_smp_initialize()
Sebastian Huber
sebastian.huber at embedded-brains.de
Mon Feb 17 15:51:38 UTC 2014
Rename bsp_smp_initialize() into _CPU_SMP_Initialize() since every CPU
port must supply this function.
---
c/src/lib/libbsp/arm/shared/arm-a9mpcore-smp.c | 2 +-
c/src/lib/libbsp/i386/shared/smp/smp-imps.c | 2 +-
c/src/lib/libbsp/powerpc/qoriq/startup/smp.c | 2 +-
c/src/lib/libbsp/shared/smp/smp_stub.c | 2 +-
c/src/lib/libbsp/sparc/leon3/smp/smp_leon3.c | 2 +-
cpukit/score/cpu/arm/rtems/score/cpu.h | 2 ++
cpukit/score/cpu/i386/rtems/score/cpu.h | 2 ++
cpukit/score/cpu/no_cpu/rtems/score/cpu.h | 18 ++++++++++++++++++
cpukit/score/cpu/powerpc/rtems/score/cpu.h | 2 ++
cpukit/score/cpu/sparc/rtems/score/cpu.h | 2 ++
cpukit/score/include/rtems/bspsmp.h | 18 ------------------
cpukit/score/src/percpu.c | 3 +--
cpukit/score/src/smp.c | 2 +-
13 files changed, 33 insertions(+), 26 deletions(-)
diff --git a/c/src/lib/libbsp/arm/shared/arm-a9mpcore-smp.c b/c/src/lib/libbsp/arm/shared/arm-a9mpcore-smp.c
index 3005bcf..9f465aa 100644
--- a/c/src/lib/libbsp/arm/shared/arm-a9mpcore-smp.c
+++ b/c/src/lib/libbsp/arm/shared/arm-a9mpcore-smp.c
@@ -25,7 +25,7 @@ static void ipi_handler(void *arg)
rtems_smp_process_interrupt();
}
-uint32_t bsp_smp_initialize(uint32_t configured_cpu_count)
+uint32_t _CPU_SMP_Initialize(uint32_t configured_cpu_count)
{
rtems_status_code sc;
uint32_t max_cpu_count = arm_gic_irq_processor_count();
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 d8753c3..a2dbc32 100644
--- a/c/src/lib/libbsp/i386/shared/smp/smp-imps.c
+++ b/c/src/lib/libbsp/i386/shared/smp/smp-imps.c
@@ -787,7 +787,7 @@ static void secondary_cpu_initialize(void)
}
#include <rtems/bspsmp.h>
-uint32_t bsp_smp_initialize( uint32_t configured_cpu_count )
+uint32_t _CPU_SMP_Initialize( uint32_t configured_cpu_count )
{
int cores;
/* XXX need to deal with finding too many cores */
diff --git a/c/src/lib/libbsp/powerpc/qoriq/startup/smp.c b/c/src/lib/libbsp/powerpc/qoriq/startup/smp.c
index 38a7305..ea9d1cb 100644
--- a/c/src/lib/libbsp/powerpc/qoriq/startup/smp.c
+++ b/c/src/lib/libbsp/powerpc/qoriq/startup/smp.c
@@ -141,7 +141,7 @@ static void ipi_handler(void *arg)
rtems_smp_process_interrupt();
}
-uint32_t bsp_smp_initialize(uint32_t configured_cpu_count)
+uint32_t _CPU_SMP_Initialize(uint32_t configured_cpu_count)
{
rtems_status_code sc;
uint32_t cores = configured_cpu_count < CORE_COUNT ?
diff --git a/c/src/lib/libbsp/shared/smp/smp_stub.c b/c/src/lib/libbsp/shared/smp/smp_stub.c
index f1fa777..b4a9cc3 100644
--- a/c/src/lib/libbsp/shared/smp/smp_stub.c
+++ b/c/src/lib/libbsp/shared/smp/smp_stub.c
@@ -15,7 +15,7 @@
#include <rtems/bspsmp.h>
#include <stdlib.h>
-uint32_t bsp_smp_initialize( uint32_t configured_cpu_count )
+uint32_t _CPU_SMP_Initialize( uint32_t configured_cpu_count )
{
/* return the number of CPUs */
return 1;
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 071d3d3..baf4cfd 100644
--- a/c/src/lib/libbsp/sparc/leon3/smp/smp_leon3.c
+++ b/c/src/lib/libbsp/sparc/leon3/smp/smp_leon3.c
@@ -47,7 +47,7 @@ void leon3_secondary_cpu_initialize(uint32_t cpu)
rtems_smp_secondary_cpu_initialize();
}
-uint32_t bsp_smp_initialize( uint32_t configured_cpu_count )
+uint32_t _CPU_SMP_Initialize( uint32_t configured_cpu_count )
{
uint32_t max_cpu_count;
uint32_t used_cpu_count;
diff --git a/cpukit/score/cpu/arm/rtems/score/cpu.h b/cpukit/score/cpu/arm/rtems/score/cpu.h
index a0c6b41..a58fa9e 100644
--- a/cpukit/score/cpu/arm/rtems/score/cpu.h
+++ b/cpukit/score/cpu/arm/rtems/score/cpu.h
@@ -467,6 +467,8 @@ void _CPU_Context_volatile_clobber( uintptr_t pattern );
void _CPU_Context_validate( uintptr_t pattern );
#ifdef RTEMS_SMP
+ uint32_t _CPU_SMP_Initialize( uint32_t configured_cpu_count );
+
RTEMS_COMPILER_PURE_ATTRIBUTE static inline uint32_t
_CPU_SMP_Get_current_processor( void )
{
diff --git a/cpukit/score/cpu/i386/rtems/score/cpu.h b/cpukit/score/cpu/i386/rtems/score/cpu.h
index 4fe254c..3c37006 100644
--- a/cpukit/score/cpu/i386/rtems/score/cpu.h
+++ b/cpukit/score/cpu/i386/rtems/score/cpu.h
@@ -462,6 +462,8 @@ uint32_t _CPU_ISR_Get_level( void );
_CPU_Context_restore( (_the_context) );
#if defined(RTEMS_SMP)
+ uint32_t _CPU_SMP_Initialize( uint32_t configured_cpu_count );
+
RTEMS_COMPILER_PURE_ATTRIBUTE uint32_t _CPU_SMP_Get_current_processor( void );
void _CPU_SMP_Send_interrupt( uint32_t target_processor_index );
diff --git a/cpukit/score/cpu/no_cpu/rtems/score/cpu.h b/cpukit/score/cpu/no_cpu/rtems/score/cpu.h
index 9fdc7fc..e250639 100644
--- a/cpukit/score/cpu/no_cpu/rtems/score/cpu.h
+++ b/cpukit/score/cpu/no_cpu/rtems/score/cpu.h
@@ -1462,6 +1462,24 @@ CPU_Counter_ticks _CPU_Counter_difference(
#ifdef RTEMS_SMP
/**
+ * @brief Performs CPU specific SMP initialization in the context of the main
+ * processor.
+ *
+ * This function is invoked on the main processor by RTEMS during
+ * initialization. All interrupt stacks are allocated at this point in case
+ * the CPU port allocates the interrupt stacks.
+ *
+ * The CPU port should start secondary processors now.
+ *
+ * @param[in] configured_cpu_count The count of processors requested by the
+ * application configuration.
+ *
+ * @return The count of processors available for the application in the system.
+ * This value is less than or equal to the configured count of processors.
+ */
+ uint32_t _CPU_SMP_Initialize( uint32_t configured_cpu_count );
+
+ /**
* @brief Returns the index of the current processor.
*
* An architecture specific method must be used to obtain the index of the
diff --git a/cpukit/score/cpu/powerpc/rtems/score/cpu.h b/cpukit/score/cpu/powerpc/rtems/score/cpu.h
index f4aa9c4..5e9e5f9 100644
--- a/cpukit/score/cpu/powerpc/rtems/score/cpu.h
+++ b/cpukit/score/cpu/powerpc/rtems/score/cpu.h
@@ -1034,6 +1034,8 @@ void _CPU_Context_volatile_clobber( uintptr_t pattern );
void _CPU_Context_validate( uintptr_t pattern );
#ifdef RTEMS_SMP
+ uint32_t _CPU_SMP_Initialize( uint32_t configured_cpu_count );
+
RTEMS_COMPILER_PURE_ATTRIBUTE static inline uint32_t
_CPU_SMP_Get_current_processor( void )
{
diff --git a/cpukit/score/cpu/sparc/rtems/score/cpu.h b/cpukit/score/cpu/sparc/rtems/score/cpu.h
index a3b4a1b..19454a6 100644
--- a/cpukit/score/cpu/sparc/rtems/score/cpu.h
+++ b/cpukit/score/cpu/sparc/rtems/score/cpu.h
@@ -1161,6 +1161,8 @@ void _CPU_Context_restore(
) RTEMS_COMPILER_NO_RETURN_ATTRIBUTE;
#if defined(RTEMS_SMP)
+ uint32_t _CPU_SMP_Initialize( uint32_t configured_cpu_count );
+
#if defined(__leon__)
RTEMS_COMPILER_PURE_ATTRIBUTE static inline uint32_t
_CPU_SMP_Get_current_processor( void )
diff --git a/cpukit/score/include/rtems/bspsmp.h b/cpukit/score/include/rtems/bspsmp.h
index d634a36..9cdb6dc 100644
--- a/cpukit/score/include/rtems/bspsmp.h
+++ b/cpukit/score/include/rtems/bspsmp.h
@@ -52,24 +52,6 @@ extern "C" {
#ifndef ASM
/**
- * @brief Performs BSP specific SMP initialization in the context of the main
- * processor.
- *
- * This function is invoked on the main processor by RTEMS during
- * initialization. All interrupt stacks are allocated at this point in case
- * the CPU port allocates the interrupt stacks.
- *
- * The BSP may start secondary processors now.
- *
- * @param[in] configured_cpu_count The count of processors requested by the
- * application configuration.
- *
- * @return The count of processors available for the application in the system.
- * This value is less than or equal to the configured count of processors.
- */
-uint32_t bsp_smp_initialize( uint32_t configured_cpu_count );
-
-/**
* @brief Generate an interprocessor broadcast interrupt.
*
* This method is invoked when RTEMS wants to let all of the other
diff --git a/cpukit/score/src/percpu.c b/cpukit/score/src/percpu.c
index 201c53b..aa95aa9 100644
--- a/cpukit/score/src/percpu.c
+++ b/cpukit/score/src/percpu.c
@@ -29,7 +29,6 @@
#if defined(RTEMS_SMP)
#include <rtems/score/smp.h>
- #include <rtems/bspsmp.h>
void _SMP_Handler_initialize(void)
{
@@ -39,7 +38,7 @@
/*
* Discover and initialize the secondary cores in an SMP system.
*/
- max_cpus = bsp_smp_initialize( max_cpus );
+ max_cpus = _CPU_SMP_Initialize( max_cpus );
_SMP_Processor_count = max_cpus;
diff --git a/cpukit/score/src/smp.c b/cpukit/score/src/smp.c
index c03c148..612c6e9 100644
--- a/cpukit/score/src/smp.c
+++ b/cpukit/score/src/smp.c
@@ -138,7 +138,7 @@ void _SMP_Request_other_cores_to_shutdown( void )
/*
* Do not use _SMP_Get_processor_count() since this value might be not
* initialized yet. For example due to a fatal error in the middle of
- * bsp_smp_initialize().
+ * _CPU_SMP_Initialize().
*/
uint32_t ncpus = rtems_configuration_get_maximum_processors();
--
1.7.7
More information about the devel
mailing list