20 #ifndef _RTEMS_SCORE_CPUIMPL_H 21 #define _RTEMS_SCORE_CPUIMPL_H 23 #include <rtems/score/cpu.h> 37 #define FRAME_LINK_SPACE 32 39 #define FRAME_LINK_SPACE 8 42 #define SRR0_FRAME_OFFSET FRAME_LINK_SPACE 43 #define SRR1_FRAME_OFFSET (SRR0_FRAME_OFFSET + PPC_REG_SIZE) 44 #define EXCEPTION_NUMBER_OFFSET (SRR1_FRAME_OFFSET + PPC_REG_SIZE) 45 #define PPC_EXC_INTERRUPT_ENTRY_INSTANT_OFFSET (EXCEPTION_NUMBER_OFFSET + 4) 46 #define EXC_CR_OFFSET (EXCEPTION_NUMBER_OFFSET + 8) 47 #define EXC_XER_OFFSET (EXC_CR_OFFSET + 4) 48 #define EXC_CTR_OFFSET (EXC_XER_OFFSET + 4) 49 #define EXC_LR_OFFSET (EXC_CTR_OFFSET + PPC_REG_SIZE) 50 #define PPC_EXC_INTERRUPT_FRAME_OFFSET (EXC_LR_OFFSET + PPC_REG_SIZE) 53 #define PPC_EXC_GPR_OFFSET(gpr) \ 54 ((gpr) * PPC_GPR_SIZE + PPC_EXC_INTERRUPT_FRAME_OFFSET + PPC_REG_SIZE) 55 #define PPC_EXC_GPR3_PROLOGUE_OFFSET PPC_EXC_GPR_OFFSET(3) 56 #if defined(PPC_MULTILIB_ALTIVEC) && defined(PPC_MULTILIB_FPU) 57 #define PPC_EXC_VRSAVE_OFFSET PPC_EXC_GPR_OFFSET(33) 58 #define PPC_EXC_VSCR_OFFSET (PPC_EXC_VRSAVE_OFFSET + 28) 59 #define PPC_EXC_VR_OFFSET(v) ((v) * 16 + PPC_EXC_VSCR_OFFSET + 4) 60 #define PPC_EXC_FR_OFFSET(f) ((f) * 8 + PPC_EXC_VR_OFFSET(32)) 61 #define PPC_EXC_FPSCR_OFFSET PPC_EXC_FR_OFFSET(32) 62 #define PPC_EXC_FRAME_SIZE PPC_EXC_FR_OFFSET(34) 63 #define PPC_EXC_MIN_VSCR_OFFSET (PPC_EXC_GPR_OFFSET(13) + 12) 64 #define PPC_EXC_MIN_VR_OFFSET(v) ((v) * 16 + PPC_EXC_MIN_VSCR_OFFSET + 4) 65 #define PPC_EXC_MIN_FR_OFFSET(f) ((f) * 8 + PPC_EXC_MIN_VR_OFFSET(20)) 66 #define PPC_EXC_MIN_FPSCR_OFFSET PPC_EXC_MIN_FR_OFFSET(14) 67 #define CPU_INTERRUPT_FRAME_SIZE \ 68 (PPC_EXC_MIN_FR_OFFSET(16) + PPC_STACK_RED_ZONE_SIZE) 69 #elif defined(PPC_MULTILIB_ALTIVEC) 70 #define PPC_EXC_VRSAVE_OFFSET PPC_EXC_GPR_OFFSET(33) 71 #define PPC_EXC_VSCR_OFFSET (PPC_EXC_VRSAVE_OFFSET + 28) 72 #define PPC_EXC_VR_OFFSET(v) ((v) * 16 + PPC_EXC_VSCR_OFFSET + 4) 73 #define PPC_EXC_FRAME_SIZE PPC_EXC_VR_OFFSET(32) 74 #define PPC_EXC_MIN_VSCR_OFFSET (PPC_EXC_GPR_OFFSET(13) + 12) 75 #define PPC_EXC_MIN_VR_OFFSET(v) ((v) * 16 + PPC_EXC_MIN_VSCR_OFFSET + 4) 76 #define CPU_INTERRUPT_FRAME_SIZE \ 77 (PPC_EXC_MIN_VR_OFFSET(20) + PPC_STACK_RED_ZONE_SIZE) 78 #elif defined(PPC_MULTILIB_FPU) 79 #define PPC_EXC_FR_OFFSET(f) ((f) * 8 + PPC_EXC_GPR_OFFSET(33)) 80 #define PPC_EXC_FPSCR_OFFSET PPC_EXC_FR_OFFSET(32) 81 #define PPC_EXC_FRAME_SIZE PPC_EXC_FR_OFFSET(34) 82 #define PPC_EXC_MIN_FR_OFFSET(f) ((f) * 8 + PPC_EXC_GPR_OFFSET(13)) 83 #define PPC_EXC_MIN_FPSCR_OFFSET PPC_EXC_MIN_FR_OFFSET(14) 84 #define CPU_INTERRUPT_FRAME_SIZE \ 85 (PPC_EXC_MIN_FR_OFFSET(16) + PPC_STACK_RED_ZONE_SIZE) 87 #define PPC_EXC_FRAME_SIZE PPC_EXC_GPR_OFFSET(33) 88 #define CPU_INTERRUPT_FRAME_SIZE \ 89 (PPC_EXC_GPR_OFFSET(13) + PPC_STACK_RED_ZONE_SIZE) 92 #define PPC_EXC_SPEFSCR_OFFSET 44 93 #define PPC_EXC_ACC_OFFSET 48 94 #define PPC_EXC_GPR_OFFSET(gpr) ((gpr) * PPC_GPR_SIZE + 56) 95 #define PPC_EXC_GPR3_PROLOGUE_OFFSET (PPC_EXC_GPR_OFFSET(3) + 4) 96 #define CPU_INTERRUPT_FRAME_SIZE (160 + PPC_STACK_RED_ZONE_SIZE) 97 #define PPC_EXC_FRAME_SIZE 320 100 #define GPR0_OFFSET PPC_EXC_GPR_OFFSET(0) 101 #define GPR1_OFFSET PPC_EXC_GPR_OFFSET(1) 102 #define GPR2_OFFSET PPC_EXC_GPR_OFFSET(2) 103 #define GPR3_OFFSET PPC_EXC_GPR_OFFSET(3) 104 #define GPR4_OFFSET PPC_EXC_GPR_OFFSET(4) 105 #define GPR5_OFFSET PPC_EXC_GPR_OFFSET(5) 106 #define GPR6_OFFSET PPC_EXC_GPR_OFFSET(6) 107 #define GPR7_OFFSET PPC_EXC_GPR_OFFSET(7) 108 #define GPR8_OFFSET PPC_EXC_GPR_OFFSET(8) 109 #define GPR9_OFFSET PPC_EXC_GPR_OFFSET(9) 110 #define GPR10_OFFSET PPC_EXC_GPR_OFFSET(10) 111 #define GPR11_OFFSET PPC_EXC_GPR_OFFSET(11) 112 #define GPR12_OFFSET PPC_EXC_GPR_OFFSET(12) 113 #define GPR13_OFFSET PPC_EXC_GPR_OFFSET(13) 114 #define GPR14_OFFSET PPC_EXC_GPR_OFFSET(14) 115 #define GPR15_OFFSET PPC_EXC_GPR_OFFSET(15) 116 #define GPR16_OFFSET PPC_EXC_GPR_OFFSET(16) 117 #define GPR17_OFFSET PPC_EXC_GPR_OFFSET(17) 118 #define GPR18_OFFSET PPC_EXC_GPR_OFFSET(18) 119 #define GPR19_OFFSET PPC_EXC_GPR_OFFSET(19) 120 #define GPR20_OFFSET PPC_EXC_GPR_OFFSET(20) 121 #define GPR21_OFFSET PPC_EXC_GPR_OFFSET(21) 122 #define GPR22_OFFSET PPC_EXC_GPR_OFFSET(22) 123 #define GPR23_OFFSET PPC_EXC_GPR_OFFSET(23) 124 #define GPR24_OFFSET PPC_EXC_GPR_OFFSET(24) 125 #define GPR25_OFFSET PPC_EXC_GPR_OFFSET(25) 126 #define GPR26_OFFSET PPC_EXC_GPR_OFFSET(26) 127 #define GPR27_OFFSET PPC_EXC_GPR_OFFSET(27) 128 #define GPR28_OFFSET PPC_EXC_GPR_OFFSET(28) 129 #define GPR29_OFFSET PPC_EXC_GPR_OFFSET(29) 130 #define GPR30_OFFSET PPC_EXC_GPR_OFFSET(30) 131 #define GPR31_OFFSET PPC_EXC_GPR_OFFSET(31) 133 #define CPU_PER_CPU_CONTROL_SIZE 0 138 #define PPC_PER_CPU_CONTROL_REGISTER 272 152 uint32_t FRAME_RESERVED;
160 uint32_t RESERVED_FOR_ALIGNMENT_0;
161 uint32_t EXC_INTERRUPT_ENTRY_INSTANT;
166 uintptr_t EXC_INTERRUPT_FRAME;
168 uint32_t EXC_SPEFSCR;
184 #ifdef PPC_MULTILIB_ALTIVEC 186 uint32_t RESERVED_FOR_ALIGNMENT_3[3];
210 #ifdef PPC_MULTILIB_FPU 226 uint64_t RESERVED_FOR_ALIGNMENT_4;
228 #if PPC_STACK_RED_ZONE_SIZE > 0 229 uint8_t RED_ZONE[ PPC_STACK_RED_ZONE_SIZE ];
235 static inline struct Per_CPU_Control *_PPC_Get_current_per_CPU_control(
void )
247 #define _CPU_Get_current_per_CPU_control() _PPC_Get_current_per_CPU_control() 251 void _CPU_Context_volatile_clobber( uintptr_t pattern );
253 void _CPU_Context_validate( uintptr_t pattern );
257 __asm__ volatile (
".long 0" );
#define RTEMS_INLINE_ROUTINE
Definition: basedefs.h:65
Interrupt stack frame (ISF).
Definition: cpu.h:306
Per CPU Core Structure.
Definition: percpu.h:290
RTEMS_INLINE_ROUTINE void _CPU_Instruction_no_operation(void)
Emits a no operation instruction (nop).
Definition: cpuimpl.h:132
register struct Per_CPU_Control *_SPARC_Per_CPU_current __asm__("g6")
The pointer to the current per-CPU control is available via register g6.
#define RTEMS_XSTRING(_x)
Stringifies expansion of _x.
Definition: basedefs.h:509
RTEMS_INLINE_ROUTINE void _CPU_Instruction_illegal(void)
Emits an illegal instruction.
Definition: cpuimpl.h:122