RTEMS CPU Kit with SuperCore  4.11.2
cpu.h
Go to the documentation of this file.
1 
10 /*
11  * COPYRIGHT (c) 1989-2011.
12  * On-Line Applications Research Corporation (OAR).
13  *
14  * The license and distribution terms for this file may be
15  * found in the file LICENSE in this distribution or at
16  * http://www.rtems.org/license/LICENSE.
17  */
18 
19 #ifndef _RTEMS_SCORE_CPU_H
20 #define _RTEMS_SCORE_CPU_H
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 #include <rtems/score/types.h>
27 #include <rtems/score/sparc.h>
28 
29 /* conditional compilation parameters */
30 
31 #if defined(RTEMS_SMP)
32  /*
33  * The SPARC ABI is a bit special with respect to the floating point context.
34  * The complete floating point context is volatile. Thus from an ABI point
35  * of view nothing needs to be saved and restored during a context switch.
36  * Instead the floating point context must be saved and restored during
37  * interrupt processing. Historically the deferred floating point switch is
38  * used for SPARC and the complete floating point context is saved and
39  * restored during a context switch to the new floating point unit owner.
40  * This is a bit dangerous since post-switch actions (e.g. signal handlers)
41  * and context switch extensions may silently corrupt the floating point
42  * context. The floating point unit is disabled for interrupt handlers.
43  * Thus in case an interrupt handler uses the floating point unit then this
44  * will result in a trap.
45  *
46  * On SMP configurations the deferred floating point switch is not
47  * supported in principle. So use here a safe floating point support. Safe
48  * means that the volatile floating point context is saved and restored
49  * around a thread dispatch issued during interrupt processing. Thus
50  * post-switch actions and context switch extensions may safely use the
51  * floating point unit.
52  */
53  #define SPARC_USE_SAFE_FP_SUPPORT
54 #endif
55 
64 #define CPU_INLINE_ENABLE_DISPATCH TRUE
65 
75 #define CPU_HAS_SOFTWARE_INTERRUPT_STACK TRUE
76 
87 #define CPU_SIMPLE_VECTORED_INTERRUPTS TRUE
88 
97 #define CPU_HAS_HARDWARE_INTERRUPT_STACK FALSE
98 
110 #define CPU_ALLOCATE_INTERRUPT_STACK TRUE
111 
120 #define CPU_ISR_PASSES_FRAME_POINTER 0
121 
130 #if ( SPARC_HAS_FPU == 1 ) && !defined(SPARC_USE_SAFE_FP_SUPPORT)
131  #define CPU_HARDWARE_FP TRUE
132 #else
133  #define CPU_HARDWARE_FP FALSE
134 #endif
135 
140 #define CPU_SOFTWARE_FP FALSE
141 
150 #define CPU_ALL_TASKS_ARE_FP FALSE
151 
161 #define CPU_IDLE_TASK_IS_FP FALSE
162 
180 #if defined(SPARC_USE_SAFE_FP_SUPPORT)
181  #define CPU_USE_DEFERRED_FP_SWITCH FALSE
182 #else
183  #define CPU_USE_DEFERRED_FP_SWITCH TRUE
184 #endif
185 
200 #define CPU_PROVIDES_IDLE_THREAD_BODY FALSE
201 
211 #define CPU_STACK_GROWS_UP FALSE
212 
223 #define CPU_STRUCTURE_ALIGNMENT __attribute__ ((aligned (32)))
224 
225 #define CPU_TIMESTAMP_USE_INT64_INLINE TRUE
226 
233 #define CPU_BIG_ENDIAN TRUE
234 
241 #define CPU_LITTLE_ENDIAN FALSE
242 
250 #define CPU_MODES_INTERRUPT_MASK 0x0000000F
251 
252 #ifndef ASM
253 
259 typedef struct {
261  uint32_t l0;
263  uint32_t l1;
265  uint32_t l2;
267  uint32_t l3;
269  uint32_t l4;
271  uint32_t l5;
273  uint32_t l6;
275  uint32_t l7;
277  uint32_t i0;
279  uint32_t i1;
281  uint32_t i2;
283  uint32_t i3;
285  uint32_t i4;
287  uint32_t i5;
289  uint32_t i6_fp;
291  uint32_t i7;
294 
295  /*
296  * The following are for the callee to save the register arguments in
297  * should this be necessary.
298  */
300  uint32_t saved_arg0;
302  uint32_t saved_arg1;
304  uint32_t saved_arg2;
306  uint32_t saved_arg3;
308  uint32_t saved_arg4;
310  uint32_t saved_arg5;
312  uint32_t pad0;
314 
315 #endif /* ASM */
316 
318 #define CPU_STACK_FRAME_L0_OFFSET 0x00
319 
320 #define CPU_STACK_FRAME_L1_OFFSET 0x04
321 
322 #define CPU_STACK_FRAME_L2_OFFSET 0x08
323 
324 #define CPU_STACK_FRAME_L3_OFFSET 0x0c
325 
326 #define CPU_STACK_FRAME_L4_OFFSET 0x10
327 
328 #define CPU_STACK_FRAME_L5_OFFSET 0x14
329 
330 #define CPU_STACK_FRAME_L6_OFFSET 0x18
331 
332 #define CPU_STACK_FRAME_L7_OFFSET 0x1c
333 
334 #define CPU_STACK_FRAME_I0_OFFSET 0x20
335 
336 #define CPU_STACK_FRAME_I1_OFFSET 0x24
337 
338 #define CPU_STACK_FRAME_I2_OFFSET 0x28
339 
340 #define CPU_STACK_FRAME_I3_OFFSET 0x2c
341 
342 #define CPU_STACK_FRAME_I4_OFFSET 0x30
343 
344 #define CPU_STACK_FRAME_I5_OFFSET 0x34
345 
346 #define CPU_STACK_FRAME_I6_FP_OFFSET 0x38
347 
348 #define CPU_STACK_FRAME_I7_OFFSET 0x3c
349 
350 #define CPU_STRUCTURE_RETURN_ADDRESS_OFFSET 0x40
351 
352 #define CPU_STACK_FRAME_SAVED_ARG0_OFFSET 0x44
353 
354 #define CPU_STACK_FRAME_SAVED_ARG1_OFFSET 0x48
355 
356 #define CPU_STACK_FRAME_SAVED_ARG2_OFFSET 0x4c
357 
358 #define CPU_STACK_FRAME_SAVED_ARG3_OFFSET 0x50
359 
360 #define CPU_STACK_FRAME_SAVED_ARG4_OFFSET 0x54
361 
362 #define CPU_STACK_FRAME_SAVED_ARG5_OFFSET 0x58
363 
364 #define CPU_STACK_FRAME_PAD0_OFFSET 0x5c
365 
367 #define CPU_MINIMUM_STACK_FRAME_SIZE 0x60
368 
369 #if ( SPARC_HAS_FPU == 1 )
370  #define CPU_PER_CPU_CONTROL_SIZE 8
371 #else
372  #define CPU_PER_CPU_CONTROL_SIZE 4
373 #endif
374 
379 #define SPARC_PER_CPU_ISR_DISPATCH_DISABLE 0
380 
381 #if ( SPARC_HAS_FPU == 1 )
382 
386  #define SPARC_PER_CPU_FSR_OFFSET 4
387 #endif
388 
410 #ifndef ASM
411 
412 typedef struct {
420 
421 #if ( SPARC_HAS_FPU == 1 )
422 
429  uint32_t fsr;
430 #endif
432 
448 typedef struct {
450  uint32_t g5;
452  uint32_t g7;
453 
461  double l0_and_l1;
463  uint32_t l2;
465  uint32_t l3;
467  uint32_t l4;
469  uint32_t l5;
471  uint32_t l6;
473  uint32_t l7;
474 
476  uint32_t i0;
478  uint32_t i1;
480  uint32_t i2;
482  uint32_t i3;
484  uint32_t i4;
486  uint32_t i5;
488  uint32_t i6_fp;
490  uint32_t i7;
491 
493  uint32_t o6_sp;
498  uint32_t o7;
499 
501  uint32_t psr;
508 
509 #if defined(RTEMS_SMP)
510  volatile uint32_t is_executing;
511 #endif
513 
519 #define _CPU_Context_Get_SP( _context ) \
520  (_context)->o6_sp
521 
522 #ifdef RTEMS_SMP
523  static inline bool _CPU_Context_Get_is_executing(
524  const Context_Control *context
525  )
526  {
527  return context->is_executing;
528  }
529 
530  static inline void _CPU_Context_Set_is_executing(
531  Context_Control *context,
532  bool is_executing
533  )
534  {
535  context->is_executing = is_executing;
536  }
537 #endif
538 
539 #endif /* ASM */
540 
541 /*
542  * Offsets of fields with Context_Control for assembly routines.
543  */
544 
546 #define G5_OFFSET 0x00
547 
548 #define G7_OFFSET 0x04
549 
551 #define L0_OFFSET 0x08
552 
553 #define L1_OFFSET 0x0C
554 
555 #define L2_OFFSET 0x10
556 
557 #define L3_OFFSET 0x14
558 
559 #define L4_OFFSET 0x18
560 
561 #define L5_OFFSET 0x1C
562 
563 #define L6_OFFSET 0x20
564 
565 #define L7_OFFSET 0x24
566 
568 #define I0_OFFSET 0x28
569 
570 #define I1_OFFSET 0x2C
571 
572 #define I2_OFFSET 0x30
573 
574 #define I3_OFFSET 0x34
575 
576 #define I4_OFFSET 0x38
577 
578 #define I5_OFFSET 0x3C
579 
580 #define I6_FP_OFFSET 0x40
581 
582 #define I7_OFFSET 0x44
583 
585 #define O6_SP_OFFSET 0x48
586 
587 #define O7_OFFSET 0x4C
588 
590 #define PSR_OFFSET 0x50
591 
592 #define ISR_DISPATCH_DISABLE_STACK_OFFSET 0x54
593 
594 #if defined(RTEMS_SMP)
595  #define SPARC_CONTEXT_CONTROL_IS_EXECUTING_OFFSET 0x58
596 #endif
597 
598 #ifndef ASM
599 
604 typedef struct {
606  double f0_f1;
608  double f2_f3;
610  double f4_f5;
612  double f6_f7;
614  double f8_f9;
616  double f10_f11;
618  double f12_f13;
620  double f14_f15;
622  double f16_f17;
624  double f18_f19;
626  double f20_f21;
628  double f22_f23;
630  double f24_f25;
632  double f26_f27;
634  double f28_f29;
636  double f30_f31;
638  uint32_t fsr;
640 
641 #endif /* ASM */
642 
643 /*
644  * Offsets of fields with Context_Control_fp for assembly routines.
645  */
646 
648 #define FO_F1_OFFSET 0x00
649 
650 #define F2_F3_OFFSET 0x08
651 
652 #define F4_F5_OFFSET 0x10
653 
654 #define F6_F7_OFFSET 0x18
655 
656 #define F8_F9_OFFSET 0x20
657 
658 #define F1O_F11_OFFSET 0x28
659 
660 #define F12_F13_OFFSET 0x30
661 
662 #define F14_F15_OFFSET 0x38
663 
664 #define F16_F17_OFFSET 0x40
665 
666 #define F18_F19_OFFSET 0x48
667 
668 #define F2O_F21_OFFSET 0x50
669 
670 #define F22_F23_OFFSET 0x58
671 
672 #define F24_F25_OFFSET 0x60
673 
674 #define F26_F27_OFFSET 0x68
675 
676 #define F28_F29_OFFSET 0x70
677 
678 #define F3O_F31_OFFSET 0x78
679 
680 #define FSR_OFFSET 0x80
681 
683 #define CONTEXT_CONTROL_FP_SIZE 0x84
684 
685 #ifndef ASM
686 
697 typedef struct {
701  uint32_t psr;
703  uint32_t pc;
705  uint32_t npc;
707  uint32_t g1;
709  uint32_t g2;
711  uint32_t g3;
713  uint32_t g4;
715  uint32_t g5;
719  uint32_t g7;
721  uint32_t i0;
723  uint32_t i1;
725  uint32_t i2;
727  uint32_t i3;
729  uint32_t i4;
731  uint32_t i5;
733  uint32_t i6_fp;
735  uint32_t i7;
737  uint32_t y;
739  uint32_t tpc;
741 
742 #endif /* ASM */
743 
744 /*
745  * Offsets of fields with CPU_Interrupt_frame for assembly routines.
746  */
747 
749 #define ISF_PSR_OFFSET CPU_MINIMUM_STACK_FRAME_SIZE + 0x00
750 
751 #define ISF_PC_OFFSET CPU_MINIMUM_STACK_FRAME_SIZE + 0x04
752 
753 #define ISF_NPC_OFFSET CPU_MINIMUM_STACK_FRAME_SIZE + 0x08
754 
755 #define ISF_G1_OFFSET CPU_MINIMUM_STACK_FRAME_SIZE + 0x0c
756 
757 #define ISF_G2_OFFSET CPU_MINIMUM_STACK_FRAME_SIZE + 0x10
758 
759 #define ISF_G3_OFFSET CPU_MINIMUM_STACK_FRAME_SIZE + 0x14
760 
761 #define ISF_G4_OFFSET CPU_MINIMUM_STACK_FRAME_SIZE + 0x18
762 
763 #define ISF_G5_OFFSET CPU_MINIMUM_STACK_FRAME_SIZE + 0x1c
764 
765 #define ISF_G7_OFFSET CPU_MINIMUM_STACK_FRAME_SIZE + 0x24
766 
767 #define ISF_I0_OFFSET CPU_MINIMUM_STACK_FRAME_SIZE + 0x28
768 
769 #define ISF_I1_OFFSET CPU_MINIMUM_STACK_FRAME_SIZE + 0x2c
770 
771 #define ISF_I2_OFFSET CPU_MINIMUM_STACK_FRAME_SIZE + 0x30
772 
773 #define ISF_I3_OFFSET CPU_MINIMUM_STACK_FRAME_SIZE + 0x34
774 
775 #define ISF_I4_OFFSET CPU_MINIMUM_STACK_FRAME_SIZE + 0x38
776 
777 #define ISF_I5_OFFSET CPU_MINIMUM_STACK_FRAME_SIZE + 0x3c
778 
779 #define ISF_I6_FP_OFFSET CPU_MINIMUM_STACK_FRAME_SIZE + 0x40
780 
781 #define ISF_I7_OFFSET CPU_MINIMUM_STACK_FRAME_SIZE + 0x44
782 
783 #define ISF_Y_OFFSET CPU_MINIMUM_STACK_FRAME_SIZE + 0x48
784 
785 #define ISF_TPC_OFFSET CPU_MINIMUM_STACK_FRAME_SIZE + 0x4c
786 
788 #define CONTEXT_CONTROL_INTERRUPT_FRAME_SIZE \
789  CPU_MINIMUM_STACK_FRAME_SIZE + 0x50
790 
791 #ifndef ASM
792 
798 
807 typedef struct {
809  uint32_t mov_psr_l0;
815  uint32_t mov_vector_l3;
817 
828 
832 #define CPU_CONTEXT_FP_SIZE sizeof( Context_Control_fp )
833 
834 #endif
835 
841 #define CPU_MPCI_RECEIVE_SERVER_EXTRA_STACK 1024
842 
866 #define CPU_INTERRUPT_NUMBER_OF_VECTORS 256
867 
872 #define CPU_INTERRUPT_MAXIMUM_VECTOR_NUMBER 511
873 
878 #define SPARC_SYNCHRONOUS_TRAP_BIT_MASK 0x100
879 
883 #define SPARC_ASYNCHRONOUS_TRAP( _trap ) (_trap)
884 
888 #define SPARC_SYNCHRONOUS_TRAP( _trap ) ((_trap) + 256 )
889 
893 #define SPARC_REAL_TRAP_NUMBER( _trap ) ((_trap) % 256)
894 
899 #define CPU_PROVIDES_ISR_IS_IN_PROGRESS FALSE
900 
909 #define CPU_STACK_MINIMUM_SIZE (1024*4)
910 
914 #define CPU_SIZEOF_POINTER 4
915 
922 #define CPU_ALIGNMENT 8
923 
935 #define CPU_HEAP_ALIGNMENT CPU_ALIGNMENT
936 
948 #define CPU_PARTITION_ALIGNMENT CPU_ALIGNMENT
949 
963 #define CPU_STACK_ALIGNMENT 16
964 
965 #ifndef ASM
966 
967 /*
968  * ISR handler macros
969  */
970 
974 #define _CPU_Initialize_vectors()
975 
980 #define _CPU_ISR_Disable( _level ) \
981  (_level) = sparc_disable_interrupts()
982 
988 #define _CPU_ISR_Enable( _level ) \
989  sparc_enable_interrupts( _level )
990 
997 #define _CPU_ISR_Flash( _level ) \
998  sparc_flash_interrupts( _level )
999 
1005 #define _CPU_ISR_Set_level( _newlevel ) \
1006  sparc_enable_interrupts( _newlevel << 8)
1007 
1015 uint32_t _CPU_ISR_Get_level( void );
1016 
1017 /* end of ISR handler macros */
1018 
1019 /* Context handler macros */
1020 
1043  Context_Control *the_context,
1044  uint32_t *stack_base,
1045  uint32_t size,
1046  uint32_t new_level,
1047  void *entry_point,
1048  bool is_fp,
1049  void *tls_area
1050 );
1051 
1065 #define _CPU_Context_Initialization_at_thread_begin() \
1066  do { \
1067  __asm__ volatile ("set _Thread_Handler,%%i7\n"::); \
1068  } while (0)
1069 
1078 #define _CPU_Context_Restart_self( _the_context ) \
1079  _CPU_Context_restore( (_the_context) );
1080 
1085 #define _CPU_Context_Fp_start( _base, _offset ) \
1086  ( (void *) _Addresses_Add_offset( (_base), (_offset) ) )
1087 
1096 #define _CPU_Context_Initialize_fp( _destination ) \
1097  do { \
1098  *(*(_destination)) = _CPU_Null_fp_context; \
1099  } while (0)
1100 
1101 /* end of Context handler macros */
1102 
1103 /* Fatal Error manager macros */
1104 
1110 extern void _CPU_Fatal_halt(uint32_t source, uint32_t error)
1112 
1113 /* end of Fatal Error manager macros */
1114 
1115 /* Bitfield handler macros */
1116 
1117 #if ( SPARC_HAS_BITSCAN == 0 )
1118 
1122  #define CPU_USE_GENERIC_BITFIELD_CODE TRUE
1123 
1128  #define CPU_USE_GENERIC_BITFIELD_DATA TRUE
1129 #else
1130  #error "scan instruction not currently supported by RTEMS!!"
1131 #endif
1132 
1133 /* end of Bitfield handler macros */
1134 
1135 /* functions */
1136 
1142 void _CPU_Initialize(void);
1143 
1155  uint32_t vector,
1156  proc_ptr new_handler,
1157  proc_ptr *old_handler
1158 );
1159 
1171  uint32_t vector,
1172  proc_ptr new_handler,
1173  proc_ptr *old_handler
1174 );
1175 
1184 void _CPU_Context_switch(
1185  Context_Control *run,
1186  Context_Control *heir
1187 );
1188 
1198  Context_Control *new_context
1200 
1205 register struct Per_CPU_Control *_SPARC_Per_CPU_current __asm__( "g6" );
1206 
1207 #define _CPU_Get_current_per_CPU_control() ( _SPARC_Per_CPU_current )
1208 
1209 #if defined(RTEMS_SMP)
1210  uint32_t _CPU_SMP_Initialize( void );
1211 
1212  bool _CPU_SMP_Start_processor( uint32_t cpu_index );
1213 
1214  void _CPU_SMP_Finalize_initialization( uint32_t cpu_count );
1215 
1216  void _CPU_SMP_Prepare_start_multitasking( void );
1217 
1218  #if defined(__leon__) && !defined(RTEMS_PARAVIRT)
1219  static inline uint32_t _CPU_SMP_Get_current_processor( void )
1220  {
1221  return _LEON3_Get_current_processor();
1222  }
1223  #else
1224  uint32_t _CPU_SMP_Get_current_processor( void );
1225  #endif
1226 
1227  void _CPU_SMP_Send_interrupt( uint32_t target_processor_index );
1228 
1229  static inline void _CPU_SMP_Processor_event_broadcast( void )
1230  {
1231  __asm__ volatile ( "" : : : "memory" );
1232  }
1233 
1234  static inline void _CPU_SMP_Processor_event_receive( void )
1235  {
1236  __asm__ volatile ( "" : : : "memory" );
1237  }
1238 #endif
1239 
1248  Context_Control_fp **fp_context_ptr
1249 );
1250 
1259  Context_Control_fp **fp_context_ptr
1260 );
1261 
1262 void _CPU_Context_volatile_clobber( uintptr_t pattern );
1263 
1264 void _CPU_Context_validate( uintptr_t pattern );
1265 
1266 typedef struct {
1267  uint32_t trap;
1268  CPU_Interrupt_frame *isf;
1270 
1271 void _CPU_Exception_frame_print( const CPU_Exception_frame *frame );
1272 
1293 static inline uint32_t CPU_swap_u32(
1294  uint32_t value
1295 )
1296 {
1297  uint32_t byte1, byte2, byte3, byte4, swapped;
1298 
1299  byte4 = (value >> 24) & 0xff;
1300  byte3 = (value >> 16) & 0xff;
1301  byte2 = (value >> 8) & 0xff;
1302  byte1 = value & 0xff;
1303 
1304  swapped = (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4;
1305  return( swapped );
1306 }
1307 
1315 #define CPU_swap_u16( value ) \
1316  (((value&0xff) << 8) | ((value >> 8)&0xff))
1317 
1318 typedef uint32_t CPU_Counter_ticks;
1319 
1320 typedef CPU_Counter_ticks (*SPARC_Counter_difference)(
1321  CPU_Counter_ticks second,
1322  CPU_Counter_ticks first
1323 );
1324 
1325 /*
1326  * The SPARC processors supported by RTEMS have no built-in CPU counter
1327  * support. We have to use some hardware counter module for this purpose. The
1328  * BSP must provide a 32-bit register which contains the current CPU counter
1329  * value and a function for the difference calculation. It can use for example
1330  * the GPTIMER instance used for the clock driver.
1331  */
1332 typedef struct {
1333  volatile const CPU_Counter_ticks *counter_register;
1334  SPARC_Counter_difference counter_difference;
1335 } SPARC_Counter;
1336 
1337 extern SPARC_Counter _SPARC_Counter;
1338 
1339 /*
1340  * Returns always a value of one regardless of the parameters. This prevents
1341  * an infinite loop in rtems_counter_delay_ticks(). Its only a reasonably safe
1342  * default.
1343  */
1344 CPU_Counter_ticks _SPARC_Counter_difference_default(
1345  CPU_Counter_ticks second,
1346  CPU_Counter_ticks first
1347 );
1348 
1349 static inline bool _SPARC_Counter_is_default( void )
1350 {
1351  return _SPARC_Counter.counter_difference
1352  == _SPARC_Counter_difference_default;
1353 }
1354 
1355 static inline void _SPARC_Counter_initialize(
1356  volatile const CPU_Counter_ticks *counter_register,
1357  SPARC_Counter_difference counter_difference
1358 )
1359 {
1360  _SPARC_Counter.counter_register = counter_register;
1361  _SPARC_Counter.counter_difference = counter_difference;
1362 }
1363 
1364 static inline CPU_Counter_ticks _CPU_Counter_read( void )
1365 {
1366  return *_SPARC_Counter.counter_register;
1367 }
1368 
1369 static inline CPU_Counter_ticks _CPU_Counter_difference(
1370  CPU_Counter_ticks second,
1371  CPU_Counter_ticks first
1372 )
1373 {
1374  return (*_SPARC_Counter.counter_difference)( second, first );
1375 }
1376 
1377 #endif /* ASM */
1378 
1379 #ifdef __cplusplus
1380 }
1381 #endif
1382 
1383 #endif
uint32_t g5
This will contain the contents of the g5 register.
Definition: cpu.h:450
This structure represents the organization of the minimum stack frame for the SPARC.
Definition: cpu.h:259
uint32_t l3
This is the offset of the l3 register.
Definition: cpu.h:267
uint32_t g7
This is the offset of the g7 register on an ISF.
Definition: cpu.h:719
void _CPU_ISR_install_vector(uint32_t vector, proc_ptr new_handler, proc_ptr *old_handler)
This routine installs an interrupt vector.
Definition: cpu.c:69
double f0_f1
This will contain the contents of the f0 and f1 register.
Definition: cpu.h:606
void _CPU_Context_validate(uintptr_t pattern)
Initializes and validates the CPU context with values derived from the pattern parameter.
Definition: cpu.h:1109
uint32_t fsr
This will contain the contents of the floating point status register.
Definition: cpu.h:638
uint32_t l7
This is the offset of the l7 register.
Definition: cpu.h:275
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: 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: cpu_asm.c:112
uint32_t i6_fp
This is the offset of the i6 register.
Definition: cpu.h:289
The following type defines an entry in the SPARC&#39;s trap table.
Definition: cpu.h:807
uint32_t i0
This will contain the contents of the i0 register.
Definition: cpu.h:476
uint32_t l3
This will contain the contents of the l3 register.
Definition: cpu.h:465
void _CPU_Context_switch(Context_Control *run, Context_Control *heir)
CPU switch context.
Definition: cpu_asm.c:92
Definition: cpu.h:1332
uint32_t mov_vector_l3
This will contain a " mov _vector, %l3" instruction.
Definition: cpu.h:815
uint32_t i5
This is the offset of the i5 register on an ISF.
Definition: cpu.h:731
void _CPU_Context_volatile_clobber(uintptr_t pattern)
Clobbers all volatile registers with values derived from the pattern parameter.
Definition: cpu.h:1104
This defines the minimal set of integer and processor state registers that must be saved during a vol...
Definition: cpu.h:248
uint32_t isr_dispatch_disable
This field is used to prevent heavy nesting of calls to _Thread_Dispatch on an interrupted task&#39;s sta...
Definition: cpu.h:507
uint32_t isr_dispatch_disable
This flag is context switched with each thread.
Definition: cpu.h:419
void _CPU_Initialize(void)
CPU initialization.
Definition: cpu.c:26
uint32_t l2
This will contain the contents of the l2 register.
Definition: cpu.h:463
uint32_t reserved_for_alignment
This is the offset is reserved for alignment on an ISF.
Definition: cpu.h:717
uint32_t mov_psr_l0
This will contain a "mov %psr, %l0" instruction.
Definition: cpu.h:809
uint32_t saved_arg3
This is the offset of the register for saved argument 3.
Definition: cpu.h:306
double f8_f9
This will contain the contents of the f8 and f9 register.
Definition: cpu.h:614
SCORE_EXTERN Context_Control_fp _CPU_Null_fp_context
This variable is optional.
Definition: cpu.h:494
uint32_t CPU_Counter_ticks
Unsigned integer type for CPU counter values.
Definition: cpu.h:1461
This defines the set of integer and processor state registers that must be saved during an interrupt...
Definition: cpu.h:425
uint32_t saved_arg4
This is the offset of the register for saved argument 4.
Definition: cpu.h:308
CPU_Minimum_stack_frame Stack_frame
On an interrupt, we must save the minimum stack frame.
Definition: cpu.h:699
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&#39;s vector table...
Definition: cpu.c:57
uint32_t g7
This will contain the contents of the g7 register.
Definition: cpu.h:452
uint32_t i6_fp
This will contain the contents of the i6 (e.g.
Definition: cpu.h:488
uint32_t g3
This is the offset of the g3 register on an ISF.
Definition: cpu.h:711
uint32_t sethi_of_handler_to_l4
This will contain a "sethi %hi(_handler), %l4" instruction.
Definition: cpu.h:811
double f10_f11
This will contain the contents of the f10 and f11 register.
Definition: cpu.h:616
double l0_and_l1
This will contain the contents of the l0 and l1 registers.
Definition: cpu.h:461
uint32_t l6
This will contain the contents of the l6 register.
Definition: cpu.h:471
uint32_t i5
This will contain the contents of the i5 register.
Definition: cpu.h:486
double f22_f23
This will contain the contents of the f22 and f23 register.
Definition: cpu.h:628
uint32_t i7
This is the offset of the i7 register on an ISF.
Definition: cpu.h:735
uint32_t tpc
This is the offset of the tpc register on an ISF.
Definition: cpu.h:739
uint32_t i0
This is the offset of the i0 register on an ISF.
Definition: cpu.h:721
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: cpu.c:176
uint32_t saved_arg0
This is the offset of the register for saved argument 0.
Definition: cpu.h:300
The CPU specific per-CPU control.
Definition: cpu.h:367
uint32_t i2
This is the offset of the i2 register on an ISF.
Definition: cpu.h:725
double f4_f5
This will contain the contents of the f4 and f5 register.
Definition: cpu.h:610
uint32_t l2
This is the offset of the l2 register.
Definition: cpu.h:265
uint32_t i4
This will contain the contents of the i4 register.
Definition: cpu.h:484
uint32_t g2
This is the offset of the g2 register on an ISF.
Definition: cpu.h:709
uint32_t i1
This is the offset of the i1 register.
Definition: cpu.h:279
uint32_t i2
This will contain the contents of the i2 register.
Definition: cpu.h:480
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)
Initialize the context to a state suitable for starting a task after a context restore operation...
Definition: cpu.c:183
uint32_t psr
This will contain the contents of the processor status register.
Definition: cpu.h:501
Per CPU Core Structure.
Definition: percpu.h:233
uint32_t l6
This is the offset of the l6 register.
Definition: cpu.h:273
uint32_t i5
This is the offset of the i5 register.
Definition: cpu.h:287
double f2_f3
This will contain the contents of the f2 and f3 register.
Definition: cpu.h:608
CPU_Counter_ticks _CPU_Counter_read(void)
Returns the current CPU counter value.
Definition: cpu.c:96
uint32_t i0
This is the offset of the l0 register.
Definition: cpu.h:277
uint32_t saved_arg5
This is the offset of the register for saved argument 5.
Definition: cpu.h:310
double f26_f27
This will contain the contents of the f26 and f27 register.
Definition: cpu.h:632
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: cpu.h:1160
uint32_t l5
This will contain the contents of the l5 registeer.
Definition: cpu.h:469
const CPU_Trap_table_entry _CPU_Trap_slot_template
This is the set of opcodes for the instructions loaded into a trap table entry.
uint32_t npc
This is the offset of the XXX on an ISF.
Definition: cpu.h:705
This defines the complete set of floating point registers that must be saved during any context switc...
Definition: cpu.h:294
uint32_t saved_arg2
This is the offset of the register for saved argument 2.
Definition: cpu.h:304
uint32_t jmp_to_low_of_handler_plus_l4
This will contain a "jmp %l4 + %lo(_handler)" instruction.
Definition: cpu.h:813
double f12_f13
This will contain the contents of the f12 and f13 register.
Definition: cpu.h:618
void * structure_return_address
This is the offset of the register used to return structures.
Definition: cpu.h:293
double f18_f19
This will contain the contents of the f18 and f19 register.
Definition: cpu.h:624
uint32_t i4
This is the offset of the i4 register.
Definition: cpu.h:285
uint32_t l1
This is the offset of the l1 register.
Definition: cpu.h:263
uint32_t saved_arg1
This is the offset of the register for saved argument 1.
Definition: cpu.h:302
double f28_f29
This will contain the contents of the f28 and f29 register.
Definition: cpu.h:634
void _CPU_Fatal_halt(uint32_t source, uint32_t error)
This routine copies _error into a known place – typically a stack location or a register, optionally disables interrupts, and halts/stops the CPU.
Definition: nios2-fatal-halt.c:18
void _CPU_Context_save_fp(Context_Control_fp **fp_context_ptr)
This routine saves the floating point context passed to it.
Definition: cpu.c:167
uint32_t l4
This will contain the contents of the l4 register.
Definition: cpu.h:467
Information Required to Build RTEMS for a Particular Member of the SPARC Family.
double f30_f31
This will contain the contents of the f30 and f31 register.
Definition: cpu.h:636
#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
double f6_f7
This will contain the contents of the f6 and f7 register.
Definition: cpu.h:612
uint32_t g1
This is the offset of the g1 register on an ISF.
Definition: cpu.h:707
uint32_t i1
This is the offset of the i1 register on an ISF.
Definition: cpu.h:723
uint32_t l0
This is the offset of the l0 register.
Definition: cpu.h:261
uint32_t o6_sp
This will contain the contents of the o6 (e.g.
Definition: cpu.h:493
uint32_t psr
This is the offset of the PSR on an ISF.
Definition: cpu.h:701
uint32_t i3
This will contain the contents of the i3 register.
Definition: cpu.h:482
double f20_f21
This will contain the contents of the f20 and f21 register.
Definition: cpu.h:626
double f24_f25
This will contain the contents of the f24 and f25 register.
Definition: cpu.h:630
uint32_t pad0
This field pads the structure so ldd and std instructions can be used.
Definition: cpu.h:312
uint32_t g4
This is the offset of the g4 register on an ISF.
Definition: cpu.h:713
uint32_t g5
This is the offset of the g5 register on an ISF.
Definition: cpu.h:715
double f16_f17
This will contain the contents of the f16 and f17 register.
Definition: cpu.h:622
double f14_f15
This will contain the contents of the f14 and f15 register.
Definition: cpu.h:620
The set of registers that specifies the complete processor state.
Definition: 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
uint32_t i6_fp
This is the offset of the i6 register on an ISF.
Definition: cpu.h:733
uint32_t i4
This is the offset of the i4 register on an ISF.
Definition: cpu.h:729
void * proc_ptr
XXX: Eventually proc_ptr needs to disappear!!!
Definition: basedefs.h:329
uint32_t y
This is the offset of the y register on an ISF.
Definition: cpu.h:737
uint32_t i3
This is the offset of the i3 register on an ISF.
Definition: cpu.h:727
uint32_t l7
This will contain the contents of the l7 register.
Definition: cpu.h:473
uint32_t i2
This is the offset of the i2 register.
Definition: cpu.h:281
#define CPU_STRUCTURE_ALIGNMENT
The following is the variable attribute used to force alignment of critical data structures.
Definition: cpu.h:223
uint32_t o7
This will contain the contents of the o7 (e.g.
Definition: cpu.h:498
uint32_t i7
This will contain the contents of the i7 register.
Definition: cpu.h:490
uint32_t i1
This will contain the contents of the i1 register.
Definition: cpu.h:478
uint32_t i7
This is the offset of the i7 register.
Definition: cpu.h:291
uint32_t l4
This is the offset of the l4 register.
Definition: cpu.h:269
uint32_t i3
This is the offset of the i3 register.
Definition: cpu.h:283
uint32_t l5
This is the offset of the l5 register.
Definition: cpu.h:271