summaryrefslogtreecommitdiffstats
path: root/cpukit/score/cpu/sparc/include/rtems/score/sparc.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2020-11-05 09:23:52 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2020-11-06 14:05:53 +0100
commit2c467ec76780f2e93ff99f7993a17a65c03ab924 (patch)
treebb197a82c4ff2607791c3aa424319a39ed2f432a /cpukit/score/cpu/sparc/include/rtems/score/sparc.h
parentrtems-bsps: Use build specification items (diff)
downloadrtems-2c467ec76780f2e93ff99f7993a17a65c03ab924.tar.bz2
sparc: Move SPARC-specific macros to sparc.h
Clarify Doxygen comments. Fix formatting. Update #4171.
Diffstat (limited to '')
-rw-r--r--cpukit/score/cpu/sparc/include/rtems/score/sparc.h41
1 files changed, 40 insertions, 1 deletions
diff --git a/cpukit/score/cpu/sparc/include/rtems/score/sparc.h b/cpukit/score/cpu/sparc/include/rtems/score/sparc.h
index db659cc1fa..f38e002422 100644
--- a/cpukit/score/cpu/sparc/include/rtems/score/sparc.h
+++ b/cpukit/score/cpu/sparc/include/rtems/score/sparc.h
@@ -167,6 +167,45 @@ extern "C" {
#define SPARC_SWTRAP_IRQDIS_FP 11
#endif
+/**
+ * @brief This is the bit step in a vector number to indicate it is being
+ * installed as a synchronous trap.
+ */
+#define SPARC_SYNCHRONOUS_TRAP_BIT_MASK 0x100
+
+/**
+ * @brief Maps the real hardware vector number to the associated asynchronous
+ * trap number.
+ *
+ * @param _vector is the real hardware vector number to map.
+ *
+ * @return Returns the asynchronous trap number associated with the real
+ * hardware vector number.
+ */
+#define SPARC_ASYNCHRONOUS_TRAP( _vector ) ( _vector )
+
+/**
+ * @brief Maps the real hardware vector number to the associated synchronous
+ * trap number.
+ *
+ * @param _vector is the real hardware vector number to map.
+ *
+ * @return Returns the synchronous trap number associated with the
+ * real hardware vector number.
+ */
+#define SPARC_SYNCHRONOUS_TRAP( _vector ) ( ( _vector ) + 256 )
+
+/**
+ * @brief Maps the synchronous or asynchronous trap number to the associated
+ * real hardware vector number.
+ *
+ * @param _trap is the synchronous or asynchronous trap number to map.
+ *
+ * @return Returns the real hardware vector number associated with the
+ * synchronous or asynchronous trap number.
+ */
+#define SPARC_REAL_TRAP_NUMBER( _trap ) ( ( _trap ) % 256 )
+
#ifndef ASM
/**
@@ -411,7 +450,7 @@ static inline uint32_t _LEON3_Get_current_processor( void )
return asr17 >> LEON3_ASR17_PROCESSOR_INDEX_SHIFT;
}
-#endif
+#endif /* ASM */
#ifdef __cplusplus
}