35 #ifndef _EPIPHANY_CPU_H 36 #define _EPIPHANY_CPU_H 43 #include <rtems/score/types.h> 70 #define CPU_INLINE_ENABLE_DISPATCH FALSE 91 #define CPU_UNROLL_ENQUEUE_PRIORITY TRUE 121 #define CPU_HAS_SOFTWARE_INTERRUPT_STACK TRUE 139 #define CPU_HAS_HARDWARE_INTERRUPT_STACK FALSE 152 #define CPU_ALLOCATE_INTERRUPT_STACK TRUE 161 #define CPU_ISR_PASSES_FRAME_POINTER 1 190 #define CPU_HARDWARE_FP FALSE 191 #define CPU_SOFTWARE_FP FALSE 203 #define CPU_ALL_TASKS_ARE_FP FALSE 218 #define CPU_IDLE_TASK_IS_FP FALSE 247 #define CPU_USE_DEFERRED_FP_SWITCH FALSE 271 #define CPU_PROVIDES_IDLE_THREAD_BODY TRUE 282 #define CPU_STACK_GROWS_UP FALSE 305 #define CPU_STRUCTURE_ALIGNMENT __attribute__ ((aligned (64))) 320 #define CPU_HAS_OWN_HOST_TO_NETWORK_ROUTINES FALSE 321 #define CPU_BIG_ENDIAN FALSE 322 #define CPU_LITTLE_ENDIAN TRUE 331 #define CPU_MODES_INTERRUPT_MASK 0x00000001 420 volatile bool is_executing;
424 #define _CPU_Context_Get_SP( _context ) \ 429 double some_float_register;
444 #define CPU_CONTEXT_FP_SIZE 0 454 #define CPU_MPCI_RECEIVE_SERVER_EXTRA_STACK 0 462 #define CPU_STACK_MINIMUM_SIZE 4096 470 #define CPU_ALIGNMENT 8 476 #define CPU_PROVIDES_ISR_IS_IN_PROGRESS FALSE 499 #define CPU_HEAP_ALIGNMENT CPU_ALIGNMENT 514 #define CPU_PARTITION_ALIGNMENT CPU_ALIGNMENT 526 #define CPU_STACK_ALIGNMENT 8 538 #define _CPU_Initialize_vectors() 546 static inline uint32_t epiphany_interrupt_disable(
void )
549 __asm__ __volatile__ (
"movfs %[sr], status \n" : [sr]
"=r" (sr):);
550 __asm__ __volatile__(
"gid \n");
554 static inline void epiphany_interrupt_enable(uint32_t level)
556 __asm__ __volatile__(
"gie \n");
557 __asm__ __volatile__ (
"movts status, %[level] \n" :: [level]
"r" (level):);
560 #define _CPU_ISR_Disable( _level ) \ 561 _level = epiphany_interrupt_disable() 570 #define _CPU_ISR_Enable( _level ) \ 571 epiphany_interrupt_enable( _level ) 581 #define _CPU_ISR_Flash( _level ) \ 583 if ( (_level & 0x2) != 0 ) \ 584 _CPU_ISR_Enable( _level ); \ 585 epiphany_interrupt_disable(); \ 639 #define EPIPHANY_GCC_RED_ZONE_SIZE 128 660 void *stack_area_begin,
661 size_t stack_area_size,
663 void (*entry_point)(
void ),
679 #define _CPU_Context_Restart_self( _the_context ) \ 680 _CPU_Context_restore( (_the_context) ) 697 #define _CPU_Context_Fp_start( _base, _offset ) \ 698 ( (void *) _Addresses_Add_offset( (_base), (_offset) ) ) 713 #define _CPU_Context_Initialize_fp( _destination ) \ 715 *(*(_destination)) = _CPU_Null_fp_context; \ 729 #define _CPU_Fatal_halt(_source, _error ) \ 730 printk("Fatal Error %d.%d Halted\n",_source, _error); \ 731 asm("trap 3" :: "r" (_error)); \ 795 #define CPU_USE_GENERIC_BITFIELD_CODE TRUE 796 #define CPU_USE_GENERIC_BITFIELD_DATA TRUE 798 #if (CPU_USE_GENERIC_BITFIELD_CODE == FALSE) 800 #define _CPU_Bitfield_Find_first_bit( _value, _output ) \ 815 #if (CPU_USE_GENERIC_BITFIELD_CODE == FALSE) 817 #define _CPU_Priority_Mask( _bit_number ) \ 830 #if (CPU_USE_GENERIC_BITFIELD_CODE == FALSE) 832 #define _CPU_Priority_bits_index( _priority ) \ 837 #define CPU_TIMESTAMP_USE_STRUCT_TIMESPEC FALSE 838 #define CPU_TIMESTAMP_USE_INT64 TRUE 839 #define CPU_TIMESTAMP_USE_INT64_INLINE FALSE 850 #define CPU_SIZEOF_POINTER 4 851 #define CPU_EXCEPTION_FRAME_SIZE 260 852 #define CPU_PER_CPU_CONTROL_SIZE 0 855 typedef uint16_t Priority_bit_map_Word;
979 void **fp_context_ptr
990 void **fp_context_ptr
1014 static inline unsigned int CPU_swap_u32(
1018 uint32_t byte1, byte2, byte3, byte4, swapped;
1020 byte4 = (value >> 24) & 0xff;
1021 byte3 = (value >> 16) & 0xff;
1022 byte2 = (value >> 8) & 0xff;
1023 byte1 = value & 0xff;
1025 swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4;
1029 #define CPU_swap_u16( value ) \ 1030 (((value&0xff) << 8) | ((value >> 8)&0xff)) 1046 CPU_Counter_ticks _CPU_Counter_read(
void );
1049 CPU_Counter_ticks second,
1050 CPU_Counter_ticks first
1053 return second - first;
1070 uint32_t _CPU_SMP_Initialize(
void );
1085 bool _CPU_SMP_Start_processor( uint32_t cpu_index );
1101 void _CPU_SMP_Finalize_initialization( uint32_t cpu_count );
1110 uint32_t _CPU_SMP_Get_current_processor(
void );
1120 void _CPU_SMP_Send_interrupt( uint32_t target_processor_index );
1133 void _CPU_SMP_Processor_event_broadcast(
void );
1143 static inline void _CPU_SMP_Processor_event_receive(
void )
1145 __asm__ volatile (
"" : : :
"memory" );
1153 static inline bool _CPU_Context_Get_is_executing(
1157 return context->is_executing;
1166 static inline void _CPU_Context_Set_is_executing(
1171 context->is_executing = is_executing;
void _CPU_ISR_install_vector(uint32_t vector, proc_ptr new_handler, proc_ptr *old_handler)
This routine installs an interrupt vector.
Definition: avr/cpu.c:69
void _CPU_Context_validate(uintptr_t pattern)
Initializes and validates the CPU context with values derived from the pattern parameter.
Definition: score/cpu/mips/rtems/score/cpu.h:1109
uint32_t _CPU_ISR_Get_level(void)
Return the current interrupt disable level for this task in the format used by the interrupt level po...
Definition: avr/cpu.c:39
void _CPU_Context_restore(Context_Control *new_context)
This routine is generally used only to restart self in an efficient manner.
Definition: no_cpu/cpu_asm.c:112
Definition: deflate.c:116
void _CPU_Context_switch(Context_Control *run, Context_Control *heir)
CPU switch context.
Definition: no_cpu/cpu_asm.c:92
void _CPU_Context_volatile_clobber(uintptr_t pattern)
Clobbers all volatile registers with values derived from the pattern parameter.
Definition: score/cpu/mips/rtems/score/cpu.h:1104
This defines the minimal set of integer and processor state registers that must be saved during a vol...
Definition: score/cpu/arm/rtems/score/cpu.h:248
void _CPU_Initialize(void)
CPU initialization.
Definition: avr/cpu.c:26
uint32_t CPU_Counter_ticks
Unsigned integer type for CPU counter values.
Definition: score/cpu/no_cpu/rtems/score/cpu.h:1461
void _CPU_ISR_Set_level(uint32_t level)
Sets the hardware interrupt level by the level value.
Definition: epiphany/cpu.c:62
register struct Per_CPU_Control *_SPARC_Per_CPU_current __asm__("g6")
The pointer to the current per-CPU control is available via register g6.
void _CPU_Context_restore_fp(Context_Control_fp **fp_context_ptr)
This routine restores the floating point context passed to it.
Definition: m68k/cpu.c:176
void _CPU_Install_interrupt_stack(void)
This routine installs the hardware interrupt stack pointer.
Definition: avr/cpu.c:101
CPU_Counter_ticks _CPU_Counter_difference(CPU_Counter_ticks second, CPU_Counter_ticks first)
Returns the difference between the second and first CPU counter value.
Definition: score/cpu/mips/rtems/score/cpu.h:1160
This defines the complete set of floating point registers that must be saved during any context switc...
Definition: score/cpu/arm/rtems/score/cpu.h:294
Interface to Kernel Print Methods.
void _CPU_Context_save_fp(Context_Control_fp **fp_context_ptr)
This routine saves the floating point context passed to it.
Definition: m68k/cpu.c:167
void _CPU_ISR_install_raw_handler(uint32_t vector, proc_ptr new_handler, proc_ptr *old_handler)
This routine installs a "raw" interrupt handler directly into the processor's vector table...
Definition: avr/cpu.c:57
#define RTEMS_COMPILER_NO_RETURN_ATTRIBUTE
The following macro is a compiler specific way to indicate that the method will NOT return to the cal...
Definition: basedefs.h:162
void _CPU_Exception_frame_print(const CPU_Exception_frame *frame)
Prints the exception frame via printk().
Definition: arm-exception-frame-print.c:46
void * _CPU_Thread_Idle_body(uintptr_t ignored)
This routine is the CPU dependent IDLE thread body.
Definition: avr/cpu.c:125
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:41
The set of registers that specifies the complete processor state.
Definition: score/cpu/arm/rtems/score/cpu.h:671
#define SCORE_EXTERN
The following ensures that all data is declared in the space of the initialization routine for either...
Definition: basedefs.h:81
void * proc_ptr
XXX: Eventually proc_ptr needs to disappear!!!
Definition: basedefs.h:329