Ignore:
Timestamp:
Oct 4, 2018, 11:50:21 PM (5 years ago)
Author:
alain
Message:

Complete restructuration of kernel locks.

File:
1 edited

Legend:

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

    r506 r566  
    3434#include <process.h>
    3535
    36 #include <syscalls.h>
    37 
    38 // TODO: concurrent user page(s) munmap need to be handled [AG]
    3936
    4037extern uint32_t enter_sys_read;
     
    6966    xptr_t       process_owner_xp = process->owner_xp;
    7067 
     68#if (DEBUG_SYS_READ || CONFIG_INSTRUMENTATION_SYSCALLS)
     69uint64_t     tm_start = hal_get_cycles();
     70#endif
     71
    7172#if DEBUG_SYS_READ
    72 uint64_t     tm_start;
    73 uint64_t     tm_end;
    74 tm_start = hal_get_cycles();
    7573if( DEBUG_SYS_READ < tm_start )
    7674printk("\n[DBG] %s : thread %x in process %x enter / vaddr %x / count %d / cycle %d\n",
     
    130128
    131129    // check file readable
    132     uint32_t attr = hal_remote_lw( XPTR( file_cxy , &file_ptr->attr ) );
     130    uint32_t attr = hal_remote_l32( XPTR( file_cxy , &file_ptr->attr ) );
    133131    if( (attr & FD_ATTR_READ_ENABLE) == 0 )
    134132        {
     
    143141   
    144142    // get file type
    145     vfs_inode_type_t type = hal_remote_lw( XPTR( file_cxy , &file_ptr->type ) );
     143    vfs_inode_type_t type = hal_remote_l32( XPTR( file_cxy , &file_ptr->type ) );
    146144
    147145    // action depend on file type
     
    149147    {
    150148        // check file readable
    151         uint32_t attr = hal_remote_lw( XPTR( file_cxy , &file_ptr->attr ) );
     149        uint32_t attr = hal_remote_l32( XPTR( file_cxy , &file_ptr->attr ) );
    152150
    153151        if( (attr & FD_ATTR_READ_ENABLE) == 0 )
     
    181179        {
    182180            // extended pointer on TXT owner process
    183             txt_owner_xp  = hal_remote_lwd( XPTR( chdev_cxy , &chdev_ptr->ext.txt.owner_xp ) );
     181            txt_owner_xp  = hal_remote_l64( XPTR( chdev_cxy , &chdev_ptr->ext.txt.owner_xp ) );
    184182
    185183            // check TXT_RX ownership
     
    230228    hal_fence();
    231229
     230#if (DEBUG_SYS_READ || CONFIG_INSTRUMENTATION_SYSCALLS)
     231uint64_t     tm_end = hal_get_cycles();
     232#endif
     233
    232234#if DEBUG_SYS_READ
    233 tm_end = hal_get_cycles();
    234235if( DEBUG_SYS_READ < tm_end )
    235 printk("\n[DBG] %s : thread %x in process %x exit / cycle %d / cost %d\n",
    236 __FUNCTION__ , this->trdid, process->pid, (uint32_t)tm_start, (uint32_t)(tm_end - tm_start) );
     236printk("\n[DBG] %s : thread %x in process %x exit / cycle %d\n",
     237__FUNCTION__ , this->trdid, process->pid, (uint32_t)tm_end );
     238#endif
     239
     240#if CONFIG_INSTRUMENTATION_SYSCALLS
     241hal_atomic_add( &syscalls_cumul_cost[SYS_READ] , tm_end - tm_start );
     242hal_atomic_add( &syscalls_occurences[SYS_READ] , 1 );
    237243#endif
    238244
Note: See TracChangeset for help on using the changeset viewer.