Ignore:
Timestamp:
Oct 1, 2019, 1:19:00 PM (5 years ago)
Author:
alain
Message:

Remove all RPCs in page-fault handling.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/hal/tsar_mips32/core/hal_context.c

    r635 r640  
    151151    assert( (context != NULL ), "CPU context not allocated" );
    152152
     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
    153156    // initialisation depends on thread type
    154157    if( thread->type == THREAD_USER )
     
    160163        context->c0_sr   = SR_USR_MODE;
    161164            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);
    163166        context->c2_mode = 0xF;
    164167    }
     
    170173        context->c0_sr   = SR_SYS_MODE;
    171174            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);
    173176        context->c2_mode = 0x3;
    174177    }
     
    193196
    194197    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
    196200    vseg_t            * child_us_vseg;     // local pointer on child user stack vseg
    197201   
     
    216220    child_process = hal_remote_lpt( XPTR(child_cxy , &child_ptr->process) );
    217221
    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 ) );   
    220225
    221226    // get local pointer on local parent uzone (in parent kernel stack)
     
    285290    context.sp_29   = (uint32_t)child_ksp;
    286291    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;
    288293
    289294    // From this point, both parent and child execute the following code,
     
    304309        uint32_t child_sp    = parent_uzone[UZ_SP]  + child_us_base - parent_us_base;
    305310        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;
    307312
    308313#if DEBUG_HAL_CONTEXT
Note: See TracChangeset for help on using the changeset viewer.