Ignore:
Timestamp:
Dec 20, 2017, 4:51:09 PM (4 years ago)
Author:
alain
Message:

Fix bugs in exec

File:
1 edited

Legend:

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

    r408 r409  
    2525#include <hal_types.h>
    2626#include <hal_uspace.h>
     27#include <hal_irqmask.h>
    2728#include <hal_special.h>
    2829#include <errno.h>
     
    3536// TODO: concurrent user page(s) munmap need to be handled [AG]
    3637
    37 // instrumentation
     38// TODO : remove these debug variables
    3839extern uint32_t enter_sys_read;
    3940extern uint32_t enter_devfs_move;
     
    6263    uint32_t     nbytes;      // number of bytes actually read
    6364    reg_t        save_sr;     // required to enable IRQs during syscall
    64         uint32_t     tm_start;
    65         uint32_t     tm_end;
    66 
    67         tm_start = hal_get_cycles();
    68 
    69 #if CONFIG_READ_START
     65
     66#if CONFIG_SYSCALL_DEBUG
     67uint32_t     tm_start;
     68uint32_t     tm_end;
     69tm_start = hal_get_cycles();
     70#endif
     71
     72#if CONFIG_READ_DEBUG
    7073enter_sys_read = tm_start;
    7174#endif
     
    159162    hal_fence();
    160163
    161     tm_end = hal_get_cycles();
     164#if CONFIG_SYSCALL_DEBUG
     165tm_end = hal_get_cycles();
     166syscall_dmsg("\n[DBG] %s exit : core[%x,%d] / thread %x in process %x / cycle %d\n"
     167"nbytes = %d / first byte = %c / file_id = %d / cost = %d\n",
     168__FUNCTION__ , local_cxy , this->core->lid , this->trdid , this->process->pid ,
     169tm_start , nbytes , *((char *)(intptr_t)paddr) , file_id , tm_end - tm_start );
     170#endif
    162171
    163172#if CONFIG_READ_DEBUG
    164173exit_sys_read = tm_end;
    165174
    166 printk("\n@@@@@@@@@@@@ timing ro read character %c\n"
     175printk("\n@@@@@@@@@@@@ timing to read character %c\n"
    167176" - enter_sys_read     = %d / delta %d\n"
    168177" - enter_devfs_move   = %d / delta %d\n"
     
    195204exit_sys_read      , exit_sys_read      - exit_devfs_move    );
    196205#endif
    197 
    198 syscall_dmsg("\n[DBG] %s : core[%x,%d] / thread %x in process %x / cycle %d\n"
    199 "nbytes = %d / first byte = %c / file_id = %d / cost = %d\n",
    200 __FUNCTION__ , local_cxy , this->core->lid , this->trdid , this->process->pid ,
    201 tm_start , nbytes , *((char *)(intptr_t)paddr) , file_id , tm_end - tm_start );
    202206 
    203207        return nbytes;
Note: See TracChangeset for help on using the changeset viewer.