Changeset 584 for trunk/kernel/syscalls/sys_read.c
- Timestamp:
- Nov 1, 2018, 12:13:45 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/syscalls/sys_read.c
r566 r584 72 72 #if DEBUG_SYS_READ 73 73 if( DEBUG_SYS_READ < tm_start ) 74 printk("\n[DBG] %s : thread %x in process %xenter / vaddr %x / count %d / cycle %d\n",75 __FUNCTION__, this->trdid, process->pid, vaddr, count, (uint32_t)tm_start );74 printk("\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 ); 76 76 #endif 77 77 … … 85 85 86 86 #if DEBUG_SYSCALLS_ERROR 87 printk("\n[ERROR] in %s : illegal file descriptor index = %d\n", __FUNCTION__ , file_id ); 87 printk("\n[ERROR] in %s : thread[%x,%x] illegal file descriptor index = %d\n", 88 __FUNCTION__ , process->pid, this->trdid, file_id ); 88 89 #endif 89 90 this->errno = EBADFD; … … 98 99 99 100 #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);101 printk("\n[ERROR] in %s : thread[%x,%x] user buffer unmapped %x\n", 102 __FUNCTION__ , process->pid, this->trdid, (intptr_t)vaddr ); 102 103 vmm_display( process , false ); 103 104 #endif … … 116 117 117 118 #if DEBUG_SYSCALLS_ERROR 118 printk("\n[ERROR] in %s : undefined fd_id %d in process %x\n",119 __FUNCTION__ , file_id , process->pid );119 printk("\n[ERROR] in %s : thread[%x,%x] undefined fd_id %d\n", 120 __FUNCTION__, process->pid, this->trdid, file_id ); 120 121 #endif 121 122 this->errno = EBADFD; … … 127 128 cxy_t file_cxy = GET_CXY( file_xp ); 128 129 129 // check file readable130 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_ERROR135 printk("\n[ERROR] in %s : file %d not readable in process %x\n",136 __FUNCTION__ , file_id , process->pid );137 #endif138 this->errno = EBADFD;139 return -1;140 }141 142 130 // get file type 143 131 vfs_inode_type_t type = hal_remote_l32( XPTR( file_cxy , &file_ptr->type ) ); … … 153 141 154 142 #if DEBUG_SYSCALLS_ERROR 155 printk("\n[ERROR] in %s : file %d not readable in process %x\n",156 __FUNCTION__ , file_id , process->pid );143 printk("\n[ERROR] in %s : thread[%x,%x] file %d not readable\n", 144 __FUNCTION__, process->pid, this->trdid, file_id ); 157 145 #endif 158 146 this->errno = EBADFD; … … 185 173 { 186 174 if( (iter & 0xFFF) == 0 ) 187 printk("\n[WARNING] in %s : thread %x in process %xwait 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() ); 189 177 190 178 // deschedule without blocking … … 216 204 217 205 #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 );206 printk("\n[ERROR] in %s : thread[%x,‰x] cannot read data from file %d\n", 207 __FUNCTION__, process->pid, this->trdid, file_id ); 220 208 #endif 221 209 this->errno = error; … … 234 222 #if DEBUG_SYS_READ 235 223 if( DEBUG_SYS_READ < tm_end ) 236 printk("\n[DBG] %s : thread %x in process %xexit / cycle %d\n",237 __FUNCTION__ , this->trdid, process->pid, (uint32_t)tm_end );224 printk("\n[DBG] %s : thread[%x,%x] exit / cycle %d\n", 225 __FUNCTION__ , process->pid, this->trdid, (uint32_t)tm_end ); 238 226 #endif 239 227
Note: See TracChangeset
for help on using the changeset viewer.