28 #if SPARC_HAS_FPU == 1 31 == SPARC_PER_CPU_FSR_OFFSET,
32 SPARC_PER_CPU_FSR_OFFSET
35 #if defined(SPARC_USE_LAZY_FP_SWITCH) 38 == SPARC_PER_CPU_FP_OWNER_OFFSET,
39 SPARC_PER_CPU_FP_OWNER_OFFSET
44 #define SPARC_ASSERT_OFFSET(field, off) \ 45 RTEMS_STATIC_ASSERT( \ 46 offsetof(Context_Control, field) == off ## _OFFSET, \ 47 Context_Control_offset_ ## field \ 50 SPARC_ASSERT_OFFSET(g5, G5);
51 SPARC_ASSERT_OFFSET(g7, G7);
55 Context_Control_offset_L0
60 Context_Control_offset_L1
63 SPARC_ASSERT_OFFSET(l2, L2);
64 SPARC_ASSERT_OFFSET(l3, L3);
65 SPARC_ASSERT_OFFSET(l4, L4);
66 SPARC_ASSERT_OFFSET(l5, L5);
67 SPARC_ASSERT_OFFSET(l6, L6);
68 SPARC_ASSERT_OFFSET(l7, L7);
69 SPARC_ASSERT_OFFSET(i0, I0);
70 SPARC_ASSERT_OFFSET(i1, I1);
71 SPARC_ASSERT_OFFSET(i2, I2);
72 SPARC_ASSERT_OFFSET(i3, I3);
73 SPARC_ASSERT_OFFSET(i4, I4);
74 SPARC_ASSERT_OFFSET(i5, I5);
75 SPARC_ASSERT_OFFSET(i6_fp, I6_FP);
76 SPARC_ASSERT_OFFSET(i7, I7);
77 SPARC_ASSERT_OFFSET(o6_sp, O6_SP);
78 SPARC_ASSERT_OFFSET(o7, O7);
79 SPARC_ASSERT_OFFSET(psr, PSR);
80 SPARC_ASSERT_OFFSET(isr_dispatch_disable, ISR_DISPATCH_DISABLE_STACK);
82 #if defined(RTEMS_SMP) 83 SPARC_ASSERT_OFFSET(is_executing, SPARC_CONTEXT_CONTROL_IS_EXECUTING);
86 #define SPARC_ASSERT_ISF_OFFSET(field, off) \ 87 RTEMS_STATIC_ASSERT( \ 88 offsetof(CPU_Interrupt_frame, field) == ISF_ ## off ## _OFFSET, \ 89 CPU_Interrupt_frame_offset_ ## field \ 92 SPARC_ASSERT_ISF_OFFSET(psr, PSR);
93 SPARC_ASSERT_ISF_OFFSET(pc, PC);
94 SPARC_ASSERT_ISF_OFFSET(npc, NPC);
95 SPARC_ASSERT_ISF_OFFSET(g1, G1);
96 SPARC_ASSERT_ISF_OFFSET(g2, G2);
97 SPARC_ASSERT_ISF_OFFSET(g3, G3);
98 SPARC_ASSERT_ISF_OFFSET(g4, G4);
99 SPARC_ASSERT_ISF_OFFSET(g5, G5);
100 SPARC_ASSERT_ISF_OFFSET(g7, G7);
101 SPARC_ASSERT_ISF_OFFSET(i0, I0);
102 SPARC_ASSERT_ISF_OFFSET(i1, I1);
103 SPARC_ASSERT_ISF_OFFSET(i2, I2);
104 SPARC_ASSERT_ISF_OFFSET(i3, I3);
105 SPARC_ASSERT_ISF_OFFSET(i4, I4);
106 SPARC_ASSERT_ISF_OFFSET(i5, I5);
107 SPARC_ASSERT_ISF_OFFSET(i6_fp, I6_FP);
108 SPARC_ASSERT_ISF_OFFSET(i7, I7);
109 SPARC_ASSERT_ISF_OFFSET(y, Y);
110 SPARC_ASSERT_ISF_OFFSET(tpc, TPC);
112 #define SPARC_ASSERT_FP_OFFSET(field, off) \ 113 RTEMS_STATIC_ASSERT( \ 114 offsetof(Context_Control_fp, field) == SPARC_FP_CONTEXT_OFFSET_ ## off, \ 115 Context_Control_fp_offset_ ## field \ 118 SPARC_ASSERT_FP_OFFSET(f0_f1, F0_F1);
119 SPARC_ASSERT_FP_OFFSET(f2_f3, F2_F3);
120 SPARC_ASSERT_FP_OFFSET(f4_f5, F4_F5);
121 SPARC_ASSERT_FP_OFFSET(f6_f7, F6_F7);
122 SPARC_ASSERT_FP_OFFSET(f8_f9, F8_F9);
123 SPARC_ASSERT_FP_OFFSET(f10_f11, F10_F11);
124 SPARC_ASSERT_FP_OFFSET(f12_f13, F12_F13);
125 SPARC_ASSERT_FP_OFFSET(f14_f15, F14_F15);
126 SPARC_ASSERT_FP_OFFSET(f16_f17, F16_F17);
127 SPARC_ASSERT_FP_OFFSET(f18_f19, F18_F19);
128 SPARC_ASSERT_FP_OFFSET(f20_f21, F20_F21);
129 SPARC_ASSERT_FP_OFFSET(f22_f23, F22_F23);
130 SPARC_ASSERT_FP_OFFSET(f24_f25, F24_F25);
131 SPARC_ASSERT_FP_OFFSET(f26_f27, F26_F27);
132 SPARC_ASSERT_FP_OFFSET(f28_f29, F28_F29);
133 SPARC_ASSERT_FP_OFFSET(f30_f31, F30_F31);
134 SPARC_ASSERT_FP_OFFSET(fsr, FSR);
144 CPU_Interrupt_frame_alignment
178 #if defined(SPARC_USE_LAZY_FP_SWITCH) 180 ".global SPARC_THREAD_CONTROL_REGISTERS_FP_CONTEXT_OFFSET\n" 181 ".set SPARC_THREAD_CONTROL_REGISTERS_FP_CONTEXT_OFFSET, %0\n" 182 ".global SPARC_THREAD_CONTROL_FP_CONTEXT_OFFSET\n" 183 ".set SPARC_THREAD_CONTROL_FP_CONTEXT_OFFSET, %1\n" 239 CPU_ISR_raw_handler new_handler,
240 CPU_ISR_raw_handler *old_handler
243 uint32_t real_vector;
247 uint32_t u32_handler;
263 u32_tbr &= 0xfffff000;
267 slot = &tbr[ real_vector ];
276 #define HIGH_BITS_MASK 0xFFFFFC00 277 #define HIGH_BITS_SHIFT 10 278 #define LOW_BITS_MASK 0x000003FF 284 *old_handler = (CPU_ISR_raw_handler) u32_handler;
294 u32_handler = (uint32_t) new_handler;
298 (u32_handler & HIGH_BITS_MASK) >> HIGH_BITS_SHIFT;
320 CPU_ISR_handler new_handler,
321 CPU_ISR_handler *old_handler
324 uint32_t real_vector;
325 CPU_ISR_raw_handler ignored;
338 *old_handler = _ISR_Vector_table[ real_vector ];
351 _ISR_Vector_table[ real_vector ] = new_handler;
356 uint32_t *stack_base,
372 stack_high = ((uint32_t)(stack_base) + size);
379 the_context->
o7 = ((uint32_t) entry_point) - 8;
381 the_context->
i6_fp = 0;
400 #if (SPARC_HAS_FPU == 1) 410 the_context->
psr = tmp_psr;
418 if ( tls_area != NULL ) {
421 the_context->
g7 = (uintptr_t) tcb;
Thread-Local Storage (TLS)
const CPU_Trap_table_entry _CPU_Trap_slot_template
#define CPU_STACK_ALIGNMENT
uint32_t isr_dispatch_disable
Data Related to the Management of Processor Interrupt Levels.
Interrupt stack frame (ISF).
#define SPARC_REAL_TRAP_NUMBER(_trap)
uint32_t sethi_of_handler_to_l4
#define sparc_get_interrupt_level(_level)
SPARC obtain interrupt level.
#define SPARC_MINIMUM_STACK_FRAME_SIZE
#define SPARC_PSR_EF_MASK
This header file defines the Cache Manager API.
#define SPARC_PSR_ET_MASK
#define sparc_get_psr(_psr)
Macro to obtain the PSR.
void _CPU_Initialize(void)
SPARC specific initialization.
#define RTEMS_STATIC_ASSERT(_cond, _msg)
Asserts at compile time that the specified condition is satisfied.
void _ISR_Handler(void)
ISR interrupt dispatcher.
uint32_t jmp_to_low_of_handler_plus_l4
void _CPU_ISR_install_vector(uint32_t vector, CPU_ISR_handler new_handler, CPU_ISR_handler *old_handler)
SPARC specific RTEMS ISR installer.
void _CPU_ISR_install_raw_handler(uint32_t vector, CPU_ISR_raw_handler new_handler, CPU_ISR_raw_handler *old_handler)
SPARC specific raw ISR installer.
void rtems_cache_invalidate_entire_instruction(void)
%
#define SPARC_PSR_PIL_MASK
uint32_t _CPU_ISR_Get_level(void)
Obtain the current interrupt disable level.
static void * _TLS_TCB_after_TLS_block_initialize(void *tls_area)
Initializes a dynamic thread vector with the area after a given starting address as thread control bl...
#define sparc_get_tbr(_tbr)
Macro to obtain the TBR.
Constants and Structures Related with the Thread Control Block.
void _CPU_Context_Initialize(Context_Control *the_context, uint32_t *stack_base, uint32_t size, uint32_t new_level, void *entry_point, bool is_fp, void *tls_area)
#define _Assert(_e)
Assertion similar to assert() controlled via RTEMS_DEBUG instead of NDEBUG.