Ignore:
Timestamp:
Jan 4, 2018, 10:05:47 AM (6 years ago)
Author:
alain
Message:

Improve sys_exec.

File:
1 edited

Legend:

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

    r410 r416  
    11/*
    2  * sys_exit.c: Terminate the calling process.
     2 * sys_exit.c - Kernel function implementing the "exit" system call.
    33 *
    44 * Author    Alain Greiner (2016,2017)
     
    3838    uint32_t    save_sr;       // required to enable IRQs
    3939
     40    thread_t  * this = CURRENT_THREAD;
     41    pid_t       pid  = this->process->pid;
     42
    4043#if CONFIG_SYSCALL_DEBUG
    4144uint64_t    tm_start;
    4245uint64_t    tm_end;
    4346tm_start = hal_get_cycles();
     47printk("\n[DBG] %s : core[%x,%d] enter / process %x / status %x / cycle %d\n",
     48__FUNCTION__ , local_cxy , this->core->lid , pid , status , (uint32_t)tm_start );
    4449#endif
    4550
    46     thread_t  * this    = CURRENT_THREAD;
    47     process_t * process = this->process;
    48 
    4951    // get owner process cluster
    50     cxy_t   owner_cxy  = CXY_FROM_PID( process->pid );
     52    cxy_t   owner_cxy  = CXY_FROM_PID( pid );
    5153
    5254    // enable IRQs
     
    5658    if( local_cxy == owner_cxy )                                // owner is local
    5759    {
    58         process_make_exit( process , status );
     60        process_make_exit( pid , status );
    5961    }
    6062    else                                                        // owner is remote
    6163    {
    62         rpc_process_make_exit_client( owner_cxy, process , status );
     64        rpc_process_make_exit_client( owner_cxy, pid , status );
    6365    }
    6466
     
    7072#if CONFIG_SYSCALL_DEBUG
    7173tm_end = hal_get_cycles();
    72 syscall_dmsg("\n[DBG] %s exit : core[%x,%d] / thread %x in process %x / cycle %d\n"
    73 "process %x killed / cost = %d\n",
    74 __FUNCTION__ , local_cxy , this->core->lid , this->trdid , this->process->pid ,
    75 tm_start , pid , (uint32_t)(tm_end - tm_start) );
     74printk("\n[DBG] %s : core[%x,%d] exit / process %x / status %x / cost = %d\n",
     75__FUNCTION__ , local_cxy , this->core->lid , pid , status , (uint32_t)(tm_end - tm_start) );
    7676#endif
    7777
Note: See TracChangeset for help on using the changeset viewer.