Ignore:
Timestamp:
Feb 20, 2018, 5:32:17 PM (4 years ago)
Author:
alain
Message:

Fix a bad bug in scheduler...

File:
1 edited

Legend:

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

    r433 r435  
    4141{
    4242    error_t      error;
    43     paddr_t      paddr;           // unused, but required for user space checking
     43    paddr_t      paddr;           // required for user space checking
    4444        xptr_t       file_xp;         // remote file extended pointer
    4545    uint32_t     nbytes;          // number of bytes actually written
    4646    reg_t        save_sr;         // required to enable IRQs during syscall
     47
     48#if (CONFIG_DEBUG_SYS_WRITE_DEBUG & 1)
     49enter_sys_read = (uint32_t)tm_start;
     50#endif
    4751
    4852        thread_t   * this = CURRENT_THREAD;
     
    5458tm_start = hal_get_cycles();
    5559if( CONFIG_DEBUG_SYS_WRITE < tm_start )
    56 printk("\n[DBG] %s : thread %x / process %x / vaddr %x / count %d / cycle %d\n",
     60printk("\n[DBG] %s : thread %x enter / process %x / vaddr %x / count %d / cycle %d\n",
    5761__FUNCTION__, this, process->pid, vaddr, count, (uint32_t)tm_start );
    5862#endif
     
    162166tm_end = hal_get_cycles();
    163167if( CONFIG_DEBUG_SYS_WRITE < tm_end )
    164 printk("\n[DBG] %s : thread %x in process %x / cycle %d\n"
     168printk("\n[DBG] %s : thread %x exit / process %x / cycle %d\n"
    165169"nbytes = %d / first byte = %c / file_id = %d / cost = %d\n",
    166170__FUNCTION__, this, process->pid, (uint32_t)tm_start,
     
    168172#endif
    169173 
     174#if (CONFIG_DEBUG_SYS_WRITE & 1)
     175exit_sys_write = (uint32_t)tm_end;
     176
     177printk("\n@@@@@@@@@@@@ timing to write string %c\n"
     178" - enter_sys_write          = %d / delta %d\n"
     179" - enter_devfs_write        = %d / delta %d\n"
     180" - enter_txt_write          = %d / delta %d\n"
     181" - enter_chdev_cmd_write    = %d / delta %d\n"
     182" - enter_chdev_server_write = %d / delta %d\n"
     183" - enter_tty_cmd_write      = %d / delta %d\n"
     184" - enter_tty_isr_write      = %d / delta %d\n"
     185" - exit_tty_isr_write       = %d / delta %d\n"
     186" - exit_tty_cmd_write       = %d / delta %d\n"
     187" - exit_chdev_server_write  = %d / delta %d\n"
     188" - exit_chdev_cmd_write     = %d / delta %d\n"
     189" - exit_txt_write           = %d / delta %d\n"
     190" - exit_devfs_write         = %d / delta %d\n"
     191" - exit_sys_write           = %d / delta %d\n",
     192*((char *)(intptr_t)paddr) ,
     193enter_sys_write          , 0 ,
     194enter_devfs_write        , enter_devfs_write        - enter_sys_write          ,
     195enter_txt_write          , enter_txt_write          - enter_devfs_write        ,
     196enter_chdev_cmd_write    , enter_chdev_cmd_write    - enter_txt_write          ,
     197enter_chdev_server_write , enter_chdev_server_write - enter_chdev_cmd_write    ,
     198enter_tty_cmd_write      , enter_tty_cmd_write      - enter_chdev_server_write ,
     199enter_tty_isr_write      , enter_tty_isr_write      - enter_tty_cmd_write      ,
     200exit_tty_isr_write       , exit_tty_isr_write       - enter_tty_isr_write      ,
     201exit_tty_cmd_write       , exit_tty_cmd_write       - exit_tty_isr_write       ,
     202exit_chdev_server_write  , exit_chdev_server_write  - exit_tty_cmd_write       ,
     203exit_chdev_cmd_write     , exit_chdev_cmd_write     - exit_chdev_server_write  ,
     204exit_txt_write           , exit_txt_write           - exit_chdev_cmd_write     ,
     205exit_devfs_write         , exit_devfs_write         - exit_txt_write           ,
     206exit_sys_write           , exit_sys_write           - exit_devfs_write         );
     207#endif
     208 
    170209        return nbytes;
    171210
Note: See TracChangeset for help on using the changeset viewer.