Changeset 311
- Timestamp:
- Aug 2, 2017, 2:17:00 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hal/generic/hal_context.h
r296 r311 69 69 70 70 /**************************************************************************************** 71 * This function saves in the thread context the CPU registers values that must be72 * saved at context switch.71 * This function performs a context switch, saving the CPU register values into the 72 * old thread, and initializing these registers with the values of the new thread. 73 73 **************************************************************************************** 74 * @ ctx : pointer on cpu context. 74 * @ old : pointer on current thread. 75 * @ new : pointer on the thread we want to switch to. 75 76 ***************************************************************************************/ 76 void hal_cpu_context_save( void * ctx ); 77 78 /**************************************************************************************** 79 * This function restores from the thread context the CPU registers values that must 80 * be restored at context switch. 81 **************************************************************************************** 82 * @ ctx : pointer on cpu context. 83 ***************************************************************************************/ 84 void hal_cpu_context_restore( void * ctx ); 77 void hal_cpu_context_switch( struct thread_s * old , struct thread_s * new ); 85 78 86 79 /**************************************************************************************** … … 92 85 ***************************************************************************************/ 93 86 void hal_cpu_context_load( struct thread_s * thread ); 94 95 87 96 88 /**************************************************************************************** -
trunk/hal/tsar_mips32/core/hal_context.c
r296 r311 335 335 ".set at \n" 336 336 : : : "$26" , "$27" ); 337 } 338 339 void hal_cpu_context_switch( thread_t * old , thread_t * new ) 340 { 341 // XXX XXX: TODO 342 hal_cpu_context_save( old->cpu_context ); 343 hal_cpu_context_restore( new->cpu_context ); 337 344 } 338 345 -
trunk/hal/x86_64/core/hal_context.c
r298 r311 103 103 } 104 104 105 void hal_cpu_context_save( void * ctx ) 106 { 107 x86_panic((char *)__func__); 108 } 109 110 void hal_cpu_context_restore( void * ctx ) 105 void hal_cpu_context_switch( thread_t * old , thread_t * new ) 111 106 { 112 107 x86_panic((char *)__func__); -
trunk/kernel/kern/scheduler.c
r306 r311 321 321 322 322 // switch contexts 323 hal_cpu_context_save( current->cpu_context ); 324 hal_cpu_context_restore( next->cpu_context ); 323 hal_cpu_context_switch( current , next ); 325 324 326 325 // restore IRQs when calling thread resume
Note: See TracChangeset
for help on using the changeset viewer.