Changeset 459 for trunk/kernel/syscalls


Ignore:
Timestamp:
Aug 13, 2018, 1:43:20 PM (6 years ago)
Author:
alain
Message:

Introduce the math library, to support the floating point
data used by the multi-thread fft application.
Fix several bugs regarding the FPU context save/restore.
Introduce support for the %f format in printf.

Location:
trunk/kernel/syscalls
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/syscalls/shared_include/shared_fcntl.h

    r445 r459  
    11/*
    2  *upashared_fcntl.h - Shared structures used by file related syscalls.
     2 * shared_fcntl.h - Shared structures used by file related syscalls.
    33 *
    44 * Author  Alain Greiner (2016,2017,2018)
     
    3333    O_RDONLY   = 0x0010000,    /*! open file in read-only mode                            */
    3434    O_WRONLY   = 0x0020000,    /*! open file in write-only mode                           */
    35     O_RDWR     = 0x0030000,    /*! open file in read/write mode                           */
     35    O_RDWR     = 0x0000000,    /*! open file in read/write mode                           */
    3636    O_NONBLOCK = 0x0040000,    /*! do not block if data non available                     */
    3737    O_APPEND   = 0x0080000,    /*! append on each write                                   */
  • trunk/kernel/syscalls/sys_close.c

    r457 r459  
    3939        process_t * process = this->process;
    4040
     41#if DEBUG_SYS_CLOSE
     42uint32_t     tm_start;
     43uint32_t     tm_end;
     44tm_start = hal_get_cycles();
     45if( DEBUG_SYS_CLOSE < tm_start )
     46printk("\n[DBG] %s : thread %x in process %x enter / fdid %d / cycle %d\n",
     47__FUNCTION__, this->trdid, process->pid, file_id, (uint32_t)tm_start );
     48#endif
     49 
    4150    // check file_id argument
    4251        if( file_id >= CONFIG_PROCESS_FILE_MAX_NR )
     
    7281        hal_fence();
    7382
     83#if DEBUG_SYS_CLOSE
     84tm_end = hal_get_cycles();
     85if( DEBUG_SYS_CLOSE < tm_start )
     86printk("\n[DBG] %s : thread %x in process %x exit / cost %d / cycle %d\n",
     87__FUNCTION__, this->trdid, process->pid, (uint32_t)(tm_end - tm_start), (uint32_t)tm_start );
     88#endif
     89 
    7490        return 0;
    7591}
  • trunk/kernel/syscalls/sys_open.c

    r457 r459  
    4646    process_t    * process  = this->process;
    4747
     48#if DEBUG_SYS_OPEN
     49uint32_t     tm_start;
     50uint32_t     tm_end;
     51tm_start = hal_get_cycles();
     52#endif
     53 
    4854    // check fd_array not full
    4955    if( process_fd_array_full() )
     
    6672    hal_strcpy_from_uspace( kbuf , pathname , CONFIG_VFS_MAX_PATH_LENGTH );
    6773
     74#if DEBUG_SYS_OPEN
     75if( DEBUG_SYS_OPEN < tm_start )
     76printk("\n[DBG] %s : thread %x in process %x enter / path %s / flags %x / cycle %d\n",
     77__FUNCTION__, this->trdid, process->pid, kbuf, flags, (uint32_t)tm_start );
     78#endif
     79 
    6880    // get cluster and local pointer on reference process
    6981    xptr_t      ref_xp  = process->ref_xp;
     
    8799    if( error )
    88100    {
    89         printk("\n[ERROR] in %s : cannot create file descriptor\n", __FUNCTION__ );
     101        printk("\n[ERROR] in %s : cannot create file descriptor for %s\n",
     102        __FUNCTION__ , kbuf );
    90103        this->errno = ENFILE;
    91104        return -1;
     
    97110    remote_spinlock_unlock( XPTR( local_cxy , &process->fd_array.lock ) );
    98111
     112    hal_fence();
     113
     114#if DEBUG_SYS_OPEN
     115tm_end = hal_get_cycles();
     116if( DEBUG_SYS_OPEN < tm_start )
     117printk("\n[DBG] %s : thread %x in process %x exit / cost %d / cycle %d\n",
     118__FUNCTION__, this->trdid, process->pid, (uint32_t)(tm_end - tm_start), (uint32_t)tm_start );
     119#endif
     120 
    99121    return file_id;
    100122}
  • trunk/kernel/syscalls/sys_read.c

    r457 r459  
    7272tm_start = hal_get_cycles();
    7373if( DEBUG_SYS_READ < tm_start )
    74 printk("\n[DBG] %s : thread %x enter / process %x / vaddr = %x / count %d / cycle %d\n",
    75 __FUNCTION__, this, process->pid, vaddr, count, (uint32_t)tm_start );
     74printk("\n[DBG] %s : thread %x in process %x enter / vaddr %x / count %d / cycle %d\n",
     75__FUNCTION__, this->trdid, process->pid, vaddr, count, (uint32_t)tm_start );
    7676#endif
    7777
     
    231231tm_end = hal_get_cycles();
    232232if( DEBUG_SYS_READ < tm_end )
    233 printk("\n[DBG] %s : thread %x exit / process %x / cycle %d\n"
    234 "nbytes = %d / file_id = %d / cost = %d\n",
    235 __FUNCTION__ , this, process->pid,
     233printk("\n[DBG] %s : thread %x in process %x exit / cycle %d\n"
     234"nbytes %d / file_id %d / cost %d\n",
     235__FUNCTION__ , this->trdid, process->pid,
    236236(uint32_t)tm_start , nbytes , file_id , (uint32_t)(tm_end - tm_start) );
    237237#endif
  • trunk/kernel/syscalls/sys_write.c

    r457 r459  
    7373tm_start = hal_get_cycles();
    7474if( DEBUG_SYS_WRITE < tm_start )
    75 printk("\n[DBG] %s : thread %x enter / process %x / vaddr %x / count %d / cycle %d\n",
    76 __FUNCTION__, this, process->pid, vaddr, count, (uint32_t)tm_start );
     75printk("\n[DBG] %s : thread %x in process %x enter / vaddr %x / count %d / cycle %d\n",
     76__FUNCTION__, this->trdid, process->pid, vaddr, count, (uint32_t)tm_start );
    7777#endif
    7878 
     
    195195tm_end = hal_get_cycles();
    196196if( DEBUG_SYS_WRITE < tm_end )
    197 printk("\n[DBG] %s : thread %x exit / process %x / cycle %d\n"
    198 "nbytes = %d / file_id = %d / cost = %d\n",
    199 __FUNCTION__, this, process->pid, (uint32_t)tm_start,
     197printk("\n[DBG] %s : thread %x in process %x exit / cycle %d\n"
     198"nbytes %d / file_id %d / cost %d\n",
     199__FUNCTION__, this->trdid, process->pid, (uint32_t)tm_start,
    200200nbytes, file_id , (uint32_t)(tm_end - tm_start) );
    201201#endif
Note: See TracChangeset for help on using the changeset viewer.