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_kill.c

    r409 r416  
    11/*
    2  * sys_kill.c - Send a signal to a given process.
     2 * sys_kill.c - Kernel function implementing the "kill" system call.
    33 *
    44 * Author    Alain Greiner (2016,2017)
     
    2929#include <printk.h>
    3030#include <process.h>
    31 #include <signal.h>
     31#include <shared_syscalls.h>
    3232#include <cluster.h>
    3333#include <rpc.h>
     
    3939    uint32_t    save_sr;       // required to enable IRQs
    4040
     41    thread_t  * this    = CURRENT_THREAD;
     42
    4143#if CONFIG_SYSCALL_DEBUG
    4244uint64_t    tm_start;
    4345uint64_t    tm_end;
    4446tm_start = hal_get_cycles();
     47printk("\n[DBG] %s : core[%x,%d] enter / process %x / sig %d / cycle %d\n",
     48__FUNCTION__ , local_cxy , this->core->lid , pid, sig_id, (uint32_t)tm_start );
    4549#endif
    46 
    47     thread_t  * this    = CURRENT_THREAD;
    48     process_t * process = this->process;
    4950
    5051    // get owner process cluster and lpid
     
    7677    if( local_cxy == owner_cxy )                                // owner is local
    7778    {
    78         process_make_kill( process , sig_id );
     79        process_make_kill( pid , sig_id );
    7980    }
    8081    else                                                        // owner is remote
    8182    {
    82         rpc_process_make_kill_client( owner_cxy , process , sig_id );
     83        rpc_process_make_kill_client( owner_cxy , pid , sig_id );
    8384    }
    8485
     
    9091#if CONFIG_SYSCALL_DEBUG
    9192tm_end = hal_get_cycles();
    92 syscall_dmsg("\n[DBG] %s exit : core[%x,%d] / thread %x in process %x / cycle %d\n"
    93 "process %x killed / cost = %d\n",
    94 __FUNCTION__ , local_cxy , this->core->lid , this->trdid , this->process->pid ,
    95 tm_start , pid , (uint32_t)(tm_end - tm_start) );
     93printk("\n[DBG] %s : core[%x,%d] exit / process %x / sig %d / cost = %d\n",
     94__FUNCTION__ , local_cxy , this->core->lid , pid, sig_id, (uint32_t)(tm_end - tm_start) );
    9695#endif
    9796 
Note: See TracChangeset for help on using the changeset viewer.