Ignore:
Timestamp:
Nov 1, 2018, 12:13:45 PM (4 years ago)
Author:
alain
Message:

Introduce sys_place_fork() function.

File:
1 edited

Legend:

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

    r566 r584  
    7272#if DEBUG_SYS_READ
    7373if( DEBUG_SYS_READ < tm_start )
    74 printk("\n[DBG] %s : thread %x in process %x enter / vaddr %x / count %d / cycle %d\n",
    75 __FUNCTION__, this->trdid, process->pid, vaddr, count, (uint32_t)tm_start );
     74printk("\n[DBG] %s : thread[%x,%x] enter / vaddr %x / count %d / cycle %d\n",
     75__FUNCTION__, process->pid, this->trdid, vaddr, count, (uint32_t)tm_start );
    7676#endif
    7777
     
    8585
    8686#if DEBUG_SYSCALLS_ERROR
    87 printk("\n[ERROR] in %s : illegal file descriptor index = %d\n", __FUNCTION__ , file_id );
     87printk("\n[ERROR] in %s : thread[%x,%x] illegal file descriptor index = %d\n",
     88__FUNCTION__ , process->pid, this->trdid, file_id );
    8889#endif
    8990                this->errno = EBADFD;
     
    9899
    99100#if DEBUG_SYSCALLS_ERROR
    100 printk("\n[ERROR] in %s : user buffer unmapped %x / thread %x / process %x\n",
    101 __FUNCTION__ , (intptr_t)vaddr, this->trdid, process->pid );
     101printk("\n[ERROR] in %s : thread[%x,%x] user buffer unmapped %x\n",
     102__FUNCTION__ , process->pid, this->trdid, (intptr_t)vaddr );
    102103vmm_display( process , false );
    103104#endif
     
    116117
    117118#if DEBUG_SYSCALLS_ERROR
    118 printk("\n[ERROR] in %s : undefined fd_id %d in process %x\n",
    119 __FUNCTION__ , file_id , process->pid );
     119printk("\n[ERROR] in %s : thread[%x,%x] undefined fd_id %d\n",
     120__FUNCTION__, process->pid, this->trdid, file_id );
    120121#endif
    121122        this->errno = EBADFD;
     
    127128    cxy_t        file_cxy = GET_CXY( file_xp );
    128129
    129     // check file readable
    130     uint32_t attr = hal_remote_l32( XPTR( file_cxy , &file_ptr->attr ) );
    131     if( (attr & FD_ATTR_READ_ENABLE) == 0 )
    132         {
    133 
    134 #if DEBUG_SYSCALLS_ERROR
    135 printk("\n[ERROR] in %s : file %d not readable in process %x\n",
    136 __FUNCTION__ , file_id , process->pid );
    137 #endif
    138                 this->errno = EBADFD;
    139                 return -1;
    140         }
    141    
    142130    // get file type
    143131    vfs_inode_type_t type = hal_remote_l32( XPTR( file_cxy , &file_ptr->type ) );
     
    153141
    154142#if DEBUG_SYSCALLS_ERROR
    155 printk("\n[ERROR] in %s : file %d not readable in process %x\n",
    156 __FUNCTION__ , file_id , process->pid );
     143printk("\n[ERROR] in %s : thread[%x,%x] file %d not readable\n",
     144__FUNCTION__, process->pid, this->trdid, file_id );
    157145#endif
    158146                    this->errno = EBADFD;
     
    185173            {
    186174                if( (iter & 0xFFF) == 0 )
    187                 printk("\n[WARNING] in %s : thread %x in process %x wait TXT_RX / cycle %d\n",
    188                 __FUNCTION__, this->trdid, process->pid, (uint32_t)hal_get_cycles() );
     175                printk("\n[WARNING] in %s : thread[%x,%x] wait TXT_RX / cycle %d\n",
     176                __FUNCTION__, process->pid, this->trdid, (uint32_t)hal_get_cycles() );
    189177
    190178                // deschedule without blocking
     
    216204
    217205#if DEBUG_SYSCALLS_ERROR
    218 printk("\n[ERROR] in %s cannot read data from file %d in process %x\n",
    219 __FUNCTION__ , file_id , process->pid );
     206printk("\n[ERROR] in %s : thread[%x,‰x] cannot read data from file %d\n",
     207__FUNCTION__, process->pid, this->trdid, file_id );
    220208#endif
    221209        this->errno = error;
     
    234222#if DEBUG_SYS_READ
    235223if( DEBUG_SYS_READ < tm_end )
    236 printk("\n[DBG] %s : thread %x in process %x exit / cycle %d\n",
    237 __FUNCTION__ , this->trdid, process->pid, (uint32_t)tm_end );
     224printk("\n[DBG] %s : thread[%x,%x] exit / cycle %d\n",
     225__FUNCTION__ , process->pid, this->trdid, (uint32_t)tm_end );
    238226#endif
    239227
Note: See TracChangeset for help on using the changeset viewer.