[rtems commit] bsps: Use bsp_start_on_secondary_processor()
Sebastian Huber
sebh at rtems.org
Mon May 12 07:19:38 UTC 2014
Module: rtems
Branch: master
Commit: 6c5c2f39d05543c2d30e8fc44e93dd961c68e43d
Changeset: http://git.rtems.org/rtems/commit/?id=6c5c2f39d05543c2d30e8fc44e93dd961c68e43d
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Mon May 12 09:23:51 2014 +0200
bsps: Use bsp_start_on_secondary_processor()
Use a standard function for startup on secondary processors.
---
c/src/lib/libbsp/powerpc/qoriq/include/bsp.h | 2 --
c/src/lib/libbsp/powerpc/qoriq/start/start.S | 2 +-
c/src/lib/libbsp/powerpc/qoriq/startup/bspsmp.c | 3 ++-
c/src/lib/libbsp/sparc/leon3/include/leon.h | 7 -------
c/src/lib/libbsp/sparc/leon3/startup/bspsmp.c | 7 +++++--
c/src/lib/libbsp/sparc/shared/start/start.S | 2 +-
testsuites/smptests/smpfatal08/init.c | 15 +++------------
7 files changed, 12 insertions(+), 26 deletions(-)
diff --git a/c/src/lib/libbsp/powerpc/qoriq/include/bsp.h b/c/src/lib/libbsp/powerpc/qoriq/include/bsp.h
index 6d4f83d..a4be2e2 100644
--- a/c/src/lib/libbsp/powerpc/qoriq/include/bsp.h
+++ b/c/src/lib/libbsp/powerpc/qoriq/include/bsp.h
@@ -59,8 +59,6 @@ int qoriq_if_intercom_attach_detach(
#define RTEMS_BSP_NETWORK_DRIVER_NAME3 "tsec3"
#define RTEMS_BSP_NETWORK_DRIVER_NAME4 "intercom1"
-void qoriq_secondary_cpu_initialize(void);
-
#ifdef __cplusplus
}
#endif /* __cplusplus */
diff --git a/c/src/lib/libbsp/powerpc/qoriq/start/start.S b/c/src/lib/libbsp/powerpc/qoriq/start/start.S
index 6a67127..9ef1c07 100644
--- a/c/src/lib/libbsp/powerpc/qoriq/start/start.S
+++ b/c/src/lib/libbsp/powerpc/qoriq/start/start.S
@@ -208,7 +208,7 @@ _start_core_1:
LA r2, _SDA2_BASE_
LA r13, _SDA_BASE_
- b qoriq_secondary_cpu_initialize
+ b bsp_start_on_secondary_processor
b twiddle
#endif /* RTEMS_SMP */
diff --git a/c/src/lib/libbsp/powerpc/qoriq/startup/bspsmp.c b/c/src/lib/libbsp/powerpc/qoriq/startup/bspsmp.c
index 5b4c12a..5e2646d 100644
--- a/c/src/lib/libbsp/powerpc/qoriq/startup/bspsmp.c
+++ b/c/src/lib/libbsp/powerpc/qoriq/startup/bspsmp.c
@@ -22,6 +22,7 @@
#include <bsp/mmu.h>
#include <bsp/qoriq.h>
#include <bsp/vectors.h>
+#include <bsp/bootcard.h>
#include <bsp/irq-generic.h>
#include <bsp/linker-symbols.h>
@@ -107,7 +108,7 @@ static void release_core_1(void)
mmu_config_undo();
}
-void qoriq_secondary_cpu_initialize(void)
+void bsp_start_on_secondary_processor(void)
{
const Per_CPU_Control *second_cpu = _Per_CPU_Get_by_index(1);
diff --git a/c/src/lib/libbsp/sparc/leon3/include/leon.h b/c/src/lib/libbsp/sparc/leon3/include/leon.h
index 3ca33a3..bda28f2 100644
--- a/c/src/lib/libbsp/sparc/leon3/include/leon.h
+++ b/c/src/lib/libbsp/sparc/leon3/include/leon.h
@@ -327,13 +327,6 @@ void apbuart_outbyte_polled(
*/
int apbuart_inbyte_nonblocking(struct apbuart_regs *regs);
-/**
- * @brief Initializes a secondary processor.
- *
- * @param[in] cpu The processor executing this function.
- */
-void leon3_secondary_cpu_initialize(uint32_t cpu);
-
void leon3_cpu_counter_initialize(void);
/* GRLIB extended IRQ controller register */
diff --git a/c/src/lib/libbsp/sparc/leon3/startup/bspsmp.c b/c/src/lib/libbsp/sparc/leon3/startup/bspsmp.c
index bb53132..6eec341 100644
--- a/c/src/lib/libbsp/sparc/leon3/startup/bspsmp.c
+++ b/c/src/lib/libbsp/sparc/leon3/startup/bspsmp.c
@@ -14,6 +14,7 @@
*/
#include <bsp.h>
+#include <bsp/bootcard.h>
#include <leon.h>
#include <rtems/bspIo.h>
#include <rtems/score/smpimpl.h>
@@ -33,11 +34,13 @@ static rtems_isr bsp_inter_processor_interrupt(
_SMP_Inter_processor_interrupt_handler();
}
-void leon3_secondary_cpu_initialize(uint32_t cpu_index)
+void bsp_start_on_secondary_processor()
{
+ uint32_t cpu_index_self = _CPU_SMP_Get_current_processor();
+
leon3_set_cache_control_register(0x80000F);
/* Unmask IPI interrupts at Interrupt controller for this CPU */
- LEON3_IrqCtrl_Regs->mask[cpu_index] |= 1U << LEON3_MP_IRQ;
+ LEON3_IrqCtrl_Regs->mask[cpu_index_self] |= 1U << LEON3_MP_IRQ;
_SMP_Start_multitasking_on_secondary_processor();
}
diff --git a/c/src/lib/libbsp/sparc/shared/start/start.S b/c/src/lib/libbsp/sparc/shared/start/start.S
index ccf789e..26da7b4 100644
--- a/c/src/lib/libbsp/sparc/shared/start/start.S
+++ b/c/src/lib/libbsp/sparc/shared/start/start.S
@@ -241,7 +241,7 @@ SYM(hard_reset):
andn %sp, 0x0f, %sp ! align stack on 16-byte boundary
mov %sp, %fp ! set frame pointer
- call SYM(leon3_secondary_cpu_initialize) ! does not return
+ call SYM(bsp_start_on_secondary_processor) ! does not return
sub %sp, CPU_MINIMUM_STACK_FRAME_SIZE, %sp
ba SYM(bsp_reset) ! just in case
nop
diff --git a/testsuites/smptests/smpfatal08/init.c b/testsuites/smptests/smpfatal08/init.c
index 59fe4a6..b005443 100644
--- a/testsuites/smptests/smpfatal08/init.c
+++ b/testsuites/smptests/smpfatal08/init.c
@@ -20,6 +20,8 @@
#include <rtems/test.h>
#include <rtems/score/smpimpl.h>
+#include <bsp/bootcard.h>
+
#include <assert.h>
#include <stdlib.h>
@@ -30,21 +32,10 @@ const char rtems_test_name[] = "SMPFATAL 8";
* without BSP support.
*/
-#if defined(__PPC__)
-void qoriq_secondary_cpu_initialize(void)
+void bsp_start_on_secondary_processor(void)
{
/* Provided to avoid multiple definitions of the CPU SMP support functions */
}
-#endif
-
-#if defined(__sparc__)
-void leon3_secondary_cpu_initialize(uint32_t cpu_index)
-{
- (void) cpu_index;
-
- /* Provided to avoid multiple definitions of the CPU SMP support functions */
-}
-#endif
uint32_t _CPU_SMP_Initialize(void)
{
More information about the vc
mailing list