Ignore:
Timestamp:
Jul 18, 2019, 2:06:55 PM (3 years ago)
Author:
alain
Message:

Introduce the non-standard pthread_parallel_create() system call
and re-write the <fft> and <sort> applications to improve the
intrinsic paralelism in applications.

File:
1 edited

Legend:

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

    r566 r637  
    22 * sys_mkfifo.c - creates a named FIFO file.
    33 *
    4  * Author    Alain Greiner (2016,2017)
     4 * Author    Alain Greiner (2016,2017,2018,2019)
    55 *
    66 * Copyright (c) UPMC Sorbonne Universites
     
    3333                 uint32_t  mode __attribute__((unused)) )
    3434{
    35     error_t        error;
    3635    char           kbuf[CONFIG_VFS_MAX_PATH_LENGTH];
    3736
     
    3938    process_t * process = this->process;
    4039
     40#if (DEBUG_SYS_MKFIFO || CONFIG_INSTRUMENTATION_SYSCALLS)
     41uint64_t     tm_start = hal_get_cycles();
     42#endif
     43
     44#if DEBUG_SYS_MKFIFO
     45if( DEBUG_SYS_MKFIFO < tm_end )
     46printk("\n[%s] thread[%x,%x] enter for <%s> / cycle %d\n",
     47__FUNCTION__, process->pid, this->trdid, pathname, (uint32_t)tm_end );
     48#endif
     49 
    4150    // check fd_array not full
    4251    if( process_fd_array_full() )
    4352    {
    44         printk("\n[ERROR] in %s : file descriptor array full for process %x\n",
    45                __FUNCTION__ , process->pid );
     53
     54#if DEBUG_SYSCALLS_ERROR
     55printk("\n[ERROR] in %s : file descriptor array full for process %x\n",
     56__FUNCTION__ , process->pid );
     57#endif
    4658        this->errno = ENFILE;
    4759        return -1;
     
    5163    if( hal_strlen_from_uspace( pathname ) >= CONFIG_VFS_MAX_PATH_LENGTH )
    5264    {
    53         printk("\n[ERROR] in %s : pathname too long\n", __FUNCTION__ );
     65
     66#if DEBUG_SYSCALLS_ERROR
     67printk("\n[ERROR] in %s : pathname too long\n", __FUNCTION__ );
     68#endif
    5469        this->errno = ENFILE;
    5570        return -1;
     
    5772
    5873    // copy pathname in kernel space
    59     hal_strcpy_from_uspace( kbuf , pathname , CONFIG_VFS_MAX_PATH_LENGTH );
     74    hal_strcpy_from_uspace( XPTR( local_cxy , kbuf ),
     75                            pathname,
     76                            CONFIG_VFS_MAX_PATH_LENGTH );
    6077
    6178    printk("\n[ERROR] in %s : not implemented yet\n", __FUNCTION__ );
    6279    return -1;
    6380
    64     if( error )
    65     {
    66         printk("\n[ERROR] in %s : cannot create named FIFO %s\n",
    67                __FUNCTION__ , kbuf );
    68         this->errno = error;
    69         return -1;
    70     }
     81#if (DEBUG_SYS_MKFIFO || CONFIG_INSTRUMENTATION_SYSCALLS)
     82uint64_t     tm_end = hal_get_cycles();
     83#endif
    7184
    72     return 0;
     85#if DEBUG_SYS_MKFIFO
     86if( DEBUG_SYS_MKFIFO < tm_end )
     87printk("\n[%s] thread[%x,%x] exit for <%s> / cycle %d\n",
     88__FUNCTION__, process->pid, this->trdid, pathname, (uint32_t)tm_end );
     89#endif
     90 
     91#if CONFIG_INSTRUMENTATION_SYSCALLS
     92hal_atomic_add( &syscalls_cumul_cost[SYS_MKFIFO] , tm_end - tm_start );
     93hal_atomic_add( &syscalls_occurences[SYS_MKFIFO] , 1 );
     94#endif
    7395
    7496} // end sys_mkfifo()
Note: See TracChangeset for help on using the changeset viewer.