Changeset 566 for trunk/kernel/syscalls/sys_read.c
- Timestamp:
- Oct 4, 2018, 11:50:21 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/syscalls/sys_read.c
r506 r566 34 34 #include <process.h> 35 35 36 #include <syscalls.h>37 38 // TODO: concurrent user page(s) munmap need to be handled [AG]39 36 40 37 extern uint32_t enter_sys_read; … … 69 66 xptr_t process_owner_xp = process->owner_xp; 70 67 68 #if (DEBUG_SYS_READ || CONFIG_INSTRUMENTATION_SYSCALLS) 69 uint64_t tm_start = hal_get_cycles(); 70 #endif 71 71 72 #if DEBUG_SYS_READ 72 uint64_t tm_start;73 uint64_t tm_end;74 tm_start = hal_get_cycles();75 73 if( DEBUG_SYS_READ < tm_start ) 76 74 printk("\n[DBG] %s : thread %x in process %x enter / vaddr %x / count %d / cycle %d\n", … … 130 128 131 129 // check file readable 132 uint32_t attr = hal_remote_l w( XPTR( file_cxy , &file_ptr->attr ) );130 uint32_t attr = hal_remote_l32( XPTR( file_cxy , &file_ptr->attr ) ); 133 131 if( (attr & FD_ATTR_READ_ENABLE) == 0 ) 134 132 { … … 143 141 144 142 // get file type 145 vfs_inode_type_t type = hal_remote_l w( XPTR( file_cxy , &file_ptr->type ) );143 vfs_inode_type_t type = hal_remote_l32( XPTR( file_cxy , &file_ptr->type ) ); 146 144 147 145 // action depend on file type … … 149 147 { 150 148 // check file readable 151 uint32_t attr = hal_remote_l w( XPTR( file_cxy , &file_ptr->attr ) );149 uint32_t attr = hal_remote_l32( XPTR( file_cxy , &file_ptr->attr ) ); 152 150 153 151 if( (attr & FD_ATTR_READ_ENABLE) == 0 ) … … 181 179 { 182 180 // extended pointer on TXT owner process 183 txt_owner_xp = hal_remote_l wd( XPTR( chdev_cxy , &chdev_ptr->ext.txt.owner_xp ) );181 txt_owner_xp = hal_remote_l64( XPTR( chdev_cxy , &chdev_ptr->ext.txt.owner_xp ) ); 184 182 185 183 // check TXT_RX ownership … … 230 228 hal_fence(); 231 229 230 #if (DEBUG_SYS_READ || CONFIG_INSTRUMENTATION_SYSCALLS) 231 uint64_t tm_end = hal_get_cycles(); 232 #endif 233 232 234 #if DEBUG_SYS_READ 233 tm_end = hal_get_cycles();234 235 if( DEBUG_SYS_READ < tm_end ) 235 printk("\n[DBG] %s : thread %x in process %x exit / cycle %d / cost %d\n", 236 __FUNCTION__ , this->trdid, process->pid, (uint32_t)tm_start, (uint32_t)(tm_end - tm_start) ); 236 printk("\n[DBG] %s : thread %x in process %x exit / cycle %d\n", 237 __FUNCTION__ , this->trdid, process->pid, (uint32_t)tm_end ); 238 #endif 239 240 #if CONFIG_INSTRUMENTATION_SYSCALLS 241 hal_atomic_add( &syscalls_cumul_cost[SYS_READ] , tm_end - tm_start ); 242 hal_atomic_add( &syscalls_occurences[SYS_READ] , 1 ); 237 243 #endif 238 244
Note: See TracChangeset
for help on using the changeset viewer.