summaryrefslogtreecommitdiffstats
path: root/cpukit
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2020-11-05 09:50:36 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2020-11-06 14:05:53 +0100
commit828114778d8ba52fac1cf401978f2aacaedb572c (patch)
tree7cb1fc59a1f3536ddef88f33bb27622c27c11a27 /cpukit
parentsparc: Add SPARC_IS_INTERRUPT_TRAP() (diff)
downloadrtems-828114778d8ba52fac1cf401978f2aacaedb572c.tar.bz2
sparc: Add SPARC_INTERRUPT_TRAP_TO_SOURCE()
Update #4171.
Diffstat (limited to 'cpukit')
-rw-r--r--cpukit/score/cpu/sparc/include/rtems/score/sparc.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/cpukit/score/cpu/sparc/include/rtems/score/sparc.h b/cpukit/score/cpu/sparc/include/rtems/score/sparc.h
index 0cf8b2d4fc..182281f394 100644
--- a/cpukit/score/cpu/sparc/include/rtems/score/sparc.h
+++ b/cpukit/score/cpu/sparc/include/rtems/score/sparc.h
@@ -223,6 +223,23 @@ extern "C" {
( SPARC_REAL_TRAP_NUMBER( _trap ) >= 0x11 && \
SPARC_REAL_TRAP_NUMBER( _trap ) <= 0x1f )
+/**
+ * @brief Maps the interrupt trap number to the associated interrupt source
+ * number.
+ *
+ * Interrupt trap numbers are real hardware vector numbers, synchronous trap
+ * numbers, and asynchronous trap numbers for which SPARC_IS_INTERRUPT_TRAP()
+ * returns true.
+ *
+ * @param _trap is the real hardware vector number, synchronous trap number, or
+ * asynchronous trap number to map.
+ *
+ * @return Returns the interrupt source number associated with the interrupt
+ * trap number.
+ */
+#define SPARC_INTERRUPT_TRAP_TO_SOURCE( _trap ) \
+ ( SPARC_REAL_TRAP_NUMBER( _trap ) - 0x10 )
+
#ifndef ASM
/**