diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-09-08 07:38:05 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-12-09 16:37:32 +0100 |
commit | d375210d7d16a9a83af02e586ffadb01cf1d992a (patch) | |
tree | 5be7aa999eadf28b7db30b26830dee94b03c96f6 | |
parent | 2b08beca611f2c982e1fe238a77951e51262e21b (diff) |
leon3 tm27.h
-rw-r--r-- | bsps/sparc/leon3/include/tm27.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/bsps/sparc/leon3/include/tm27.h b/bsps/sparc/leon3/include/tm27.h index cfc97b125d..d4a321fcdf 100644 --- a/bsps/sparc/leon3/include/tm27.h +++ b/bsps/sparc/leon3/include/tm27.h @@ -21,6 +21,8 @@ #define __tm27_h #include <bsp.h> +#include <bsp/irq.h> +#include <rtems/score/smpimpl.h> /* * Define the interrupt mechanism for Time Test 27 @@ -69,6 +71,17 @@ static inline void Install_tm27_vector( static rtems_interrupt_entry entry_low; static rtems_interrupt_entry entry_high; +#if defined(RTEMS_SMP) + bsp_interrupt_set_affinity( + TEST_INTERRUPT_SOURCE, + _SMP_Get_online_processors() + ); + bsp_interrupt_set_affinity( + TEST_INTERRUPT_SOURCE2, + _SMP_Get_online_processors() + ); +#endif + rtems_interrupt_entry_initialize( &entry_low, (rtems_interrupt_handler) handler, @@ -93,6 +106,18 @@ static inline void Install_tm27_vector( ); } +#if defined(RTEMS_SMP) +#define Cause_tm27_intr() \ + do { \ + rtems_interrupt_raise_on( \ + TEST_INTERRUPT_SOURCE + (Interrupt_nest >> 1 ), \ + rtems_scheduler_get_processor() \ + ); \ + nop(); \ + nop(); \ + nop(); \ + } while (0) +#else #define Cause_tm27_intr() \ do { \ rtems_interrupt_raise( TEST_INTERRUPT_SOURCE+(Interrupt_nest>>1)); \ @@ -100,6 +125,7 @@ static inline void Install_tm27_vector( nop(); \ nop(); \ } while (0) +#endif #define Clear_tm27_intr() \ rtems_interrupt_clear( TEST_INTERRUPT_SOURCE ) |