Changeset 441 for trunk/kernel/syscalls
- Timestamp:
- May 9, 2018, 3:13:56 PM (7 years ago)
- Location:
- trunk/kernel/syscalls
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/syscalls/sys_exec.c
r438 r441 150 150 // Implementation note: 151 151 // This function must be called by the main thread (thread 0 in owner cluster). 152 // I Tbuild an exec_info_t structure containing all informations152 // It build an exec_info_t structure containing all informations 153 153 // required to initialize the new process descriptor and the associated thread. 154 154 // It includes the process main() arguments, the environment variables, … … 208 208 tm_start = hal_get_cycles(); 209 209 if( DEBUG_SYS_EXEC < tm_start ) 210 printk("\n[DBG] %s : thread %x enter / process %x / path %s/ cycle = %d\n",210 printk("\n[DBG] %s : thread %x in process %x enter for path <%s> / cycle = %d\n", 211 211 __FUNCTION__, this, pid, exec_info.path, (uint32_t)tm_start ); 212 212 #endif … … 219 219 220 220 #if DEBUG_SYSCALLS_ERROR 221 printk("\n[ERROR] in %s : cannot access args\n", __FUNCTION__ ); 221 printk("\n[ERROR] in %s : thread %x in process %x cannot access args\n", 222 __FUNCTION__ , this, pid ); 222 223 #endif 223 224 this->errno = EINVAL; … … 233 234 234 235 #if DEBUG_SYCALLS_ERROR 235 printk("\n[ERROR] in %s : cannot access envs\n", __FUNCTION__ ); 236 printk("\n[ERROR] in %s : thread %x in process %x cannot access envs\n", 237 __FUNCTION__ , this, pid ); 236 238 #endif 237 239 this->errno = EINVAL; … … 247 249 248 250 #if DEBUG_SYSCALLS_ERROR 249 printk("\n[ERROR] in %s : cannot create process %x in cluster %x\n",250 __FUNCTION__, pid, CXY_FROM_PID(pid));251 printk("\n[ERROR] in %s : thread %x in process %x cannot create process for <%s>\n", 252 __FUNCTION__, this, pid, exec_info.path ); 251 253 #endif 252 254 this->errno = error; … … 257 259 tm_end = hal_get_cycles(); 258 260 if( DEBUG_SYS_EXEC < tm_end ) 259 printk("\n[DBG] %s : thread %x exit / process %x/ cost = %d / cycle %d\n",261 printk("\n[DBG] %s : thread %x in process %x exit / cost = %d / cycle %d\n", 260 262 __FUNCTION__, this, pid, (uint32_t)(tm_end - tm_start), (uint32_t)tm_end ); 261 263 #endif 262 264 263 // deschedule <=> old thread suicide because the BLOCKED_GLOBAL 264 // and the FLAG_REQ_DELETE have been set by process_make_exec() 265 // In case of success, this calling thread deschedules, causing suicide, 266 // because a new process descriptor and its associated main thread 267 // have been created by the process_make_exec() function, and the 268 // BLOCKED_GLOBAL & FLAG_REQ_DELETE bits have been set for the calling thread. 265 269 sched_yield( "old process suicide in sys_exec()" ); 266 270 267 assert( false , __FUNCTION__ , "This code should not be executed\n" );268 269 271 return 0; 270 272 -
trunk/kernel/syscalls/sys_exit.c
r440 r441 51 51 #endif 52 52 53 // get owner process descriptor pointers an cluster53 // get owner process descriptor pointers and cluster 54 54 xptr_t owner_xp = cluster_get_owner_process_from_pid( pid ); 55 55 cxy_t owner_cxy = GET_CXY( owner_xp ); … … 128 128 sched_yield( "process exit" ); 129 129 130 // this code should never be executed131 assert( false , __FUNCTION__ , "this code should not be executed...\n" );132 130 return 0; 133 131 -
trunk/kernel/syscalls/sys_read.c
r440 r441 223 223 if( DEBUG_SYS_READ < tm_end ) 224 224 printk("\n[DBG] %s : thread %x exit / process %x / cycle %d\n" 225 "nbytes = %d / fi rst byte = %c / file_id = %d / cost = %d\n",225 "nbytes = %d / file_id = %d / cost = %d\n", 226 226 __FUNCTION__ , this, process->pid, 227 (uint32_t)tm_start , nbytes , *((char *)(intptr_t)paddr) , file_id , 228 (uint32_t)(tm_end - tm_start) ); 227 (uint32_t)tm_start , nbytes , file_id , (uint32_t)(tm_end - tm_start) ); 229 228 #endif 230 229 … … 232 231 exit_sys_read = (uint32_t)tm_end; 233 232 234 printk("\n@@@@@@@@@@@@ timing to read character %c\n"233 printk("\n@@@@@@@@@@@@ timing to read character\n" 235 234 " - enter_sys_read = %d / delta %d\n" 236 235 " - enter_devfs_read = %d / delta %d\n" … … 247 246 " - exit_devfs_read = %d / delta %d\n" 248 247 " - exit_sys_read = %d / delta %d\n", 249 *((char *)(intptr_t)paddr) ,250 248 enter_sys_read , 0 , 251 249 enter_devfs_read , enter_devfs_read - enter_sys_read , -
trunk/kernel/syscalls/sys_write.c
r440 r441 184 184 if( DEBUG_SYS_WRITE < tm_end ) 185 185 printk("\n[DBG] %s : thread %x exit / process %x / cycle %d\n" 186 "nbytes = %d / fi rst byte = %c / file_id = %d / cost = %d\n",186 "nbytes = %d / file_id = %d / cost = %d\n", 187 187 __FUNCTION__, this, process->pid, (uint32_t)tm_start, 188 nbytes, *((char *)(intptr_t)paddr) ,file_id , (uint32_t)(tm_end - tm_start) );188 nbytes, file_id , (uint32_t)(tm_end - tm_start) ); 189 189 #endif 190 190 … … 192 192 exit_sys_write = (uint32_t)tm_end; 193 193 194 printk("\n@@@@@@@@@@@@ timing to write string %c\n"194 printk("\n@@@@@@@@@@@@ timing to write\n" 195 195 " - enter_sys_write = %d / delta %d\n" 196 196 " - enter_devfs_write = %d / delta %d\n" … … 207 207 " - exit_devfs_write = %d / delta %d\n" 208 208 " - exit_sys_write = %d / delta %d\n", 209 *((char *)(intptr_t)paddr) ,210 209 enter_sys_write , 0 , 211 210 enter_devfs_write , enter_devfs_write - enter_sys_write ,
Note: See TracChangeset
for help on using the changeset viewer.