From 2c467ec76780f2e93ff99f7993a17a65c03ab924 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 5 Nov 2020 09:23:52 +0100 Subject: 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 e2604bb76f..8c5330b8ce 100644 --- a/cpukit/score/cpu/sparc/include/rtems/score/cpu.h +++ b/cpukit/score/cpu/sparc/include/rtems/score/cpu.h @@ -691,27 +691,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 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 } -- cgit v1.2.3