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:
Sebastian Huber
2020-08-31 14:12:14 +02:00
parent b87efa7599
commit d556af3605
4 changed files with 27 additions and 40 deletions

View File

@@ -210,24 +210,22 @@ bool _CPU_SMP_Start_processor(uint32_t cpu_index)
void _CPU_SMP_Finalize_initialization(uint32_t cpu_count)
{
#ifdef QORIQ_IS_HYPERVISOR_GUEST
(void) cpu_count;
#else
if (cpu_count > 1) {
rtems_status_code sc;
#ifndef QORIQ_IS_HYPERVISOR_GUEST
rtems_status_code sc;
sc = rtems_interrupt_handler_install(
QORIQ_IRQ_IPI_0 + IPI_INDEX,
"IPI",
RTEMS_INTERRUPT_UNIQUE,
bsp_inter_processor_interrupt,
NULL
);
if (sc != RTEMS_SUCCESSFUL) {
bsp_fatal(QORIQ_FATAL_SMP_IPI_HANDLER_INSTALL);
}
sc = rtems_interrupt_handler_install(
QORIQ_IRQ_IPI_0 + IPI_INDEX,
"IPI",
RTEMS_INTERRUPT_UNIQUE,
bsp_inter_processor_interrupt,
NULL
);
if (sc != RTEMS_SUCCESSFUL) {
bsp_fatal(QORIQ_FATAL_SMP_IPI_HANDLER_INSTALL);
}
#endif
(void) cpu_count;
}
void _CPU_SMP_Prepare_start_multitasking(void)

View File

@@ -55,18 +55,15 @@ void bsp_start_on_secondary_processor(Per_CPU_Control *cpu_self)
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(
GRLIB_mp_irq,
"IPI",
RTEMS_INTERRUPT_SHARED,
bsp_inter_processor_interrupt,
NULL
);
}
rtems_interrupt_handler_install(
GRLIB_mp_irq,
"IPI",
RTEMS_INTERRUPT_SHARED,
bsp_inter_processor_interrupt,
NULL
);
return grlib_get_cpu_count(GRLIB_IrqCtrl_Regs);
}

View File

@@ -60,10 +60,8 @@ uint32_t _CPU_SMP_Initialize( void )
if ( !leon3_data_cache_snooping_enabled() )
bsp_fatal( LEON3_FATAL_INVALID_CACHE_CONFIG_MAIN_PROCESSOR );
if ( rtems_configuration_get_maximum_processors() > 1 ) {
LEON_Unmask_interrupt(LEON3_mp_irq);
set_vector(bsp_inter_processor_interrupt, LEON_TRAP_TYPE(LEON3_mp_irq), 1);
}
LEON_Unmask_interrupt(LEON3_mp_irq);
set_vector(bsp_inter_processor_interrupt, LEON_TRAP_TYPE(LEON3_mp_irq), 1);
return leon3_get_cpu_count(LEON3_IrqCtrl_Regs);
}

View File

@@ -45,16 +45,10 @@ void BSP_shared_interrupt_init(void)
int i;
for (i=0; i <= BSP_INTERRUPT_VECTOR_MAX_STD; i++) {
#if defined(LEON3) && \
(defined(RTEMS_SMP) || defined(RTEMS_MULTIPROCESSING))
/* Don't install IRQ handler on IPI interrupt. An SMP kernel with max one
* CPU does not use IPIs
*/
#ifdef RTEMS_SMP
if (rtems_configuration_get_maximum_processors() > 1)
#endif
if (i == LEON3_mp_irq)
continue;
#if defined(LEON3) && (defined(RTEMS_SMP) || defined(RTEMS_MULTIPROCESSING))
/* Don't install IRQ handler on IPI interrupt */
if (i == LEON3_mp_irq)
continue;
#endif
vector = SPARC_ASYNCHRONOUS_TRAP(i) + 0x10;
rtems_interrupt_catch(bsp_isr_handler, vector, &previous_isr);