[PATCH 1/3] score: _SMP_Inter_processor_interrupt_handler()
Sebastian Huber
sebastian.huber at embedded-brains.de
Tue Jul 24 12:38:05 UTC 2018
Pass current processor control via parameter since it may be already
available at the caller side.
---
bsps/arm/raspberrypi/irq/irq.c | 4 +++-
bsps/arm/shared/start/arm-a9mpcore-smp.c | 2 +-
bsps/i386/pc386/start/smp-imps.c | 2 +-
bsps/powerpc/qoriq/irq/irq.c | 2 +-
bsps/powerpc/qoriq/start/bspsmp.c | 2 +-
bsps/sparc/leon3/start/bspsmp.c | 2 +-
cpukit/include/rtems/score/smpimpl.h | 9 ++++-----
7 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/bsps/arm/raspberrypi/irq/irq.c b/bsps/arm/raspberrypi/irq/irq.c
index 5b10385bfe..925596ae51 100644
--- a/bsps/arm/raspberrypi/irq/irq.c
+++ b/bsps/arm/raspberrypi/irq/irq.c
@@ -109,7 +109,9 @@ void bsp_interrupt_dispatch(void)
if ( local_source & BCM2836_IRQ_SOURCE_MBOX3 ) {
/* reset mailbox 3 contents to zero */
BCM2835_REG(BCM2836_MAILBOX_3_READ_CLEAR_BASE + 0x10 * cpu_index_self) = 0xffffffff;
- _SMP_Inter_processor_interrupt_handler();
+ _SMP_Inter_processor_interrupt_handler(
+ _Per_CPU_Get_by_index(cpu_index_self)
+ );
}
if ( cpu_index_self != 0 )
return;
diff --git a/bsps/arm/shared/start/arm-a9mpcore-smp.c b/bsps/arm/shared/start/arm-a9mpcore-smp.c
index a8d3a541d4..c2550136f8 100644
--- a/bsps/arm/shared/start/arm-a9mpcore-smp.c
+++ b/bsps/arm/shared/start/arm-a9mpcore-smp.c
@@ -22,7 +22,7 @@
static void bsp_inter_processor_interrupt(void *arg)
{
- _SMP_Inter_processor_interrupt_handler();
+ _SMP_Inter_processor_interrupt_handler(_Per_CPU_Get());
}
uint32_t _CPU_SMP_Initialize(void)
diff --git a/bsps/i386/pc386/start/smp-imps.c b/bsps/i386/pc386/start/smp-imps.c
index 2ba36804cb..405f7f0a92 100644
--- a/bsps/i386/pc386/start/smp-imps.c
+++ b/bsps/i386/pc386/start/smp-imps.c
@@ -755,7 +755,7 @@ static void bsp_inter_processor_interrupt(void *arg)
smp_apic_ack();
- message = _SMP_Inter_processor_interrupt_handler();
+ message = _SMP_Inter_processor_interrupt_handler(_Per_CPU_Get());
if ((message & SMP_MESSAGE_CLOCK_TICK) != 0) {
Clock_isr(NULL);
diff --git a/bsps/powerpc/qoriq/irq/irq.c b/bsps/powerpc/qoriq/irq/irq.c
index 625b9fce1b..18ca0741e0 100644
--- a/bsps/powerpc/qoriq/irq/irq.c
+++ b/bsps/powerpc/qoriq/irq/irq.c
@@ -100,7 +100,7 @@ void bsp_interrupt_dispatch(uintptr_t exception_number)
#ifdef RTEMS_SMP
if (exception_number == 36) {
- _SMP_Inter_processor_interrupt_handler();
+ _SMP_Inter_processor_interrupt_handler(_Per_CPU_Get());
return;
}
#endif
diff --git a/bsps/powerpc/qoriq/start/bspsmp.c b/bsps/powerpc/qoriq/start/bspsmp.c
index a2d9fbede5..048275b1fc 100644
--- a/bsps/powerpc/qoriq/start/bspsmp.c
+++ b/bsps/powerpc/qoriq/start/bspsmp.c
@@ -101,7 +101,7 @@ void bsp_start_on_secondary_processor(void)
#ifndef QORIQ_IS_HYPERVISOR_GUEST
static void bsp_inter_processor_interrupt(void *arg)
{
- _SMP_Inter_processor_interrupt_handler();
+ _SMP_Inter_processor_interrupt_handler(_Per_CPU_Get());
}
#endif
diff --git a/bsps/sparc/leon3/start/bspsmp.c b/bsps/sparc/leon3/start/bspsmp.c
index 280788fa1c..1ef6e8eb3b 100644
--- a/bsps/sparc/leon3/start/bspsmp.c
+++ b/bsps/sparc/leon3/start/bspsmp.c
@@ -32,7 +32,7 @@ static rtems_isr bsp_inter_processor_interrupt(
rtems_vector_number vector
)
{
- _SMP_Inter_processor_interrupt_handler();
+ _SMP_Inter_processor_interrupt_handler(_Per_CPU_Get());
}
void bsp_start_on_secondary_processor()
diff --git a/cpukit/include/rtems/score/smpimpl.h b/cpukit/include/rtems/score/smpimpl.h
index 48e6a12498..fd92f655c7 100644
--- a/cpukit/include/rtems/score/smpimpl.h
+++ b/cpukit/include/rtems/score/smpimpl.h
@@ -165,12 +165,11 @@ void _SMP_Multicast_actions_process( void );
*
* @return The received message.
*/
-static inline long unsigned _SMP_Inter_processor_interrupt_handler( void )
+static inline long unsigned _SMP_Inter_processor_interrupt_handler(
+ Per_CPU_Control *cpu_self
+)
{
- Per_CPU_Control *cpu_self;
- unsigned long message;
-
- cpu_self = _Per_CPU_Get();
+ unsigned long message;
/*
* In the common case the inter-processor interrupt is issued to carry out a
--
2.13.7
More information about the devel
mailing list