summaryrefslogtreecommitdiffstats
path: root/cpukit
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2020-11-05 09:32:09 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2020-11-06 14:05:53 +0100
commitb7271f8c1e17bca5148039295c66d9d964a7c884 (patch)
tree525890110972f89db1252ada256146a68c556c11 /cpukit
parentsparc: Move SPARC-specific macros to sparc.h (diff)
downloadrtems-b7271f8c1e17bca5148039295c66d9d964a7c884.tar.bz2
sparc: Add SPARC_IS_INTERRUPT_TRAP()
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 f38e002422..0cf8b2d4fc 100644
--- a/cpukit/score/cpu/sparc/include/rtems/score/sparc.h
+++ b/cpukit/score/cpu/sparc/include/rtems/score/sparc.h
@@ -206,6 +206,23 @@ extern "C" {
*/
#define SPARC_REAL_TRAP_NUMBER( _trap ) ( ( _trap ) % 256 )
+/**
+ * @brief Checks if the real hardware vector number, synchronous trap number,
+ * or asynchronous trap number is an interrupt trap.
+ *
+ * Interrupt traps are defined by Table 7-1 "Exception and Interrupt Request
+ * Priority and tt Values" in "The SPARC Architecture Manual: Version 8".
+ *
+ * @param _trap is the real hardware vector number, synchronous trap number, or
+ * asynchronous trap number to check.
+ *
+ * @return Returns true, if the real hardware vector number, synchronous trap
+ * number, or asynchronous trap number is an interrupt trap, otherwise false.
+ */
+#define SPARC_IS_INTERRUPT_TRAP( _trap ) \
+ ( SPARC_REAL_TRAP_NUMBER( _trap ) >= 0x11 && \
+ SPARC_REAL_TRAP_NUMBER( _trap ) <= 0x1f )
+
#ifndef ASM
/**