Changeset 151 for trunk/hal/generic
- Timestamp:
- Jul 5, 2017, 3:43:50 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hal/generic/hal_context.h
r17 r151 28 28 // Generic Thread Context API definition (implementation in hal_context.c) 29 29 // 30 // A thread context is defined by the two (core specific) structures hal_c ontext_t31 // and hal_ uzone_t, defined in hal_context.c file, that are accessed with generic30 // A thread context is defined by the two (core specific) structures hal_cpu_context_t 31 // and hal_fpu_context_t, defined in hal_context.c file, that are accessed with generic 32 32 // void* pointers stored in the thread descriptor. 33 33 // - the "hal_context_t" structure is used to store the CPU registers values that 34 34 // have not been saved in the stack by the interrupt handler. 35 // - the "hal_ uzone_t" structure is used to save the FPU registers when required.35 // - the "hal_fpu_context_t" structure is used to save the FPU registers when required. 36 36 ////////////////////////////////////////////////////////////////////////////////////////// 37 37 … … 39 39 40 40 struct thread_s; 41 42 /****************************************************************************************43 * Define various SR values for TSAR-MIPS3244 ***************************************************************************************/45 46 #define SR_USR_MODE 0xFC1147 #define SR_USR_MODE_FPU 0x2000FC1148 #define SR_SYS_MODE 0xFC0049 50 /****************************************************************************************51 * This structure defines the cpu_context for TSAR MIPS32.52 * These registers are saved/restored at each context switch.53 * WARNING : update the hal_cpu_context_save() and hal_cpu_context_restore()54 * functions when modifying this structure.55 ***************************************************************************************/56 57 typedef struct hal_cpu_context_s58 {59 uint32_t s0_16; // slot 060 uint32_t s1_17; // slot 161 uint32_t s2_18; // slot 262 uint32_t s3_19; // slot 363 uint32_t s4_20; // slot 464 uint32_t s5_21; // slot 565 uint32_t s6_22; // slot 666 uint32_t s7_23; // slot 767 uint32_t sp_29; // slot 868 uint32_t fp_30; // slot 969 uint32_t ra_31; // slot 1070 uint32_t c0_sr; // slot 1171 uint32_t c0_th; // slot 1272 uint32_t c2_ptpr; // slot 1373 uint32_t c2_mode; // slot 1474 }75 hal_cpu_context_t;76 77 /****************************************************************************************78 * This structure defines the fpu_context for TSAR MIPS32.79 ***************************************************************************************/80 81 typedef struct hal_fpu_context_s82 {83 uint32_t fpu_regs[32];84 }85 hal_fpu_context_t;86 41 87 42 /****************************************************************************************
Note: See TracChangeset
for help on using the changeset viewer.