Changeset 296 for trunk/hal/generic/hal_context.h
- Timestamp:
- Jul 31, 2017, 1:59:52 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hal/generic/hal_context.h
r151 r296 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 // have not been saved in the stack by the interrupt handler.34 // have not been saved in the kernel stack by the interrupt handler. 35 35 // - the "hal_fpu_context_t" structure is used to save the FPU registers when required. 36 36 ////////////////////////////////////////////////////////////////////////////////////////// … … 43 43 * This function allocates, from the local cluster, the physical memory required for 44 44 * the thread CPU context, initialises it, and links the context to the thread. 45 * Seven registers are initialised:46 * - sp_29 / fp_30 / ra_3147 * - c0_sr / c0_th48 * - c2_ptpr / c2_mode49 45 **************************************************************************************** 50 46 * @ thread : pointer on the thread descriptor. … … 73 69 74 70 /**************************************************************************************** 75 * This function saves in the thread context the CPU registers values that have not 76 * been saved in the thread stack by the exception handler: 77 * - GRs : s0 to S7 , sp , fp, ra 78 * - CP0 : th 79 * - CP2 : ptpr , mode 71 * This function saves in the thread context the CPU registers values that must be 72 * saved at context switch. 80 73 **************************************************************************************** 81 * @ thread : pointer on the thread descriptor.74 * @ ctx : pointer on cpu context. 82 75 ***************************************************************************************/ 83 void hal_cpu_context_save( struct thread_s * thread);76 void hal_cpu_context_save( void * ctx ); 84 77 85 78 /**************************************************************************************** 86 * This function restores from the thread context the CPU registers values that have not 87 * been saved in the thread stack by the exception handler. 88 * - GRs : s0 to S7 , sp , fp, ra 89 * - CP0 : th 90 * - CP2 : ptpr , mode 79 * This function restores from the thread context the CPU registers values that must 80 * be restored at context switch. 91 81 **************************************************************************************** 92 * @ thread : pointer on the thread descriptor.82 * @ ctx : pointer on cpu context. 93 83 ***************************************************************************************/ 94 void hal_cpu_context_restore( struct thread_s * thread);84 void hal_cpu_context_restore( void * ctx ); 95 85 96 86 /**************************************************************************************** 97 87 * This function loads the relevant CPU registers from values contained in 98 88 * the thread context. It should be called for a thread that has not been executed yet. 99 * - GRs : sp , fp , a0100 * - CP0 : sr , epc , th101 * - CP2 : ptpr , mode102 89 * It reset the loadable flag in thread descriptor. 103 90 **************************************************************************************** … … 105 92 ***************************************************************************************/ 106 93 void hal_cpu_context_load( struct thread_s * thread ); 107 108 94 109 95
Note: See TracChangeset
for help on using the changeset viewer.