forked from Imagelibrary/rtems
bsps: Always install IPI in SMP configs
The inter-processor interrupt (IPI) may be used to process per-CPU jobs. See for example the blocked handler in T_interrupt_test(). Update #3199.
This commit is contained in:
@@ -210,24 +210,22 @@ bool _CPU_SMP_Start_processor(uint32_t cpu_index)
|
|||||||
|
|
||||||
void _CPU_SMP_Finalize_initialization(uint32_t cpu_count)
|
void _CPU_SMP_Finalize_initialization(uint32_t cpu_count)
|
||||||
{
|
{
|
||||||
#ifdef QORIQ_IS_HYPERVISOR_GUEST
|
#ifndef QORIQ_IS_HYPERVISOR_GUEST
|
||||||
(void) cpu_count;
|
rtems_status_code sc;
|
||||||
#else
|
|
||||||
if (cpu_count > 1) {
|
|
||||||
rtems_status_code sc;
|
|
||||||
|
|
||||||
sc = rtems_interrupt_handler_install(
|
sc = rtems_interrupt_handler_install(
|
||||||
QORIQ_IRQ_IPI_0 + IPI_INDEX,
|
QORIQ_IRQ_IPI_0 + IPI_INDEX,
|
||||||
"IPI",
|
"IPI",
|
||||||
RTEMS_INTERRUPT_UNIQUE,
|
RTEMS_INTERRUPT_UNIQUE,
|
||||||
bsp_inter_processor_interrupt,
|
bsp_inter_processor_interrupt,
|
||||||
NULL
|
NULL
|
||||||
);
|
);
|
||||||
if (sc != RTEMS_SUCCESSFUL) {
|
if (sc != RTEMS_SUCCESSFUL) {
|
||||||
bsp_fatal(QORIQ_FATAL_SMP_IPI_HANDLER_INSTALL);
|
bsp_fatal(QORIQ_FATAL_SMP_IPI_HANDLER_INSTALL);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
(void) cpu_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
void _CPU_SMP_Prepare_start_multitasking(void)
|
void _CPU_SMP_Prepare_start_multitasking(void)
|
||||||
|
|||||||
@@ -55,18 +55,15 @@ void bsp_start_on_secondary_processor(Per_CPU_Control *cpu_self)
|
|||||||
|
|
||||||
uint32_t _CPU_SMP_Initialize(void)
|
uint32_t _CPU_SMP_Initialize(void)
|
||||||
{
|
{
|
||||||
if ( rtems_configuration_get_maximum_processors() > 1 ) {
|
GRLIB_Cpu_Unmask_interrupt(GRLIB_mp_irq, _CPU_SMP_Get_current_processor());
|
||||||
GRLIB_Cpu_Unmask_interrupt(GRLIB_mp_irq, _CPU_SMP_Get_current_processor());
|
|
||||||
|
|
||||||
rtems_interrupt_handler_install(
|
rtems_interrupt_handler_install(
|
||||||
GRLIB_mp_irq,
|
GRLIB_mp_irq,
|
||||||
"IPI",
|
"IPI",
|
||||||
RTEMS_INTERRUPT_SHARED,
|
RTEMS_INTERRUPT_SHARED,
|
||||||
bsp_inter_processor_interrupt,
|
bsp_inter_processor_interrupt,
|
||||||
NULL
|
NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return grlib_get_cpu_count(GRLIB_IrqCtrl_Regs);
|
return grlib_get_cpu_count(GRLIB_IrqCtrl_Regs);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,10 +60,8 @@ uint32_t _CPU_SMP_Initialize( void )
|
|||||||
if ( !leon3_data_cache_snooping_enabled() )
|
if ( !leon3_data_cache_snooping_enabled() )
|
||||||
bsp_fatal( LEON3_FATAL_INVALID_CACHE_CONFIG_MAIN_PROCESSOR );
|
bsp_fatal( LEON3_FATAL_INVALID_CACHE_CONFIG_MAIN_PROCESSOR );
|
||||||
|
|
||||||
if ( rtems_configuration_get_maximum_processors() > 1 ) {
|
LEON_Unmask_interrupt(LEON3_mp_irq);
|
||||||
LEON_Unmask_interrupt(LEON3_mp_irq);
|
set_vector(bsp_inter_processor_interrupt, LEON_TRAP_TYPE(LEON3_mp_irq), 1);
|
||||||
set_vector(bsp_inter_processor_interrupt, LEON_TRAP_TYPE(LEON3_mp_irq), 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
return leon3_get_cpu_count(LEON3_IrqCtrl_Regs);
|
return leon3_get_cpu_count(LEON3_IrqCtrl_Regs);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,16 +45,10 @@ void BSP_shared_interrupt_init(void)
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i=0; i <= BSP_INTERRUPT_VECTOR_MAX_STD; i++) {
|
for (i=0; i <= BSP_INTERRUPT_VECTOR_MAX_STD; i++) {
|
||||||
#if defined(LEON3) && \
|
#if defined(LEON3) && (defined(RTEMS_SMP) || defined(RTEMS_MULTIPROCESSING))
|
||||||
(defined(RTEMS_SMP) || defined(RTEMS_MULTIPROCESSING))
|
/* Don't install IRQ handler on IPI interrupt */
|
||||||
/* Don't install IRQ handler on IPI interrupt. An SMP kernel with max one
|
if (i == LEON3_mp_irq)
|
||||||
* CPU does not use IPIs
|
continue;
|
||||||
*/
|
|
||||||
#ifdef RTEMS_SMP
|
|
||||||
if (rtems_configuration_get_maximum_processors() > 1)
|
|
||||||
#endif
|
|
||||||
if (i == LEON3_mp_irq)
|
|
||||||
continue;
|
|
||||||
#endif
|
#endif
|
||||||
vector = SPARC_ASYNCHRONOUS_TRAP(i) + 0x10;
|
vector = SPARC_ASYNCHRONOUS_TRAP(i) + 0x10;
|
||||||
rtems_interrupt_catch(bsp_isr_handler, vector, &previous_isr);
|
rtems_interrupt_catch(bsp_isr_handler, vector, &previous_isr);
|
||||||
|
|||||||
Reference in New Issue
Block a user