diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-07-16 16:07:23 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2023-07-14 12:21:33 +0200 |
commit | c77a20e85b7303d4f019d1430a550d3f4d0746a6 (patch) | |
tree | ab40454ba65a4726d4b436a27cf73bfa26d6fd4f /bsps/sparc/leon3/start/bspsmp.c | |
parent | bsp/leon3: Move and simplify bsp_irq_fixup() (diff) | |
download | rtems-c77a20e85b7303d4f019d1430a550d3f4d0746a6.tar.bz2 |
bsp/leon3: Use new IRQ(A)MP register block API
Diffstat (limited to 'bsps/sparc/leon3/start/bspsmp.c')
-rw-r--r-- | bsps/sparc/leon3/start/bspsmp.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/bsps/sparc/leon3/start/bspsmp.c b/bsps/sparc/leon3/start/bspsmp.c index acd932843a..a8ad60b497 100644 --- a/bsps/sparc/leon3/start/bspsmp.c +++ b/bsps/sparc/leon3/start/bspsmp.c @@ -17,6 +17,7 @@ #include <bsp/bootcard.h> #include <bsp/fatal.h> #include <bsp/irq.h> +#include <bsp/leon3.h> #include <leon.h> #include <rtems/bspIo.h> #include <rtems/sysinit.h> @@ -75,6 +76,11 @@ static void leon3_install_inter_processor_interrupt( void ) _Assert_Unused_variable_equals( sc, RTEMS_SUCCESSFUL ); } +static uint32_t leon3_get_cpu_count( const irqamp *regs ) +{ + return IRQAMP_MPSTAT_NCPU_GET( grlib_load_32( ®s->mpstat ) ) + 1; +} + uint32_t _CPU_SMP_Initialize( void ) { if ( !leon3_data_cache_snooping_enabled() ) @@ -89,7 +95,10 @@ bool _CPU_SMP_Start_processor( uint32_t cpu_index ) printk( "Waking CPU %d\n", cpu_index ); #endif - LEON3_IrqCtrl_Regs->mpstat = 1U << cpu_index; + grlib_store_32( + &LEON3_IrqCtrl_Regs->mpstat, + IRQAMP_MPSTAT_STATUS(1U << cpu_index) + ); return true; } @@ -111,7 +120,10 @@ void _CPU_SMP_Prepare_start_multitasking( void ) void _CPU_SMP_Send_interrupt(uint32_t target_processor_index) { /* send interrupt to destination CPU */ - LEON3_IrqCtrl_Regs->force[target_processor_index] = 1 << LEON3_mp_irq; + grlib_store_32( + &LEON3_IrqCtrl_Regs->piforce[target_processor_index], + 1U << LEON3_mp_irq + ); } #if defined(RTEMS_DRVMGR_STARTUP) |