Ignore:
Timestamp:
Dec 5, 2017, 4:20:07 PM (7 years ago)
Author:
alain
Message:

Fix several bugs in the fork() syscall.

File:
1 edited

Legend:

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

    r407 r408  
    4040{
    4141    error_t      error;
    42     paddr_t      paddr;                // unused, but required for user space checking
    43         xptr_t       file_xp;              // remote file extended pointer
    44     uint32_t     nbytes;               // number of bytes actually written
    45 
     42    paddr_t      paddr;           // unused, but required for user space checking
     43        xptr_t       file_xp;         // remote file extended pointer
     44    uint32_t     nbytes;          // number of bytes actually written
     45    reg_t        save_sr;         // required to enable IRQs during syscall
    4646        uint32_t     tm_start;
    4747        uint32_t     tm_end;
     
    7070                return -1;
    7171    }
     72
     73    // enable IRQs
     74    hal_enable_irq( &save_sr );
    7275
    7376    // get extended pointer on remote file descriptor
     
    128131    }
    129132
     133    // restore IRQs
     134    hal_restore_irq( save_sr );
     135
    130136    hal_fence();
    131137
    132138    tm_end = hal_get_cycles();
    133139
    134 syscall_dmsg("\n[DBG] %s : core[%x,%d] / thread %x / nbytes = %d / cycle %d\n"
    135 " first byte = %c / file_id = %d / cost = %d\n",
    136 __FUNCTION__ , local_cxy , this->core->lid , this->trdid , nbytes , tm_start ,
    137 *((char *)(intptr_t)paddr) , file_id , tm_end - tm_start );
     140syscall_dmsg("\n[DBG] %s : core[%x,%d] / thread %x in process %x / cycle %d\n"
     141"nbytes = %d / first byte = %c / file_id = %d / cost = %d\n",
     142__FUNCTION__ , local_cxy , this->core->lid , this->trdid , this->process->pid ,
     143tm_start , nbytes , *((char *)(intptr_t)paddr) , file_id , tm_end - tm_start );
    138144 
    139145        return nbytes;
Note: See TracChangeset for help on using the changeset viewer.