Changeset 443 for trunk/kernel/syscalls/sys_write.c
- Timestamp:
- May 16, 2018, 4:15:22 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/syscalls/sys_write.c
r441 r443 103 103 } 104 104 105 // enable IRQs106 hal_enable_irq( &save_sr );107 108 105 // get extended pointer on remote file descriptor 109 106 file_xp = process_fd_get_xptr( process , file_id ); … … 128 125 vfs_inode_type_t type = hal_remote_lw( XPTR( file_cxy , &file_ptr->type ) ); 129 126 130 // action depend on file type 127 // enable IRQs 128 hal_enable_irq( &save_sr ); 129 130 // action depend on file type 131 131 if( type == INODE_TYPE_FILE ) // check file writable & write to mapper 132 132 { … … 152 152 else if( type == INODE_TYPE_DEV ) // check ownership & write to device 153 153 { 154 // check user buffer size for TXT_TX 155 if( (type == INODE_TYPE_DEV) && (count >= CONFIG_TXT_KBUF_SIZE) ) 156 { 157 158 #if DEBUG_SYSCALLS_ERROR 159 printk("\n[ERROR] in %s : user buffer size %x too large / thread %x / process %x\n", 160 __FUNCTION__ , count, this->trdid, process->pid ); 161 #endif 162 this->errno = EINVAL; 163 return -1; 164 } 165 154 166 // move count bytes to device 155 167 nbytes = devfs_user_move( false, // from buffer to device … … 158 170 count ); 159 171 } 160 else 172 else // not FILE and not DEV 161 173 { 162 174 nbytes = 0; … … 192 204 exit_sys_write = (uint32_t)tm_end; 193 205 194 printk("\n @@@@@@@@@@@@ timing to write\n"206 printk("\n***** timing to write a string *****\n" 195 207 " - enter_sys_write = %d / delta %d\n" 196 208 " - enter_devfs_write = %d / delta %d\n"
Note: See TracChangeset
for help on using the changeset viewer.