Changeset 441 for trunk/kernel/syscalls


Ignore:
Timestamp:
May 9, 2018, 3:13:56 PM (7 years ago)
Author:
alain
Message:

Fix a bug in rpc_vmm_get_pte_client() function (bad RPC index).

Location:
trunk/kernel/syscalls
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/syscalls/sys_exec.c

    r438 r441  
    150150// Implementation note:
    151151// This function must be called by the main thread (thread 0 in owner cluster).
    152 // IT build an exec_info_t structure containing all informations
     152// It build an exec_info_t structure containing all informations
    153153// required to initialize the new process descriptor and the associated thread.
    154154// It includes the process main() arguments, the environment variables,
     
    208208tm_start = hal_get_cycles();
    209209if( DEBUG_SYS_EXEC < tm_start )
    210 printk("\n[DBG] %s : thread %x enter / process %x / path %s / cycle = %d\n",
     210printk("\n[DBG] %s : thread %x in process %x enter for path <%s> / cycle = %d\n",
    211211__FUNCTION__, this, pid, exec_info.path, (uint32_t)tm_start );
    212212#endif
     
    219219
    220220#if DEBUG_SYSCALLS_ERROR
    221 printk("\n[ERROR] in %s : cannot access args\n", __FUNCTION__ );
     221printk("\n[ERROR] in %s : thread %x in process %x cannot access args\n",
     222__FUNCTION__ , this, pid );
    222223#endif
    223224            this->errno = EINVAL;
     
    233234
    234235#if DEBUG_SYCALLS_ERROR
    235 printk("\n[ERROR] in %s : cannot access envs\n", __FUNCTION__ );
     236printk("\n[ERROR] in %s : thread %x in process %x cannot access envs\n",
     237__FUNCTION__ , this, pid );
    236238#endif
    237239            this->errno = EINVAL;
     
    247249
    248250#if DEBUG_SYSCALLS_ERROR
    249 printk("\n[ERROR] in %s : cannot create process %x in cluster %x\n",
    250 __FUNCTION__, pid, CXY_FROM_PID(pid) );
     251printk("\n[ERROR] in %s : thread %x in process %x cannot create process for <%s>\n",
     252__FUNCTION__, this, pid, exec_info.path );
    251253#endif
    252254        this->errno = error;
     
    257259tm_end = hal_get_cycles();
    258260if( DEBUG_SYS_EXEC < tm_end )
    259 printk("\n[DBG] %s : thread %x exit / process %x / cost = %d / cycle %d\n",
     261printk("\n[DBG] %s : thread %x in process %x exit / cost = %d / cycle %d\n",
    260262__FUNCTION__, this, pid, (uint32_t)(tm_end - tm_start), (uint32_t)tm_end );
    261263#endif
    262264
    263     // deschedule <=> old thread suicide because the BLOCKED_GLOBAL
    264     // and the FLAG_REQ_DELETE have been set by process_make_exec()
     265    // In case of success, this calling thread deschedules, causing suicide,
     266    // because a new process descriptor and its associated main thread
     267    // have been created by the process_make_exec() function, and the
     268    // BLOCKED_GLOBAL & FLAG_REQ_DELETE bits have been set for the calling thread.
    265269    sched_yield( "old process suicide in sys_exec()" );
    266270
    267     assert( false , __FUNCTION__ , "This code should not be executed\n" );
    268 
    269271    return 0; 
    270272
  • trunk/kernel/syscalls/sys_exit.c

    r440 r441  
    5151#endif
    5252
    53     // get owner process descriptor pointers an cluster
     53    // get owner process descriptor pointers and cluster
    5454    xptr_t      owner_xp  = cluster_get_owner_process_from_pid( pid );
    5555    cxy_t       owner_cxy = GET_CXY( owner_xp );
     
    128128    sched_yield( "process exit" );
    129129
    130     // this code should never be executed
    131     assert( false , __FUNCTION__ , "this code should not be executed...\n" );
    132130        return 0;
    133131
  • trunk/kernel/syscalls/sys_read.c

    r440 r441  
    223223if( DEBUG_SYS_READ < tm_end )
    224224printk("\n[DBG] %s : thread %x exit / process %x / cycle %d\n"
    225 "nbytes = %d / first byte = %c / file_id = %d / cost = %d\n",
     225"nbytes = %d / file_id = %d / cost = %d\n",
    226226__FUNCTION__ , this, process->pid,
    227 (uint32_t)tm_start , nbytes , *((char *)(intptr_t)paddr) , file_id ,
    228 (uint32_t)(tm_end - tm_start) );
     227(uint32_t)tm_start , nbytes , file_id , (uint32_t)(tm_end - tm_start) );
    229228#endif
    230229
     
    232231exit_sys_read = (uint32_t)tm_end;
    233232
    234 printk("\n@@@@@@@@@@@@ timing to read character %c\n"
     233printk("\n@@@@@@@@@@@@ timing to read character\n"
    235234" - enter_sys_read          = %d / delta %d\n"
    236235" - enter_devfs_read        = %d / delta %d\n"
     
    247246" - exit_devfs_read         = %d / delta %d\n"
    248247" - exit_sys_read           = %d / delta %d\n",
    249 *((char *)(intptr_t)paddr) ,
    250248enter_sys_read          , 0 ,
    251249enter_devfs_read        , enter_devfs_read        - enter_sys_read          ,
  • trunk/kernel/syscalls/sys_write.c

    r440 r441  
    184184if( DEBUG_SYS_WRITE < tm_end )
    185185printk("\n[DBG] %s : thread %x exit / process %x / cycle %d\n"
    186 "nbytes = %d / first byte = %c / file_id = %d / cost = %d\n",
     186"nbytes = %d / file_id = %d / cost = %d\n",
    187187__FUNCTION__, this, process->pid, (uint32_t)tm_start,
    188 nbytes, *((char *)(intptr_t)paddr) , file_id , (uint32_t)(tm_end - tm_start) );
     188nbytes, file_id , (uint32_t)(tm_end - tm_start) );
    189189#endif
    190190 
     
    192192exit_sys_write = (uint32_t)tm_end;
    193193
    194 printk("\n@@@@@@@@@@@@ timing to write string %c\n"
     194printk("\n@@@@@@@@@@@@ timing to write\n"
    195195" - enter_sys_write          = %d / delta %d\n"
    196196" - enter_devfs_write        = %d / delta %d\n"
     
    207207" - exit_devfs_write         = %d / delta %d\n"
    208208" - exit_sys_write           = %d / delta %d\n",
    209 *((char *)(intptr_t)paddr) ,
    210209enter_sys_write          , 0 ,
    211210enter_devfs_write        , enter_devfs_write        - enter_sys_write          ,
Note: See TracChangeset for help on using the changeset viewer.