Ignore:
Timestamp:
Apr 10, 2019, 10:09:39 AM (5 years ago)
Author:
alain
Message:

Fix a bug in the vmm_remove_vseg() function: the physical pages
associated to an user DATA vseg were released to the kernel when
the target process descriptor was in the reference cluster.
This physical pages release should be done only when the page
forks counter value is zero.
All other modifications are cosmetic.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/kern/rpc.c

    r624 r625  
    2424#include <kernel_config.h>
    2525#include <hal_kernel_types.h>
     26#include <hal_vmm.h>
    2627#include <hal_atomic.h>
    2728#include <hal_remote.h>
     
    5253    &rpc_pmem_get_pages_server,            // 0
    5354    &rpc_pmem_release_pages_server,        // 1
    54     &rpc_undefined,                        // 2    unused slot
     55    &rpc_ppm_display_server,               // 2
    5556    &rpc_process_make_fork_server,         // 3
    5657    &rpc_user_dir_create_server,           // 4
     
    8182    &rpc_vmm_create_vseg_server,           // 27
    8283    &rpc_vmm_set_cow_server,               // 28
    83     &rpc_hal_vmm_display_server,               // 29
     84    &rpc_hal_vmm_display_server,           // 29
    8485};
    8586
     
    8889    "PMEM_GET_PAGES",            // 0
    8990    "PMEM_RELEASE_PAGES",        // 1
    90     "undefined",                 // 2
     91    "PPM_DISPLAY",               // 2
    9192    "PROCESS_MAKE_FORK",         // 3
    9293    "USER_DIR_CREATE",           // 4
     
    566567
    567568/////////////////////////////////////////////////////////////////////////////////////////
    568 // [2]      undefined slot
    569 /////////////////////////////////////////////////////////////////////////////////////////
     569// [2]            Marshaling functions attached to RPC_PPM_DISPLAY   
     570/////////////////////////////////////////////////////////////////////////////////////////
     571
     572/////////////////////////////////////////
     573void rpc_ppm_display_client( cxy_t  cxy )
     574{
     575#if DEBUG_RPC_PPM_DISPLAY
     576thread_t * this = CURRENT_THREAD;
     577uint32_t cycle = (uint32_t)hal_get_cycles();
     578if( cycle > DEBUG_RPC_PPM_DISPLAY )
     579printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     580__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     581#endif
     582
     583    uint32_t responses = 1;
     584
     585    // initialise RPC descriptor header
     586    rpc_desc_t  rpc;
     587    rpc.index    = RPC_PPM_DISPLAY;
     588    rpc.blocking = true;
     589    rpc.rsp      = &responses;
     590
     591    // register RPC request in remote RPC fifo
     592    rpc_send( cxy , &rpc );
     593
     594#if DEBUG_RPC_PPM_DISPLAY
     595cycle = (uint32_t)hal_get_cycles();
     596if( cycle > DEBUG_RPC_PPM_DISPLAY )
     597printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     598__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
     599#endif
     600}
     601
     602////////////////////////////////////////////////////////////////////
     603void rpc_ppm_display_server( xptr_t __attribute__((__unused__)) xp )
     604{
     605#if DEBUG_RPC_PPM_DISPLAY
     606thread_t * this = CURRENT_THREAD;
     607uint32_t cycle = (uint32_t)hal_get_cycles();
     608if( cycle > DEBUG_RPC_PPM_DISPLAY )
     609printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
     610__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
     611#endif
     612
     613    // call local kernel function
     614    ppm_display();
     615
     616#if DEBUG_RPC_PPM_DISPLAY
     617cycle = (uint32_t)hal_get_cycles();
     618if( cycle > DEBUG_RPC_PPM_DISPLAY )
     619printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
     620__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
     621#endif
     622}
    570623
    571624/////////////////////////////////////////////////////////////////////////////////////////
Note: See TracChangeset for help on using the changeset viewer.