Changeset 418 for trunk/kernel/syscalls


Ignore:
Timestamp:
Jan 8, 2018, 2:25:39 PM (7 years ago)
Author:
alain
Message:

Fix a bug in hal_kentry.S : the "uzone" pointer in the thread descriptor
must not be modified in case of interrupt.

Location:
trunk/kernel/syscalls
Files:
3 edited

Legend:

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

    r410 r418  
    4747        if( error )
    4848        {
    49         printk("\n[USER DBG] thread %x / process %x/ core[%x,%d] / cycle %d\n"
     49        printk("\n[USER PANIC] thread %x / process %x/ core[%x,%d] / cycle %d\n"
    5050        "cause unknown, because string not in user space\n",
    5151        this->trdid , process->pid , local_cxy , core->lid ,
     
    5656    if( hal_strlen_from_uspace( string ) >= 256 )
    5757        {
    58         printk("\n[USER DBG] thread %x / process %x/ core[%x,%d] / cycle %d\n"
     58        printk("\n[USER PANIC] thread %x / process %x/ core[%x,%d] / cycle %d\n"
    5959        "cause unknown, because string larger than 256 characters\n",
    6060        this->trdid , process->pid , local_cxy , core->lid ,
     
    6666
    6767    // print user debug message on kernel terminal
    68     printk("\n[USER DBG] thread %x / process %x / core[%x,%d] / cycle %d\n %s\n",
     68    printk("\n[USER PANIC] thread %x / process %x / core[%x,%d] / cycle %d\n %s\n",
    6969    this->trdid , process->pid , local_cxy, core->lid ,
    7070    (uint32_t)hal_get_cycles() , kbuf );
     
    7272        return 0;
    7373
    74 }  // end sys_get_cycle()
     74}  // end sys_panic()
  • trunk/kernel/syscalls/sys_read.c

    r416 r418  
    6464    reg_t        save_sr;     // required to enable IRQs during syscall
    6565
    66 #if CONFIG_SYSCALL_DEBUG
    67 uint32_t     tm_start;
    68 uint32_t     tm_end;
     66#if CONFIG_READ_DEBUG
     67uint64_t     tm_start;
     68uint64_t     tm_end;
    6969tm_start = hal_get_cycles();
    7070#endif
    7171
    7272#if CONFIG_READ_DEBUG
    73 enter_sys_read = tm_start;
     73enter_sys_read = (uint32_t)tm_start;
    7474#endif
    7575
     
    9898
    9999    // enable IRQs
    100     hal_enable_irq( &save_sr );
     100    // hal_enable_irq( &save_sr );
    101101
    102102    // get extended pointer on remote file descriptor
     
    158158
    159159    // restore IRQs
    160     hal_restore_irq( save_sr );
     160    // hal_restore_irq( save_sr );
    161161
    162162    hal_fence();
    163163
    164 #if CONFIG_SYSCALL_DEBUG
     164#if CONFIG_READ_DEBUG
    165165tm_end = hal_get_cycles();
    166166printk("\n[DBG] %s : core[%x,%d] / thread %x in process %x / cycle %d\n"
     
    171171#endif
    172172
    173 #if CONFIG_READ_DEBUG
    174 exit_sys_read = tm_end;
     173#if CONFIG_READ_DEBUG 
     174exit_sys_read = (uint32_t)tm_end;
    175175
    176176printk("\n@@@@@@@@@@@@ timing to read character %c\n"
  • trunk/kernel/syscalls/sys_write.c

    r416 r418  
    4646    reg_t        save_sr;         // required to enable IRQs during syscall
    4747
    48 #if CONFIG_SYSCALL_DEBUG
     48#if CONFIG_WRITE_DEBUG
    4949uint32_t     tm_start;
    5050uint32_t     tm_end;
     
    139139    hal_fence();
    140140
    141 #if CONFIG_SYSCALL_DEBUG
     141#if CONFIG_WRITE_DEBUG
    142142tm_end = hal_get_cycles();
    143143printk("\n[DBG] %s : core[%x,%d] / thread %x in process %x / cycle %d\n"
     
    148148#endif
    149149 
     150#if CONFIG_WRITE_DEBUG
     151printk("\n@@@@@@@@@@@@ timing to write character %c\n"
     152" - enter_sys_write    = %d\n"
     153" - exit_sys_write     = %d\n",
     154*((char *)(intptr_t)paddr) , (uint32_t)tm_start , (uint32_t)tm_end );
     155#endif
     156
    150157        return nbytes;
    151158
Note: See TracChangeset for help on using the changeset viewer.