Changeset 459 for trunk/kernel/syscalls
- Timestamp:
- Aug 13, 2018, 1:43:20 PM (6 years ago)
- Location:
- trunk/kernel/syscalls
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/syscalls/shared_include/shared_fcntl.h
r445 r459 1 1 /* 2 * upashared_fcntl.h - Shared structures used by file related syscalls.2 * shared_fcntl.h - Shared structures used by file related syscalls. 3 3 * 4 4 * Author Alain Greiner (2016,2017,2018) … … 33 33 O_RDONLY = 0x0010000, /*! open file in read-only mode */ 34 34 O_WRONLY = 0x0020000, /*! open file in write-only mode */ 35 O_RDWR = 0x00 30000, /*! open file in read/write mode */35 O_RDWR = 0x0000000, /*! open file in read/write mode */ 36 36 O_NONBLOCK = 0x0040000, /*! do not block if data non available */ 37 37 O_APPEND = 0x0080000, /*! append on each write */ -
trunk/kernel/syscalls/sys_close.c
r457 r459 39 39 process_t * process = this->process; 40 40 41 #if DEBUG_SYS_CLOSE 42 uint32_t tm_start; 43 uint32_t tm_end; 44 tm_start = hal_get_cycles(); 45 if( DEBUG_SYS_CLOSE < tm_start ) 46 printk("\n[DBG] %s : thread %x in process %x enter / fdid %d / cycle %d\n", 47 __FUNCTION__, this->trdid, process->pid, file_id, (uint32_t)tm_start ); 48 #endif 49 41 50 // check file_id argument 42 51 if( file_id >= CONFIG_PROCESS_FILE_MAX_NR ) … … 72 81 hal_fence(); 73 82 83 #if DEBUG_SYS_CLOSE 84 tm_end = hal_get_cycles(); 85 if( DEBUG_SYS_CLOSE < tm_start ) 86 printk("\n[DBG] %s : thread %x in process %x exit / cost %d / cycle %d\n", 87 __FUNCTION__, this->trdid, process->pid, (uint32_t)(tm_end - tm_start), (uint32_t)tm_start ); 88 #endif 89 74 90 return 0; 75 91 } -
trunk/kernel/syscalls/sys_open.c
r457 r459 46 46 process_t * process = this->process; 47 47 48 #if DEBUG_SYS_OPEN 49 uint32_t tm_start; 50 uint32_t tm_end; 51 tm_start = hal_get_cycles(); 52 #endif 53 48 54 // check fd_array not full 49 55 if( process_fd_array_full() ) … … 66 72 hal_strcpy_from_uspace( kbuf , pathname , CONFIG_VFS_MAX_PATH_LENGTH ); 67 73 74 #if DEBUG_SYS_OPEN 75 if( DEBUG_SYS_OPEN < tm_start ) 76 printk("\n[DBG] %s : thread %x in process %x enter / path %s / flags %x / cycle %d\n", 77 __FUNCTION__, this->trdid, process->pid, kbuf, flags, (uint32_t)tm_start ); 78 #endif 79 68 80 // get cluster and local pointer on reference process 69 81 xptr_t ref_xp = process->ref_xp; … … 87 99 if( error ) 88 100 { 89 printk("\n[ERROR] in %s : cannot create file descriptor\n", __FUNCTION__ ); 101 printk("\n[ERROR] in %s : cannot create file descriptor for %s\n", 102 __FUNCTION__ , kbuf ); 90 103 this->errno = ENFILE; 91 104 return -1; … … 97 110 remote_spinlock_unlock( XPTR( local_cxy , &process->fd_array.lock ) ); 98 111 112 hal_fence(); 113 114 #if DEBUG_SYS_OPEN 115 tm_end = hal_get_cycles(); 116 if( DEBUG_SYS_OPEN < tm_start ) 117 printk("\n[DBG] %s : thread %x in process %x exit / cost %d / cycle %d\n", 118 __FUNCTION__, this->trdid, process->pid, (uint32_t)(tm_end - tm_start), (uint32_t)tm_start ); 119 #endif 120 99 121 return file_id; 100 122 } -
trunk/kernel/syscalls/sys_read.c
r457 r459 72 72 tm_start = hal_get_cycles(); 73 73 if( DEBUG_SYS_READ < tm_start ) 74 printk("\n[DBG] %s : thread %x enter / process %x / vaddr =%x / count %d / cycle %d\n",75 __FUNCTION__, this , process->pid, vaddr, count, (uint32_t)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 ); 76 76 #endif 77 77 … … 231 231 tm_end = hal_get_cycles(); 232 232 if( DEBUG_SYS_READ < tm_end ) 233 printk("\n[DBG] %s : thread %x exit / process %x/ cycle %d\n"234 "nbytes = %d / file_id = %d / cost =%d\n",235 __FUNCTION__ , this , process->pid,233 printk("\n[DBG] %s : thread %x in process %x exit / cycle %d\n" 234 "nbytes %d / file_id %d / cost %d\n", 235 __FUNCTION__ , this->trdid, process->pid, 236 236 (uint32_t)tm_start , nbytes , file_id , (uint32_t)(tm_end - tm_start) ); 237 237 #endif -
trunk/kernel/syscalls/sys_write.c
r457 r459 73 73 tm_start = hal_get_cycles(); 74 74 if( DEBUG_SYS_WRITE < tm_start ) 75 printk("\n[DBG] %s : thread %x enter / process %x/ vaddr %x / count %d / cycle %d\n",76 __FUNCTION__, this , process->pid, vaddr, count, (uint32_t)tm_start );75 printk("\n[DBG] %s : thread %x in process %x enter / vaddr %x / count %d / cycle %d\n", 76 __FUNCTION__, this->trdid, process->pid, vaddr, count, (uint32_t)tm_start ); 77 77 #endif 78 78 … … 195 195 tm_end = hal_get_cycles(); 196 196 if( DEBUG_SYS_WRITE < tm_end ) 197 printk("\n[DBG] %s : thread %x exit / process %x/ cycle %d\n"198 "nbytes = %d / file_id = %d / cost =%d\n",199 __FUNCTION__, this , process->pid, (uint32_t)tm_start,197 printk("\n[DBG] %s : thread %x in process %x exit / cycle %d\n" 198 "nbytes %d / file_id %d / cost %d\n", 199 __FUNCTION__, this->trdid, process->pid, (uint32_t)tm_start, 200 200 nbytes, file_id , (uint32_t)(tm_end - tm_start) ); 201 201 #endif
Note: See TracChangeset
for help on using the changeset viewer.