From b7271f8c1e17bca5148039295c66d9d964a7c884 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 5 Nov 2020 09:32:09 +0100 Subject: sparc: Add SPARC_IS_INTERRUPT_TRAP() Update #4171. --- cpukit/score/cpu/sparc/include/rtems/score/sparc.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'cpukit') 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 /** -- cgit v1.2.3