Ignore:
Timestamp:
Nov 7, 2017, 3:08:12 PM (6 years ago)
Author:
alain
Message:

First implementation of fork/exec.

File:
1 edited

Legend:

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

    r406 r407  
    3131
    3232/////////////////////////////////////////////////////////////////////////////////////////////
     33// This ƒonction should never be called...
    3334/////////////////////////////////////////////////////////////////////////////////////////////
    34 static inline int sys_undefined()
     35static int sys_undefined()
    3536{
    3637    panic("undefined system call");
     
    4041/////////////////////////////////////////////////////////////////////////////////////////////
    4142// This array of pointers define the kernel functions implementing the syscalls.
    42 // It must be kept consistent with the enum in syscalls.h
     43// It must be kept consistent with the enum in "shared_syscalls.h" file.
    4344/////////////////////////////////////////////////////////////////////////////////////////////
    4445
     
    4849{
    4950    sys_thread_exit,        // 0
    50     sys_mmap,               // 1
     51    sys_thread_yield,       // 1
    5152    sys_thread_create,      // 2
    5253    sys_thread_join,        // 3
    5354    sys_thread_detach,      // 4
    54     sys_thread_yield,       // 5
     55    sys_undefined,          // 5
    5556    sys_sem,                // 6
    5657    sys_condvar,            // 7
    5758    sys_barrier,            // 8
    5859    sys_mutex,              // 9
    59     sys_thread_sleep,       // 10
    60     sys_thread_wakeup,      // 11
     60
     61    sys_undefined,          // 10
     62    sys_munmap,             // 11
    6163    sys_open,               // 12
    62     sys_creat,              // 13
     64    sys_mmap,               // 13
    6365    sys_read,               // 14
    6466    sys_write,              // 15
     
    6769    sys_unlink,             // 18
    6870    sys_pipe,               // 19
     71
    6972    sys_chdir,              // 20
    7073    sys_mkdir,              // 21
     
    7477    sys_closedir,           // 25
    7578    sys_getcwd,             // 26
    76     sys_clock,              // 27
     79    sys_undefined,          // 27 
    7780    sys_alarm,              // 28
    7881    sys_rmdir,              // 29
     82
    7983    sys_utls,               // 30
    8084    sys_chmod,              // 31
     
    8791    sys_stat,               // 38
    8892    sys_trace,              // 39
     93
     94    sys_get_config,         // 40
     95    sys_get_core,           // 41
     96    sys_get_cycle,          // 42
     97    sys_get_sched,          // 43
     98    sys_panic,              // 44
     99    sys_thread_sleep,       // 45
     100    sys_thread_wakeup,      // 46
    89101};
    90102
     
    102114        thread_user_time_update( this );
    103115
    104     // enable IRQs
     116    // enable interrupts
    105117        hal_enable_irq( NULL );
    106118 
     
    116128        }
    117129
    118         syscall_dmsg("\n[DMSG] %s : pid = %x / trdid = %x / service #%d\n"
    119                  "         arg0 = %x / arg1 = %x / arg2 = %x / arg3 = %x\n",
    120                          __FUNCTION__ , this->process->pid , this->trdid , service_num ,
    121                          arg0 , arg1 , arg2 , arg3 );
     130#if( CONFIG_SYSCALL_DEBUG & 0x1)
     131printk("\n[DBG] %s : pid = %x / trdid = %x / service #%d\n"
     132"      arg0 = %x / arg1 = %x / arg2 = %x / arg3 = %x\n",
     133__FUNCTION__ , this->process->pid , this->trdid , service_num , arg0 , arg1 , arg2 , arg3 );
     134#endif
    122135
    123136    // reset errno
     
    127140        error = syscall_tbl[service_num] ( arg0 , arg1 , arg2 , arg3 );
    128141
    129     // handle pending signals for the calling thread
    130     thread_signals_handle( this );
    131 
    132         // disable IRQs
     142    // disable interrupt
    133143        hal_disable_irq( NULL );
    134144
Note: See TracChangeset for help on using the changeset viewer.