Changeset 408 for trunk/hal/generic/hal_context.h
- Timestamp:
- Dec 5, 2017, 4:20:07 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hal/generic/hal_context.h
r407 r408 57 57 58 58 /**************************************************************************************** 59 * This function display the following slots of a thread CPU context: 60 * - GPR : gp_28 , sp_29 , ra_31 61 * - CP0 : c0_sr , c0_th , c0_epc 62 * - CP2 : c2_ptpr , c2-mode 59 * This function is used to implement the fork() system call. 60 * 1) It saves in a remote (child) thread CPU context the current CPU registers values. 61 * Three slots are not simple copies of the parent registers values : 62 * - the thread pointer is set to the child thread local pointer. 63 * - the stack pointer is set to parrent SP + (child_base - parent_base). 64 * - the status register is set to kernel mode with IRQ disabled. 65 * 2) It copies the content of the calling (parent) thread kernel_stack, 66 * to the remote (child) thread kernel_stack. 63 67 **************************************************************************************** 64 * @ thread : local pointer on the thread descriptor.68 * @ thread_xp : extended pointer on the remote thread descriptor. 65 69 ***************************************************************************************/ 66 void hal_cpu_context_display( struct thread_s * thread ); 70 void hal_cpu_context_fork( xptr_t thread_xp ); 71 72 /**************************************************************************************** 73 * This function display some slots of the CPU context. 74 * - For the MIPS32 : 75 * . GPR : gp_28 , sp_29 , ra_31 76 * . CP0 : c0_sr , c0_th , c0_epc 77 * . CP2 : c2_ptpr , c2-mode 78 * - For X86 TODO : 79 **************************************************************************************** 80 * @ thread_xp : extended pointer on the thread descriptor. 81 ***************************************************************************************/ 82 void hal_cpu_context_display( xptr_t thread_xp ); 67 83 68 84 /**************************************************************************************** … … 106 122 107 123 /**************************************************************************************** 108 * This function saves in the thread uzone the FPU registers values. 124 * This function is used to implement the fork() system call. 125 * It saves in a remote thread FPU context the current FPU registers values. 109 126 **************************************************************************************** 110 * @ thread : pointer on the thread descriptor.127 * @ thread_xp : extended pointer on the remote thread descriptor. 111 128 ***************************************************************************************/ 112 void hal_fpu_context_save( struct thread_s * thread);129 void hal_fpu_context_save( xptr_t thread_xp ); 113 130 114 131 /**************************************************************************************** 115 * This function restores from the thread uzonethe FPU registers values.132 * This function restores from the calling thread FPU context the FPU registers values. 116 133 **************************************************************************************** 117 134 * @ thread : pointer on the thread descriptor.
Note: See TracChangeset
for help on using the changeset viewer.