44 #ifndef _RTEMS_SCORE_CPU_H 45 #define _RTEMS_SCORE_CPU_H 73 #define CPU_SIMPLE_VECTORED_INTERRUPTS FALSE 82 #define CPU_ISR_PASSES_FRAME_POINTER TRUE 102 #if ( MIPS_HAS_FPU == 1 ) 103 #define CPU_HARDWARE_FP TRUE 105 #define CPU_HARDWARE_FP FALSE 128 #define CPU_ALL_TASKS_ARE_FP CPU_HARDWARE_FP 142 #define CPU_IDLE_TASK_IS_FP FALSE 170 #define CPU_USE_DEFERRED_FP_SWITCH TRUE 172 #define CPU_ENABLE_ROBUST_THREAD_DISPATCH FALSE 183 #define CPU_STACK_GROWS_UP FALSE 186 #define CPU_CACHE_LINE_BYTES 16 188 #define CPU_STRUCTURE_ALIGNMENT RTEMS_ALIGNED( CPU_CACHE_LINE_BYTES ) 196 #define CPU_MODES_INTERRUPT_MASK 0x000000ff 198 #define CPU_SIZEOF_POINTER 4 200 #define CPU_MAXIMUM_PROCESSORS 32 249 #if (__mips == 1) || (__mips == 32) 250 #define __MIPS_REGISTER_TYPE uint32_t 251 #define __MIPS_FPU_REGISTER_TYPE uint32_t 253 #define __MIPS_REGISTER_TYPE uint64_t 254 #define __MIPS_FPU_REGISTER_TYPE uint64_t 256 #error "mips register size: unknown architecture level!!" 259 __MIPS_REGISTER_TYPE s0;
260 __MIPS_REGISTER_TYPE s1;
261 __MIPS_REGISTER_TYPE s2;
262 __MIPS_REGISTER_TYPE s3;
263 __MIPS_REGISTER_TYPE s4;
264 __MIPS_REGISTER_TYPE s5;
265 __MIPS_REGISTER_TYPE s6;
266 __MIPS_REGISTER_TYPE s7;
267 __MIPS_REGISTER_TYPE
sp;
268 __MIPS_REGISTER_TYPE
fp;
269 __MIPS_REGISTER_TYPE
ra;
270 __MIPS_REGISTER_TYPE c0_sr;
271 __MIPS_REGISTER_TYPE c0_epc;
274 #define _CPU_Context_Get_SP( _context ) \ 275 (uintptr_t) (_context)->sp 282 #if ( CPU_HARDWARE_FP == TRUE ) 283 __MIPS_FPU_REGISTER_TYPE fp0;
284 __MIPS_FPU_REGISTER_TYPE fp1;
285 __MIPS_FPU_REGISTER_TYPE fp2;
286 __MIPS_FPU_REGISTER_TYPE fp3;
287 __MIPS_FPU_REGISTER_TYPE fp4;
288 __MIPS_FPU_REGISTER_TYPE fp5;
289 __MIPS_FPU_REGISTER_TYPE fp6;
290 __MIPS_FPU_REGISTER_TYPE fp7;
291 __MIPS_FPU_REGISTER_TYPE fp8;
292 __MIPS_FPU_REGISTER_TYPE fp9;
293 __MIPS_FPU_REGISTER_TYPE fp10;
294 __MIPS_FPU_REGISTER_TYPE fp11;
295 __MIPS_FPU_REGISTER_TYPE fp12;
296 __MIPS_FPU_REGISTER_TYPE fp13;
297 __MIPS_FPU_REGISTER_TYPE fp14;
298 __MIPS_FPU_REGISTER_TYPE fp15;
299 __MIPS_FPU_REGISTER_TYPE fp16;
300 __MIPS_FPU_REGISTER_TYPE fp17;
301 __MIPS_FPU_REGISTER_TYPE fp18;
302 __MIPS_FPU_REGISTER_TYPE fp19;
303 __MIPS_FPU_REGISTER_TYPE fp20;
304 __MIPS_FPU_REGISTER_TYPE fp21;
305 __MIPS_FPU_REGISTER_TYPE fp22;
306 __MIPS_FPU_REGISTER_TYPE fp23;
307 __MIPS_FPU_REGISTER_TYPE fp24;
308 __MIPS_FPU_REGISTER_TYPE fp25;
309 __MIPS_FPU_REGISTER_TYPE fp26;
310 __MIPS_FPU_REGISTER_TYPE fp27;
311 __MIPS_FPU_REGISTER_TYPE fp28;
312 __MIPS_FPU_REGISTER_TYPE fp29;
313 __MIPS_FPU_REGISTER_TYPE fp30;
314 __MIPS_FPU_REGISTER_TYPE fp31;
344 __MIPS_REGISTER_TYPE r0;
345 __MIPS_REGISTER_TYPE at;
346 __MIPS_REGISTER_TYPE v0;
347 __MIPS_REGISTER_TYPE v1;
348 __MIPS_REGISTER_TYPE a0;
349 __MIPS_REGISTER_TYPE a1;
350 __MIPS_REGISTER_TYPE a2;
351 __MIPS_REGISTER_TYPE a3;
352 __MIPS_REGISTER_TYPE t0;
353 __MIPS_REGISTER_TYPE t1;
354 __MIPS_REGISTER_TYPE t2;
355 __MIPS_REGISTER_TYPE t3;
356 __MIPS_REGISTER_TYPE t4;
357 __MIPS_REGISTER_TYPE t5;
358 __MIPS_REGISTER_TYPE t6;
359 __MIPS_REGISTER_TYPE t7;
360 __MIPS_REGISTER_TYPE s0;
361 __MIPS_REGISTER_TYPE s1;
362 __MIPS_REGISTER_TYPE s2;
363 __MIPS_REGISTER_TYPE s3;
364 __MIPS_REGISTER_TYPE s4;
365 __MIPS_REGISTER_TYPE s5;
366 __MIPS_REGISTER_TYPE s6;
367 __MIPS_REGISTER_TYPE s7;
368 __MIPS_REGISTER_TYPE t8;
369 __MIPS_REGISTER_TYPE t9;
370 __MIPS_REGISTER_TYPE
k0;
371 __MIPS_REGISTER_TYPE
k1;
372 __MIPS_REGISTER_TYPE
gp;
373 __MIPS_REGISTER_TYPE
sp;
374 __MIPS_REGISTER_TYPE
fp;
375 __MIPS_REGISTER_TYPE
ra;
376 __MIPS_REGISTER_TYPE c0_sr;
378 __MIPS_REGISTER_TYPE mdlo;
379 __MIPS_REGISTER_TYPE mdhi;
380 __MIPS_REGISTER_TYPE badvaddr;
381 __MIPS_REGISTER_TYPE cause;
382 __MIPS_REGISTER_TYPE epc;
384 __MIPS_FPU_REGISTER_TYPE f0;
385 __MIPS_FPU_REGISTER_TYPE f1;
386 __MIPS_FPU_REGISTER_TYPE f2;
387 __MIPS_FPU_REGISTER_TYPE f3;
388 __MIPS_FPU_REGISTER_TYPE f4;
389 __MIPS_FPU_REGISTER_TYPE f5;
390 __MIPS_FPU_REGISTER_TYPE f6;
391 __MIPS_FPU_REGISTER_TYPE f7;
392 __MIPS_FPU_REGISTER_TYPE f8;
393 __MIPS_FPU_REGISTER_TYPE f9;
394 __MIPS_FPU_REGISTER_TYPE f10;
395 __MIPS_FPU_REGISTER_TYPE f11;
396 __MIPS_FPU_REGISTER_TYPE f12;
397 __MIPS_FPU_REGISTER_TYPE f13;
398 __MIPS_FPU_REGISTER_TYPE f14;
399 __MIPS_FPU_REGISTER_TYPE f15;
400 __MIPS_FPU_REGISTER_TYPE f16;
401 __MIPS_FPU_REGISTER_TYPE f17;
402 __MIPS_FPU_REGISTER_TYPE f18;
403 __MIPS_FPU_REGISTER_TYPE f19;
404 __MIPS_FPU_REGISTER_TYPE f20;
405 __MIPS_FPU_REGISTER_TYPE f21;
406 __MIPS_FPU_REGISTER_TYPE f22;
407 __MIPS_FPU_REGISTER_TYPE f23;
408 __MIPS_FPU_REGISTER_TYPE f24;
409 __MIPS_FPU_REGISTER_TYPE f25;
410 __MIPS_FPU_REGISTER_TYPE f26;
411 __MIPS_FPU_REGISTER_TYPE f27;
412 __MIPS_FPU_REGISTER_TYPE f28;
413 __MIPS_FPU_REGISTER_TYPE f29;
414 __MIPS_FPU_REGISTER_TYPE f30;
415 __MIPS_FPU_REGISTER_TYPE f31;
416 __MIPS_REGISTER_TYPE fcsr;
418 __MIPS_REGISTER_TYPE feir;
423 __MIPS_REGISTER_TYPE tlbhi;
426 __MIPS_REGISTER_TYPE tlblo;
429 #if (__mips == 3) || (__mips == 32) 430 __MIPS_REGISTER_TYPE tlblo0;
434 __MIPS_REGISTER_TYPE inx;
436 __MIPS_REGISTER_TYPE rand;
438 __MIPS_REGISTER_TYPE
ctxt;
440 __MIPS_REGISTER_TYPE exctype;
441 __MIPS_REGISTER_TYPE mode;
442 __MIPS_REGISTER_TYPE prid;
443 __MIPS_REGISTER_TYPE tar ;
445 #if (__mips == 3) || (__mips == 32) 446 __MIPS_REGISTER_TYPE tlblo1;
447 __MIPS_REGISTER_TYPE pagemask;
448 __MIPS_REGISTER_TYPE wired;
449 __MIPS_REGISTER_TYPE count;
450 __MIPS_REGISTER_TYPE compare;
451 __MIPS_REGISTER_TYPE
config;
452 __MIPS_REGISTER_TYPE lladdr;
453 __MIPS_REGISTER_TYPE watchlo;
454 __MIPS_REGISTER_TYPE watchhi;
455 __MIPS_REGISTER_TYPE ecc;
456 __MIPS_REGISTER_TYPE cacheerr;
457 __MIPS_REGISTER_TYPE taglo;
458 __MIPS_REGISTER_TYPE taghi;
459 __MIPS_REGISTER_TYPE errpc;
460 __MIPS_REGISTER_TYPE xctxt;
490 #define CPU_CONTEXT_FP_SIZE sizeof( Context_Control_fp ) 498 #define CPU_MPCI_RECEIVE_SERVER_EXTRA_STACK 0 505 #define CPU_STACK_MINIMUM_SIZE (8 * 1024) 512 #define CPU_ALIGNMENT 8 526 #define CPU_HEAP_ALIGNMENT CPU_ALIGNMENT 537 #define CPU_STACK_ALIGNMENT CPU_ALIGNMENT 539 #define CPU_INTERRUPT_STACK_ALIGNMENT CPU_CACHE_LINE_BYTES 552 uint32_t mips_interrupt_mask(
void );
559 #define _CPU_ISR_Disable( _level ) \ 561 unsigned int _scratch; \ 562 mips_get_sr( _scratch ); \ 563 mips_set_sr( _scratch & ~SR_INTERRUPT_ENABLE_BITS ); \ 564 _level = _scratch & SR_INTERRUPT_ENABLE_BITS; \ 573 #define _CPU_ISR_Enable( _level ) \ 575 unsigned int _scratch; \ 576 mips_get_sr( _scratch ); \ 577 mips_set_sr( (_scratch & ~SR_INTERRUPT_ENABLE_BITS) | (_level & SR_INTERRUPT_ENABLE_BITS) ); \ 587 #define _CPU_ISR_Flash( _xlevel ) \ 589 unsigned int _scratch2 = _xlevel; \ 590 _CPU_ISR_Enable( _scratch2 ); \ 591 _CPU_ISR_Disable( _scratch2 ); \ 592 _xlevel = _scratch2; \ 597 return ( level & SR_INTERRUPT_ENABLE_BITS ) != 0;
663 #if (__mips == 3) || (__mips == 32) 666 #define _EXTRABITS SR_FR 672 #define _INTON SR_IEC 679 uintptr_t *stack_base,
698 #define _CPU_Context_Restart_self( _the_context ) \ 699 _CPU_Context_restore( (_the_context) ); 713 #if ( CPU_HARDWARE_FP == TRUE ) 714 #define _CPU_Context_Initialize_fp( _destination ) \ 716 *(*(_destination)) = _CPU_Null_fp_context; \ 730 #define _CPU_Fatal_halt( _source, _error ) \ 732 unsigned int _level; \ 733 _CPU_ISR_Disable(_level); \ 739 extern void mips_break(
int error );
741 #define CPU_USE_GENERIC_BITFIELD_CODE TRUE 821 static inline uint32_t CPU_swap_u32(
825 uint32_t byte1, byte2, byte3, byte4, swapped;
827 byte4 = (value >> 24) & 0xff;
828 byte3 = (value >> 16) & 0xff;
829 byte2 = (value >> 8) & 0xff;
830 byte1 = value & 0xff;
832 swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4;
836 #define CPU_swap_u16( value ) \ 837 (((value&0xff) << 8) | ((value >> 8)&0xff)) 845 static inline CPU_Counter_ticks _CPU_Counter_difference(
846 CPU_Counter_ticks second,
847 CPU_Counter_ticks first
850 return second - first;
#define sp
stack-pointer */
Definition: regs.h:64
void _CPU_Exception_frame_print(const CPU_Exception_frame *frame)
Prints the exception frame via printk().
Definition: vectorexceptions.c:45
void _CPU_ISR_Set_level(uint32_t level)
Sets the hardware interrupt level by the level value.
Definition: cpu.c:57
CPU_Counter_ticks _CPU_Counter_read(void)
Returns the current CPU counter value.
Definition: system-clocks.c:117
Thread register context.
Definition: cpu.h:196
void * _CPU_Thread_Idle_body(uintptr_t ignored)
Definition: idle-mcf5272.c:20
#define RTEMS_INLINE_ROUTINE
Definition: basedefs.h:65
void _CPU_Context_restore_fp(Context_Control_fp **fp_context_ptr)
Definition: cpu.c:207
Interrupt stack frame (ISF).
Definition: cpu.h:306
#define fp
frame-pointer */
Definition: regs.h:65
#define k0
kernel private register 0 */
Definition: regs.h:61
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_Context_switch(Context_Control *run, Context_Control *heir)
CPU switch context.
Definition: cpu_asm.c:91
#define k1
kernel private register 1 */
Definition: regs.h:62
struct rtems_bsdnet_ifconfig * config
Network driver configuration.
void _CPU_Initialize(void)
CPU initialization.
Definition: cpu.c:45
SPARC basic context.
Definition: cpu.h:242
uint32_t CPU_Counter_ticks
Unsigned integer type for CPU counter values.
Definition: cpu.h:1202
#define RTEMS_NO_RETURN
Definition: basedefs.h:101
uint32_t _CPU_ISR_Get_level(void)
Definition: cpu.c:88
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:381
void _CPU_Context_restore(Context_Control *new_context) RTEMS_NO_RETURN
Definition: cpu_asm.c:111
uintptr_t CPU_Uint32ptr
Definition: cpu.h:668
uint32_t _CPU_Counter_frequency(void)
Returns the current CPU counter frequency in Hz.
Definition: system-clocks.c:112
#define ra
return address */
Definition: regs.h:66
unsigned size
Definition: tte.h:74
void _CPU_Context_save_fp(Context_Control_fp **fp_context_ptr)
Definition: cpu.c:198
The set of registers that specifies the complete processor state.
Definition: cpu.h:635
Information to build RTEMS for a "no cpu" while in protected mode.
Context_Control_fp _CPU_Null_fp_context
Definition: cpu.c:45
#define gp
global data pointer */
Definition: regs.h:63