forked from Imagelibrary/rtems
smp: Add and use _CPU_SMP_Send_interrupt()
Delete bsp_smp_interrupt_cpu().
This commit is contained in:
@@ -56,11 +56,11 @@ void bsp_smp_broadcast_interrupt(void)
|
||||
);
|
||||
}
|
||||
|
||||
void bsp_smp_interrupt_cpu(int cpu)
|
||||
void _CPU_SMP_Send_interrupt( uint32_t target_processor_index )
|
||||
{
|
||||
rtems_status_code sc = arm_gic_irq_generate_software_irq(
|
||||
ARM_GIC_IRQ_SGI_0,
|
||||
ARM_GIC_IRQ_SOFTWARE_IRQ_TO_ALL_IN_LIST,
|
||||
(uint8_t) (1U << cpu)
|
||||
(uint8_t) (1U << target_processor_index)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -803,11 +803,9 @@ uint32_t bsp_smp_initialize( uint32_t configured_cpu_count )
|
||||
return cores;
|
||||
}
|
||||
|
||||
void bsp_smp_interrupt_cpu(
|
||||
int cpu
|
||||
)
|
||||
void _CPU_SMP_Send_interrupt( uint32_t target_processor_index )
|
||||
{
|
||||
send_ipi( cpu, 0x30 );
|
||||
send_ipi( target_processor_index, 0x30 );
|
||||
}
|
||||
|
||||
void bsp_smp_broadcast_interrupt(void)
|
||||
|
||||
@@ -167,8 +167,9 @@ void bsp_smp_broadcast_interrupt(void)
|
||||
qoriq.pic.per_cpu [self].ipidr [IPI_INDEX].reg = ALL_CORES;
|
||||
}
|
||||
|
||||
void bsp_smp_interrupt_cpu(int core)
|
||||
void _CPU_SMP_Send_interrupt(uint32_t target_processor_index)
|
||||
{
|
||||
uint32_t self = ppc_processor_id();
|
||||
qoriq.pic.per_cpu [self].ipidr [IPI_INDEX].reg = ONE_CORE(core);
|
||||
qoriq.pic.per_cpu [self].ipidr [IPI_INDEX].reg =
|
||||
ONE_CORE(target_processor_index);
|
||||
}
|
||||
|
||||
@@ -31,9 +31,7 @@ void bsp_smp_broadcast_message(
|
||||
{
|
||||
}
|
||||
|
||||
void bsp_smp_interrupt_cpu(
|
||||
int cpu
|
||||
)
|
||||
void _CPU_SMP_Send_interrupt( uint32_t target_processor_index )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -115,12 +115,10 @@ uint32_t bsp_smp_initialize( uint32_t configured_cpu_count )
|
||||
return found_cpus;
|
||||
}
|
||||
|
||||
void bsp_smp_interrupt_cpu(
|
||||
int cpu
|
||||
)
|
||||
void _CPU_SMP_Send_interrupt(uint32_t target_processor_index)
|
||||
{
|
||||
/* send interrupt to destination CPU */
|
||||
LEON3_IrqCtrl_Regs->force[cpu] = 1 << LEON3_MP_IRQ;
|
||||
LEON3_IrqCtrl_Regs->force[target_processor_index] = 1 << LEON3_MP_IRQ;
|
||||
}
|
||||
|
||||
void bsp_smp_broadcast_interrupt(void)
|
||||
@@ -135,7 +133,7 @@ void bsp_smp_broadcast_interrupt(void)
|
||||
for ( dest_cpu=0 ; dest_cpu < max_cpus ; dest_cpu++ ) {
|
||||
if ( cpu == dest_cpu )
|
||||
continue;
|
||||
bsp_smp_interrupt_cpu( dest_cpu );
|
||||
_CPU_SMP_Send_interrupt( dest_cpu );
|
||||
/* this is likely needed due to the ISR code not being SMP aware yet */
|
||||
bsp_smp_delay( 100000 );
|
||||
}
|
||||
|
||||
@@ -457,6 +457,8 @@ void _CPU_Context_validate( uintptr_t pattern );
|
||||
return mpidr & 0xffU;
|
||||
}
|
||||
|
||||
void _CPU_SMP_Send_interrupt( uint32_t target_processor_index );
|
||||
|
||||
static inline void _ARM_Data_memory_barrier( void )
|
||||
{
|
||||
__asm__ volatile ( "dmb" : : : "memory" );
|
||||
|
||||
@@ -457,6 +457,8 @@ uint32_t _CPU_ISR_Get_level( void );
|
||||
|
||||
RTEMS_COMPILER_PURE_ATTRIBUTE uint32_t _CPU_SMP_Get_current_processor( void );
|
||||
|
||||
void _CPU_SMP_Send_interrupt( uint32_t target_processor_index );
|
||||
|
||||
static inline void _CPU_Processor_event_broadcast( void )
|
||||
{
|
||||
__asm__ volatile ( "" : : : "memory" );
|
||||
|
||||
@@ -1416,6 +1416,16 @@ static inline uint32_t CPU_swap_u32(
|
||||
return 123;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Sends an inter-processor interrupt to the specified target
|
||||
* processor.
|
||||
*
|
||||
* This operation is undefined for target processor indices out of range.
|
||||
*
|
||||
* @param[in] target_processor_index The target processor index.
|
||||
*/
|
||||
void _CPU_SMP_Send_interrupt( uint32_t target_processor_index );
|
||||
|
||||
/**
|
||||
* @brief Broadcasts a processor event.
|
||||
*
|
||||
|
||||
@@ -1014,6 +1014,7 @@ void _CPU_Context_validate( uintptr_t pattern );
|
||||
return pir;
|
||||
}
|
||||
|
||||
void _CPU_SMP_Send_interrupt( uint32_t target_processor_index );
|
||||
|
||||
static inline void _CPU_Processor_event_broadcast( void )
|
||||
{
|
||||
|
||||
@@ -1188,6 +1188,8 @@ void _CPU_Context_restore(
|
||||
|
||||
RTEMS_COMPILER_PURE_ATTRIBUTE uint32_t _CPU_SMP_Get_current_processor( void );
|
||||
|
||||
void _CPU_SMP_Send_interrupt( uint32_t target_processor_index );
|
||||
|
||||
static inline void _CPU_Processor_event_broadcast( void )
|
||||
{
|
||||
__asm__ volatile ( "" : : : "memory" );
|
||||
|
||||
@@ -83,18 +83,6 @@ uint32_t bsp_smp_initialize( uint32_t configured_cpu_count );
|
||||
*/
|
||||
void bsp_smp_broadcast_interrupt(void);
|
||||
|
||||
/**
|
||||
* @brief Generate a interprocessor interrupt.
|
||||
*
|
||||
* This method is invoked by RTEMS to let @a cpu know that it
|
||||
* has sent it a message.
|
||||
*
|
||||
* @param [in] cpu is the recipient CPU
|
||||
*/
|
||||
void bsp_smp_interrupt_cpu(
|
||||
int cpu
|
||||
);
|
||||
|
||||
/**
|
||||
* @brief Performs high-level initialization of a secondary processor and runs
|
||||
* the application threads.
|
||||
|
||||
@@ -121,7 +121,7 @@ void _SMP_Send_message( uint32_t cpu, uint32_t message )
|
||||
per_cpu->message |= message;
|
||||
_Per_CPU_Lock_release( per_cpu, level );
|
||||
|
||||
bsp_smp_interrupt_cpu( cpu );
|
||||
_CPU_SMP_Send_interrupt( cpu );
|
||||
}
|
||||
|
||||
void _SMP_Broadcast_message( uint32_t message )
|
||||
|
||||
Reference in New Issue
Block a user