[rtems commit] sparc: Move SPARC-specific macros to sparc.h

Sebastian Huber sebh at rtems.org
Fri Nov 6 13:07:26 UTC 2020


Module:    rtems
Branch:    master
Commit:    2c467ec76780f2e93ff99f7993a17a65c03ab924
Changeset: http://git.rtems.org/rtems/commit/?id=2c467ec76780f2e93ff99f7993a17a65c03ab924

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Thu Nov  5 09:23:52 2020 +0100

sparc: Move SPARC-specific macros to sparc.h

Clarify Doxygen comments.  Fix formatting.

Update #4171.

---

 cpukit/score/cpu/sparc/include/rtems/score/cpu.h   | 21 -----------
 cpukit/score/cpu/sparc/include/rtems/score/sparc.h | 41 +++++++++++++++++++++-
 2 files changed, 40 insertions(+), 22 deletions(-)

diff --git a/cpukit/score/cpu/sparc/include/rtems/score/cpu.h b/cpukit/score/cpu/sparc/include/rtems/score/cpu.h
index e2604bb..8c5330b 100644
--- a/cpukit/score/cpu/sparc/include/rtems/score/cpu.h
+++ b/cpukit/score/cpu/sparc/include/rtems/score/cpu.h
@@ -692,27 +692,6 @@ extern const CPU_Trap_table_entry _CPU_Trap_slot_template;
 #define CPU_INTERRUPT_MAXIMUM_VECTOR_NUMBER 511
 
 /**
- * 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
-
-/**
- * This macro indicates that @a _trap as an asynchronous trap.
- */
-#define SPARC_ASYNCHRONOUS_TRAP( _trap )    (_trap)
-
-/**
- * This macro indicates that @a _trap as a synchronous trap.
- */
-#define SPARC_SYNCHRONOUS_TRAP( _trap )     ((_trap) + 256 )
-
-/**
- * This macro returns the real hardware vector number associated with @a _trap.
- */
-#define SPARC_REAL_TRAP_NUMBER( _trap )     ((_trap) % 256)
-
-/**
  * This is defined if the port has a special way to report the ISR nesting
  * level.  Most ports maintain the variable _ISR_Nest_level.
  */
diff --git a/cpukit/score/cpu/sparc/include/rtems/score/sparc.h b/cpukit/score/cpu/sparc/include/rtems/score/sparc.h
index db659cc..f38e002 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
 }



More information about the vc mailing list