Ignore:
Timestamp:
Nov 19, 2020, 11:45:52 PM (3 years ago)
Author:
alain
Message:

1) Introduce up to 4 command lines arguments in the KSH "load" command.
These arguments are transfered to the user process through the
argc/argv mechanism, using the user space "args" vseg.

2) Introduce the named and anonymous "pipes", for inter-process communication
through the pipe() and mkfifo() syscalls.

3) Introduce the "chat" application to validate the two above mechanisms.

4) Improve printk() and assert() fonctions in printk.c.

File:
1 edited

Legend:

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

    r637 r670  
    22 * sys_chmod.c - Change file access rights.
    33 *
    4  * Author    Alain Greiner  (2016,2017,2018,2019)
     4 * Author       Alain Greiner  (2016,2017,2018,2019,2020)
    55 *
    66 * Copyright (c) 2015 UPMC Sorbonne Universites
     
    2929#include <thread.h>
    3030#include <process.h>
    31 
    3231#include <syscalls.h>
    3332
     
    3635               uint32_t   rights __attribute__((unused)) )
    3736{
    38     error_t     error;
    3937    char        kbuf[CONFIG_VFS_MAX_PATH_LENGTH];
    4038
    4139    thread_t  * this    = CURRENT_THREAD;
    42     process_t * process = this->process;
     40
     41#if DEBUG_SYS_CHMOD || DEBUG_SYSCALLS_ERROR || CONFIG_INSTRUMENTATION_SYSCALLS
     42process_t * process  = this->process;
     43uint64_t    tm_start = hal_get_cycles();
     44#endif
    4345
    4446    // check pathname length
     
    4749
    4850#if DEBUG_SYSCALLS_ERROR
    49 printk("\n[ERROR] in %s : pathname too long / thread %x in process %x\n",
     51if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
     52printk("\n[ERROR] in %s : thread[%x,%x] / pathname too long\n",
    5053__FUNCTION__, this->trdid, process->pid );
    5154#endif
     
    5962                            CONFIG_VFS_MAX_PATH_LENGTH );
    6063
     64
     65
     66
    6167    printk("\n[ERROR] in %s : not implemented yet\n", __FUNCTION__ );
    6268    return -1;
    6369
    64     // get cluster and local pointer on reference process
    65     // xptr_t      ref_xp  = process->ref_xp;
    66     // process_t * ref_ptr = (process_t *)GET_PTR( ref_xp );
    67     // cxy_t       ref_cxy = GET_CXY( ref_xp );
    6870
    69     // call the relevant VFS function
    70     // error = vfs_chmod( cwd_xp,
    71     //                    kbuf,
    72     //                    rights );
    7371
    74     if( error )
    75     {
    76         printk("\n[ERROR] in %s : cannot remove directory %s\n",
    77         __FUNCTION__ , kbuf );
    78         this->errno = error;
    79         return -1;
    80     }
     72
     73    hal_fence();
     74
     75#if (DEBUG_SYS_CHMOD || CONFIG_INSTRUMENTATION_SYSCALLS)
     76uint64_t     tm_end = hal_get_cycles();
     77#endif
     78
     79#if DEBUG_SYS_CHMOD
     80if( DEBUG_SYS_CHMOD < tm_end )
     81printk("\n[%s] thread[%x,%x] exit for / cycle %d\n",
     82__FUNCTION__, process->pid, this->trdid, (uint32_t)tm_end );
     83#endif
     84 
     85#if CONFIG_INSTRUMENTATION_SYSCALLS
     86hal_atomic_add( &syscalls_cumul_cost[SYS_CHMOD] , tm_end - tm_start );
     87hal_atomic_add( &syscalls_occurences[SYS_CHMOD] , 1 );
     88#endif
    8189
    8290    return 0;
Note: See TracChangeset for help on using the changeset viewer.