Changeset 640 for trunk/hal/tsar_mips32/core/hal_context.c
- Timestamp:
- Oct 1, 2019, 1:19:00 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hal/tsar_mips32/core/hal_context.c
r635 r640 151 151 assert( (context != NULL ), "CPU context not allocated" ); 152 152 153 // compute the PPN for the GPT PT1 154 ppn_t gpt_pt1_ppn = ppm_base2ppn( XPTR( local_cxy , thread->process->vmm.gpt.ptr ) ); 155 153 156 // initialisation depends on thread type 154 157 if( thread->type == THREAD_USER ) … … 160 163 context->c0_sr = SR_USR_MODE; 161 164 context->c0_th = (uint32_t)thread; 162 context->c2_ptpr = (uint32_t)( (thread->process->vmm.gpt.ppn)>> 1);165 context->c2_ptpr = (uint32_t)(gpt_pt1_ppn >> 1); 163 166 context->c2_mode = 0xF; 164 167 } … … 170 173 context->c0_sr = SR_SYS_MODE; 171 174 context->c0_th = (uint32_t)thread; 172 context->c2_ptpr = (uint32_t)( (thread->process->vmm.gpt.ppn)>> 1);175 context->c2_ptpr = (uint32_t)(gpt_pt1_ppn >> 1); 173 176 context->c2_mode = 0x3; 174 177 } … … 193 196 194 197 process_t * child_process; // local pointer on child processs 195 uint32_t child_pt_ppn; // PPN of child process PT1 198 void * child_gpt_ptr; // local pointer on child GPT PT1 199 uint32_t child_gpt_ppn; // PPN of child GPT PT1 196 200 vseg_t * child_us_vseg; // local pointer on child user stack vseg 197 201 … … 216 220 child_process = hal_remote_lpt( XPTR(child_cxy , &child_ptr->process) ); 217 221 218 // get ppn of remote child process page table 219 child_pt_ppn = hal_remote_l32( XPTR(child_cxy , &child_process->vmm.gpt.ppn) ); 222 // get base and ppn of remote child process GPT PT1 223 child_gpt_ptr = hal_remote_l32( XPTR(child_cxy , &child_process->vmm.gpt.ptr) ); 224 child_gpt_ppn = ppm_base2ppn( XPTR( child_cxy , child_gpt_ptr ) ); 220 225 221 226 // get local pointer on local parent uzone (in parent kernel stack) … … 285 290 context.sp_29 = (uint32_t)child_ksp; 286 291 context.c0_th = (uint32_t)child_ptr; 287 context.c2_ptpr = (uint32_t)child_ pt_ppn >> 1;292 context.c2_ptpr = (uint32_t)child_gpt_ppn >> 1; 288 293 289 294 // From this point, both parent and child execute the following code, … … 304 309 uint32_t child_sp = parent_uzone[UZ_SP] + child_us_base - parent_us_base; 305 310 uint32_t child_th = (uint32_t)child_ptr; 306 uint32_t child_ptpr = (uint32_t)child_ pt_ppn >> 1;311 uint32_t child_ptpr = (uint32_t)child_gpt_ppn >> 1; 307 312 308 313 #if DEBUG_HAL_CONTEXT
Note: See TracChangeset
for help on using the changeset viewer.