summaryrefslogtreecommitdiffstats
path: root/bsps/sparc/leon2/include/leon.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2021-07-01 14:45:58 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2021-07-26 19:57:31 +0200
commit09be98d9101fcf9edb5fcc9c89187798c73d3911 (patch)
tree934ad68b13767e59f9e664d2292ddefe0ac447bb /bsps/sparc/leon2/include/leon.h
parentbsps/irq: Implement new directives for GICv2/3 (diff)
downloadrtems-09be98d9101fcf9edb5fcc9c89187798c73d3911.tar.bz2
sparc/irq: Implement new interrupt directives
Update #3269.
Diffstat (limited to 'bsps/sparc/leon2/include/leon.h')
-rw-r--r--bsps/sparc/leon2/include/leon.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/bsps/sparc/leon2/include/leon.h b/bsps/sparc/leon2/include/leon.h
index fc90e1f7e6..11196aee6d 100644
--- a/bsps/sparc/leon2/include/leon.h
+++ b/bsps/sparc/leon2/include/leon.h
@@ -295,7 +295,11 @@ static __inline__ int bsp_irq_fixup(int irq)
#define LEON_Force_interrupt( _source ) \
do { \
- LEON_REG.Interrupt_Force = (1 << (_source)); \
+ uint32_t _level; \
+ \
+ _level = sparc_disable_interrupts(); \
+ LEON_REG.Interrupt_Force |= (1 << (_source)); \
+ sparc_enable_interrupts( _level ); \
} while (0)
#define LEON_Is_interrupt_pending( _source ) \
@@ -348,7 +352,17 @@ static __inline__ int bsp_irq_fixup(int irq)
/* Make all SPARC BSPs have common macros for interrupt handling */
#define BSP_Clear_interrupt(_source) LEON_Clear_interrupt(_source)
#define BSP_Force_interrupt(_source) LEON_Force_interrupt(_source)
+#define BSP_Clear_forced_interrupt( _source ) \
+ do { \
+ uint32_t _level; \
+ \
+ _level = sparc_disable_interrupts(); \
+ LEON_REG.Interrupt_Force &= ~(1 << (_source)); \
+ sparc_enable_interrupts( _level ); \
+ } while (0)
#define BSP_Is_interrupt_pending(_source) LEON_Is_interrupt_pending(_source)
+#define BSP_Is_interrupt_forced(_source) \
+ (LEON_REG.Interrupt_Force & (1 << (_source)))
#define BSP_Is_interrupt_masked(_source) LEON_Is_interrupt_masked(_source)
#define BSP_Unmask_interrupt(_source) LEON_Unmask_interrupt(_source)
#define BSP_Mask_interrupt(_source) LEON_Mask_interrupt(_source)