22#ifndef _RTEMS_SCORE_CPU_H
23#define _RTEMS_SCORE_CPU_H
32#define CPU_SIMPLE_VECTORED_INTERRUPTS TRUE
34#define CPU_INTERRUPT_NUMBER_OF_VECTORS 32
36#define CPU_INTERRUPT_MAXIMUM_VECTOR_NUMBER (CPU_INTERRUPT_NUMBER_OF_VECTORS - 1)
38#define CPU_PROVIDES_ISR_IS_IN_PROGRESS TRUE
40#define CPU_ISR_PASSES_FRAME_POINTER FALSE
42#define CPU_HARDWARE_FP FALSE
44#define CPU_SOFTWARE_FP FALSE
46#define CPU_ALL_TASKS_ARE_FP FALSE
48#define CPU_IDLE_TASK_IS_FP FALSE
50#define CPU_USE_DEFERRED_FP_SWITCH FALSE
52#define CPU_ENABLE_ROBUST_THREAD_DISPATCH FALSE
54#define CPU_STACK_GROWS_UP FALSE
57#define CPU_CACHE_LINE_BYTES 32
59#define CPU_STRUCTURE_ALIGNMENT \
60 RTEMS_SECTION( ".sdata" ) RTEMS_ALIGNED( CPU_CACHE_LINE_BYTES )
62#define CPU_STACK_MINIMUM_SIZE (4 * 1024)
64#define CPU_SIZEOF_POINTER 4
70#define CPU_ALIGNMENT 4
72#define CPU_HEAP_ALIGNMENT CPU_ALIGNMENT
78#define CPU_STACK_ALIGNMENT 4
80#define CPU_INTERRUPT_STACK_ALIGNMENT CPU_CACHE_LINE_BYTES
89#define CPU_MODES_INTERRUPT_MASK 0x3f
91#define CPU_USE_GENERIC_BITFIELD_CODE TRUE
93#define CPU_MPCI_RECEIVE_SERVER_EXTRA_STACK 0
95#define CPU_MAXIMUM_PROCESSORS 32
126 uint32_t thread_dispatch_disabled;
127 uint32_t stack_mpubase;
128 uint32_t stack_mpuacc;
131#define _CPU_Context_Get_SP( _context ) \
171#define _CPU_Initialize_vectors()
193#define _CPU_ISR_Disable( _isr_cookie ) \
197 "rdctl %0, status\n" \
198 "movhi %1, %%hiadj(_Nios2_ISR_Status_mask)\n" \
199 "addi %1, %1, %%lo(_Nios2_ISR_Status_mask)\n" \
201 "ori %1, %1, %%lo(_Nios2_ISR_Status_bits)\n" \
203 : "=&r" (_isr_cookie), "=&r" (_tmp) \
213#define _CPU_ISR_Enable( _isr_cookie ) \
214 __builtin_wrctl( 0, (int) _isr_cookie )
227#define _CPU_ISR_Flash( _isr_cookie ) \
229 int _status = __builtin_rdctl( 0 ); \
230 __builtin_wrctl( 0, (int) _isr_cookie ); \
231 __builtin_wrctl( 0, _status ); \
280 void *stack_area_begin,
281 size_t stack_area_size,
283 void (*entry_point)(
void ),
288#define _CPU_Context_Restart_self( _the_context ) \
289 _CPU_Context_restore( (_the_context) );
299typedef void ( *CPU_ISR_handler )( uint32_t );
303 CPU_ISR_handler new_handler,
304 CPU_ISR_handler *old_handler
317static inline uint32_t CPU_swap_u32( uint32_t value )
319 uint32_t byte1, byte2, byte3, byte4, swapped;
321 byte4 = (value >> 24) & 0xff;
322 byte3 = (value >> 16) & 0xff;
323 byte2 = (value >> 8) & 0xff;
324 byte1 = value & 0xff;
326 swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4;
331#define CPU_swap_u16( value ) \
332 (((value&0xff) << 8) | ((value >> 8)&0xff))
340static inline CPU_Counter_ticks _CPU_Counter_difference(
341 CPU_Counter_ticks second,
342 CPU_Counter_ticks first
345 return second - first;
#define RTEMS_NO_RETURN
Definition: basedefs.h:102
void _CPU_ISR_Set_level(uint32_t level)
Sets the hardware interrupt level by the level value.
Definition: cpu.c:57
bool _CPU_ISR_Is_enabled(uint32_t level)
Returns true if interrupts are enabled in the specified ISR level, otherwise returns false.
Definition: cpu.h:375
void * _CPU_Thread_Idle_body(uintptr_t ignored)
Definition: idle-mcf5272.c:20
void _CPU_Initialize(void)
CPU initialization.
Definition: cpu.c:45
uintptr_t CPU_Uint32ptr
Definition: cpu.h:662
RTEMS_INLINE_ROUTINE void _CPU_ISR_install_vector(uint32_t vector, CPU_ISR_handler new_handler, CPU_ISR_handler *old_handler)
SPARC specific RTEMS ISR installer.
Definition: cpu.h:493
uint32_t _CPU_Counter_frequency(void)
Returns the current CPU counter frequency in Hz.
Definition: system-clocks.c:112
void _CPU_Context_switch(Context_Control *run, Context_Control *heir)
CPU switch context.
Definition: cpu_asm.c:91
CPU_Counter_ticks _CPU_Counter_read(void)
Returns the current CPU counter value.
Definition: system-clocks.c:117
void _CPU_Context_restore(Context_Control *new_context) RTEMS_NO_RETURN
Definition: cpu_asm.c:111
uint32_t _CPU_ISR_Get_level(void)
Definition: cpu.c:88
void _CPU_Context_Initialize(Context_Control *context, void *stack_area_begin, size_t stack_area_size, uint32_t new_level, void(*entry_point)(void), bool is_fp, void *tls_area)
Initializes the CPU context.
Definition: epiphany-context-initialize.c:40
void _CPU_Exception_frame_print(const CPU_Exception_frame *frame)
Prints the exception frame via printk().
Definition: vectorexceptions.c:45
void _CPU_Fatal_halt(uint32_t source, uint32_t error) RTEMS_NO_RETURN
Definition: bsp_fatal_halt.c:12
#define ra
return address */
Definition: regs.h:66
#define sp
stack-pointer */
Definition: regs.h:64
#define fp
frame-pointer */
Definition: regs.h:65
#define gp
global data pointer */
Definition: regs.h:63
NIOS II Set up Basic CPU Dependency Settings Based on Compiler Settings.
uint32_t CPU_Counter_ticks
Unsigned integer type for CPU counter values.
Definition: cpu.h:1210
The set of registers that specifies the complete processor state.
Definition: cpu.h:629
Interrupt stack frame (ISF).
Definition: cpu.h:191
Thread register context.
Definition: cpu.h:194
unsigned context
Definition: tlb.h:1