Changeset 438 for trunk/kernel/syscalls
- Timestamp:
- Apr 4, 2018, 2:49:02 PM (7 years ago)
- Location:
- trunk/kernel/syscalls
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/syscalls/sys_display.c
r436 r438 38 38 { 39 39 40 #if CONFIG_DEBUG_SYS_DISPLAY40 #if DEBUG_SYS_DISPLAY 41 41 uint64_t tm_start; 42 42 uint64_t tm_end; … … 44 44 this = CURRENT_THREAD; 45 45 tm_start = hal_get_cycles(); 46 if( CONFIG_DEBUG_SYS_DISPLAY < tm_start )46 if( DEBUG_SYS_DISPLAY < tm_start ) 47 47 printk("\n[DBG] %s : thread %d enter / process %x / type %d / cycle = %d\n", 48 48 __FUNCTION__, this, this->process->pid, type, (uint32_t)tm_start ); … … 183 183 } 184 184 185 #if CONFIG_DEBUG_SYS_DISPLAY185 #if DEBUG_SYS_DISPLAY 186 186 tm_end = hal_get_cycles(); 187 if( CONFIG_DEBUG_SYS_DISPLAY < tm_end )187 if( DEBUG_SYS_DISPLAY < tm_end ) 188 188 printk("\n[DBG] %s : thread %x exit / process %x / cost = %d / cycle %d\n", 189 189 __FUNCTION__, this, this->process->pid, (uint32_t)(tm_end - tm_start) , (uint32_t)tm_end ); -
trunk/kernel/syscalls/sys_exec.c
r435 r438 193 193 { 194 194 195 #if CONFIG_DEBUG_SYSCALLS_ERROR195 #if DEBUG_SYSCALLS_ERROR 196 196 printk("\n[ERROR] in %s : pathname too long\n", __FUNCTION__ ); 197 197 #endif … … 203 203 hal_strcpy_from_uspace( exec_info.path , pathname , CONFIG_VFS_MAX_PATH_LENGTH ); 204 204 205 #if CONFIG_DEBUG_SYS_EXEC205 #if DEBUG_SYS_EXEC 206 206 uint64_t tm_start; 207 207 uint64_t tm_end; 208 208 tm_start = hal_get_cycles(); 209 if( CONFIG_DEBUG_SYS_EXEC < tm_start )209 if( DEBUG_SYS_EXEC < tm_start ) 210 210 printk("\n[DBG] %s : thread %x enter / process %x / path %s / cycle = %d\n", 211 211 __FUNCTION__, this, pid, exec_info.path, (uint32_t)tm_start ); … … 218 218 { 219 219 220 #if CONFIG_DEBUG_SYSCALLS_ERROR220 #if DEBUG_SYSCALLS_ERROR 221 221 printk("\n[ERROR] in %s : cannot access args\n", __FUNCTION__ ); 222 222 #endif … … 232 232 { 233 233 234 #if CONFIG_DEBUG_SYCALLS_ERROR234 #if DEBUG_SYCALLS_ERROR 235 235 printk("\n[ERROR] in %s : cannot access envs\n", __FUNCTION__ ); 236 236 #endif … … 246 246 { 247 247 248 #if CONFIG_DEBUG_SYSCALLS_ERROR248 #if DEBUG_SYSCALLS_ERROR 249 249 printk("\n[ERROR] in %s : cannot create process %x in cluster %x\n", 250 250 __FUNCTION__, pid, CXY_FROM_PID(pid) ); … … 254 254 } 255 255 256 #if CONFIG_DEBUG_SYS_EXEC256 #if DEBUG_SYS_EXEC 257 257 tm_end = hal_get_cycles(); 258 if( CONFIG_DEBUG_SYS_EXEC < tm_end )258 if( DEBUG_SYS_EXEC < tm_end ) 259 259 printk("\n[DBG] %s : thread %x exit / process %x / cost = %d / cycle %d\n", 260 260 __FUNCTION__, this, pid, (uint32_t)(tm_end - tm_start), (uint32_t)tm_end ); -
trunk/kernel/syscalls/sys_exit.c
r436 r438 43 43 trdid_t trdid = this->trdid; 44 44 45 #if CONFIG_DEBUG_SYS_EXIT45 #if DEBUG_SYS_EXIT 46 46 uint64_t tm_start; 47 47 uint64_t tm_end; 48 48 tm_start = hal_get_cycles(); 49 if( CONFIG_DEBUG_SYS_EXIT < tm_start )49 if( DEBUG_SYS_EXIT < tm_start ) 50 50 printk("\n[DBG] %s : thread %x enter / process %x / status %x / cycle %d\n", 51 51 __FUNCTION__ , this, pid , status , (uint32_t)tm_start ); … … 59 59 { 60 60 61 #if CONFIG_DEBUG_SYSCALLS_ERROR61 #if DEBUG_SYSCALLS_ERROR 62 62 printk("\n[ERROR] in %s : calling thread %x is not thread 0 in owner cluster %x\n", 63 63 __FUNCTION__, trdid, owner_cxy ); … … 73 73 process->term_state = status; 74 74 75 #if( CONFIG_DEBUG_SYS_EXIT & 1)75 #if( DEBUG_SYS_EXIT & 1) 76 76 printk("\n[DBG] %s : set exit status in process term_state\n", __FUNCTION__); 77 77 #endif … … 80 80 process_txt_detach( XPTR( local_cxy , process ) ); 81 81 82 #if( CONFIG_DEBUG_SYS_EXIT & 1)82 #if( DEBUG_SYS_EXIT & 1) 83 83 printk("\n[DBG] %s : removed from TXT list\n", __FUNCTION__); 84 84 #endif … … 87 87 process_sigaction( pid , DELETE_ALL_THREADS ); 88 88 89 #if( CONFIG_DEBUG_SYS_EXIT & 1)89 #if( DEBUG_SYS_EXIT & 1) 90 90 printk("\n[DBG] %s : deleted all other threads than main\n", __FUNCTION__); 91 91 #endif … … 97 97 thread_block( XPTR( local_cxy , this ) , THREAD_BLOCKED_GLOBAL ); 98 98 99 #if( CONFIG_DEBUG_SYS_EXIT & 1)99 #if( DEBUG_SYS_EXIT & 1) 100 100 printk("\n[DBG] %s : blocked the main thread\n", __FUNCTION__); 101 101 #endif … … 106 106 PROCESS_TERM_EXIT ); 107 107 108 #if( CONFIG_DEBUG_SYS_EXIT & 1)108 #if( DEBUG_SYS_EXIT & 1) 109 109 printk("\n[DBG] %s : set EXIT flag in process term_state\n", __FUNCTION__); 110 110 #endif … … 112 112 hal_fence(); 113 113 114 #if CONFIG_DEBUG_SYS_EXIT114 #if DEBUG_SYS_EXIT 115 115 tm_end = hal_get_cycles(); 116 if( CONFIG_DEBUG_SYS_EXIT < tm_end )116 if( DEBUG_SYS_EXIT < tm_end ) 117 117 printk("\n[DBG] %s : thread %x exit / process %x / status %x / cost = %d / cycle %d\n", 118 118 __FUNCTION__, this, pid, status, (uint32_t)(tm_end - tm_start), (uint32_t)tm_end ); -
trunk/kernel/syscalls/sys_fg.c
r436 r438 45 45 thread_t * this = CURRENT_THREAD; 46 46 47 #if CONFIG_DEBUG_SYS_FG47 #if DEBUG_SYS_FG 48 48 uint64_t tm_start; 49 49 uint64_t tm_end; 50 50 tm_start = hal_get_cycles(); 51 if( CONFIG_DEBUG_SYS_FG < tm_start )51 if( DEBUG_SYS_FG < tm_start ) 52 52 printk("\n[DBG] %s : thread %x enter / process %x / cycle %d\n", 53 53 __FUNCTION__ , CURRENT_THREAD , pid, (uint32_t)tm_start ); … … 60 60 { 61 61 62 #if CONFIG_DEBUG_SYSCALLS_ERROR62 #if DEBUG_SYSCALLS_ERROR 63 63 printk("\n[ERROR] in %s : process %x not found\n", __FUNCTION__ , pid ); 64 64 #endif … … 83 83 hal_fence(); 84 84 85 #if CONFIG_DEBUG_SYS_FG85 #if DEBUG_SYS_FG 86 86 tm_end = hal_get_cycles(); 87 if( CONFIG_DEBUG_SYS_FG < tm_end )87 if( DEBUG_SYS_FG < tm_end ) 88 88 printk("\n[DBG] %s : thread %x exit / process %x get TXT_%d ownership / cycle %d\n", 89 89 __FUNCTION__ , CURRENT_THREAD , pid, -
trunk/kernel/syscalls/sys_fork.c
r435 r438 45 45 pid_t parent_pid; // parent process identifier 46 46 thread_t * parent_thread_ptr; // local pointer on local parent thread descriptor 47 cxy_t parent_cxy; // parent thread cluster 47 48 48 49 pid_t child_pid; // child process identifier 49 50 thread_t * child_thread_ptr; // local pointer on remote child thread descriptor 50 cxy_t target_cxy;// target cluster for forked child process51 cxy_t child_cxy; // target cluster for forked child process 51 52 52 53 xptr_t ref_process_xp; // extended pointer on reference parent process … … 62 63 parent_process_ptr = parent_thread_ptr->process; 63 64 parent_pid = parent_process_ptr->pid; 64 65 #if CONFIG_DEBUG_SYS_FORK 65 parent_cxy = local_cxy; 66 67 #if DEBUG_SYS_FORK 66 68 uint64_t tm_start; 67 69 uint64_t tm_end; 68 70 tm_start = hal_get_cycles(); 69 if( CONFIG_DEBUG_SYS_FORK < tm_start )70 printk("\n[DBG] %s : thread %x enter / parent%x / cycle = %d\n",71 if( DEBUG_SYS_FORK < tm_start ) 72 printk("\n[DBG] %s : parent_thread %x enter / parent_pid %x / cycle = %d\n", 71 73 __FUNCTION__, parent_thread_ptr, parent_pid, (uint32_t)tm_start ); 72 74 #endif 73 75 74 // get infos on reference p rocess76 // get infos on reference parent process 75 77 ref_process_xp = parent_process_ptr->ref_xp; 76 78 ref_process_cxy = GET_CXY( ref_process_xp ); … … 82 84 { 83 85 84 #if CONFIG_DEBUG_SYSCALLS_ERROR86 #if DEBUG_SYSCALLS_ERROR 85 87 printk("\n[ERROR] in %s : too much children processes\n", __FUNCTION__); 86 88 #endif … … 91 93 92 94 // Select target cluster for child process and main thread. 93 // If placement is not user-defined, the placement is defined by the DQDT.94 if( parent_thread_ptr->fork_user ) // user defined placement95 { 96 target_cxy = parent_thread_ptr->fork_cxy;95 // If placement is not user-defined, it is defined by the DQDT. 96 if( parent_thread_ptr->fork_user ) 97 { 98 child_cxy = parent_thread_ptr->fork_cxy; 97 99 parent_thread_ptr->fork_user = false; 98 100 } 99 101 else // DQDT placement 100 102 { 101 target_cxy = dqdt_get_cluster_for_process(); 102 } 103 child_cxy = dqdt_get_cluster_for_process(); 104 } 105 106 #if( DEBUG_SYS_FORK & 1) 107 108 // dqdt_display(); 109 110 if( local_cxy == 0 ) 111 { 112 sched_display( 0 ); 113 rpc_sched_display_client( 1 , 0 ); 114 } 115 else 116 { 117 sched_display( 0 ); 118 rpc_sched_display_client( 0 , 0 ); 119 } 120 121 if( DEBUG_SYS_FORK < tm_start ) 122 printk("\n[DBG] %s : parent_thread %x selected cluster %x\n", 123 __FUNCTION__, parent_thread_ptr, child_cxy ); 124 #endif 103 125 104 126 // call process_make_fork in target cluster 105 if( target_cxy == local_cxy )127 if( child_cxy == local_cxy ) 106 128 { 107 129 error = process_make_fork( ref_process_xp, … … 112 134 else 113 135 { 114 rpc_process_make_fork_client( target_cxy,136 rpc_process_make_fork_client( child_cxy, 115 137 ref_process_xp, 116 138 parent_thread_xp, … … 123 145 { 124 146 125 #if CONFIG_DEBUG_SYSCALLS_ERROR147 #if DEBUG_SYSCALLS_ERROR 126 148 printk("\n[ERROR] in %s : cannot fork process %x in cluster %x\n", 127 149 __FUNCTION__, parent_pid, local_cxy ); … … 135 157 if( CURRENT_THREAD->core->fpu_owner == parent_thread_ptr ) 136 158 { 137 hal_fpu_context_save( XPTR( target_cxy , child_thread_ptr ) ); 138 } 139 140 // set remote child CPU context from parent_thread register values 141 hal_cpu_context_fork( XPTR( target_cxy , child_thread_ptr ) ); 142 143 // From this point, both parent and child threads execute the following code. 144 // They can be distinguished by the CURRENT_THREAD value, and child will only 145 // execute it when it is unblocked by parent. 159 hal_fpu_context_save( XPTR( child_cxy , child_thread_ptr ) ); 160 } 161 162 // set remote child CPU context from parent_thread register values 163 hal_cpu_context_fork( XPTR( child_cxy , child_thread_ptr ) ); 164 165 // From this point, both parent and child threads execute the following code, 166 // but they can be distinguished by the (CURRENT_THREAD,local_cxy) values. 146 167 // - parent unblock child, and return child PID to user application. 147 168 // - child thread does nothing, and return 0 to user pplication 169 // The child thread will only execute it when it is unblocked by parent thread. 148 170 149 171 thread_t * current = CURRENT_THREAD; 150 172 151 if( current == parent_thread_ptr ) // current ==parent thread173 if( (current == parent_thread_ptr) && (local_cxy == parent_cxy) ) // parent thread 152 174 { 153 175 // parent_thread unblock child_thread 154 thread_unblock( XPTR( target_cxy , child_thread_ptr ) , THREAD_BLOCKED_GLOBAL );155 156 #if CONFIG_DEBUG_SYS_FORK176 thread_unblock( XPTR( child_cxy , child_thread_ptr ) , THREAD_BLOCKED_GLOBAL ); 177 178 #if DEBUG_SYS_FORK 157 179 tm_end = hal_get_cycles(); 158 if( CONFIG_DEBUG_SYS_FORK < tm_end )159 printk("\n[DBG] %s : parent_thread %x exit / cost = %d / cycle %d\n",160 __FUNCTION__ , parent_thread_ptr, (uint32_t)(tm_end - tm_start), (uint32_t)tm_end );180 if( DEBUG_SYS_FORK < tm_end ) 181 printk("\n[DBG] %s : parent_thread %x on cluster %x exit / cost = %d / cycle %d\n", 182 __FUNCTION__, parent_thread_ptr, parent_cxy, (uint32_t)(tm_end - tm_start), (uint32_t)tm_end ); 161 183 #endif 162 184 163 185 return child_pid; 164 186 } 165 else // current ==child_thread166 { 167 168 #if CONFIG_DEBUG_SYS_FORK187 else // child_thread 188 { 189 190 #if DEBUG_SYS_FORK 169 191 tm_end = hal_get_cycles(); 170 if( CONFIG_DEBUG_SYS_FORK < tm_end )171 printk("\n[DBG] %s : child_thread %x exit / cost = %d / cycle %d\n",172 __FUNCTION__ , child_thread_ptr, (uint32_t)(tm_end - tm_start), (uint32_t)tm_end );192 if( DEBUG_SYS_FORK < tm_end ) 193 printk("\n[DBG] %s : child_thread %x on cluster %x exit / cost = %d / cycle %d\n", 194 __FUNCTION__, child_thread_ptr, child_cxy, (uint32_t)(tm_end - tm_start), (uint32_t)tm_end ); 173 195 #endif 174 196 -
trunk/kernel/syscalls/sys_get_config.c
r436 r438 47 47 process_t * process = this->process; 48 48 49 #if CONFIG_DEBUG_SYS_GET_CONFIG49 #if DEBUG_SYS_GET_CONFIG 50 50 uint64_t tm_start; 51 51 uint64_t tm_end; 52 52 tm_start = hal_get_cycles(); 53 if( CONFIG_DEBUG_SYS_GET_CONFIG < tm_start )53 if( DEBUG_SYS_GET_CONFIG < tm_start ) 54 54 printk("\n[DBG] %s : thread %x enter / process %x / cycle %d\n", 55 55 __FUNCTION__, this, process->pid, (uint32_t)tm_start ); … … 64 64 { 65 65 66 #if CONFIG_DEBUG_SYSCALLS_ERROR66 #if DEBUG_SYSCALLS_ERROR 67 67 printk("\n[ERROR] in %s : user buffer unmapped for thread %x in process %x\n", 68 68 __FUNCTION__ , this->trdid , process->pid ); … … 84 84 hal_fence(); 85 85 86 #if CONFIG_DEBUG_SYS_GET_CONFIG86 #if DEBUG_SYS_GET_CONFIG 87 87 tm_end = hal_get_cycles(); 88 if( CONFIG_DEBUG_SYS_GET_CONFIG < tm_end )88 if( DEBUG_SYS_GET_CONFIG < tm_end ) 89 89 printk("\n[DBG] %s : thread %x exit / process %x / cost %d / cycle %d\n", 90 90 __FUNCTION__, this, process->pid, (uint32_t)(tm_end-tm_start), (uint32_t)tm_end ); -
trunk/kernel/syscalls/sys_isatty.c
r437 r438 48 48 process_t * process = this->process; 49 49 50 #if CONFIG_DEBUG_SYS_ISATTY50 #if DEBUG_SYS_ISATTY 51 51 uint64_t tm_start; 52 52 uint64_t tm_end; 53 53 tm_start = hal_get_cycles(); 54 if( CONFIG_DEBUG_SYS_ISATTY < tm_start )54 if( DEBUG_SYS_ISATTY < tm_start ) 55 55 printk("\n[DBG] %s : thread %x enter / process %x / cycle %d\n" 56 56 __FUNCTION__ , this, process->pid, (uint32_t)tm_start ); … … 61 61 { 62 62 63 #if CONFIG_DEBUG_SYSCALLS_ERROR63 #if DEBUG_SYSCALLS_ERROR 64 64 printk("\n[ERROR] in %s : illegal file descriptor index = %d\n", __FUNCTION__ , file_id ); 65 65 #endif … … 74 74 { 75 75 76 #if CONFIG_DEBUG_SYSCALLS_ERROR76 #if DEBUG_SYSCALLS_ERROR 77 77 printk("\n[ERROR] in %s : undefined fd_id %d in process %x\n", 78 78 __FUNCTION__ , file_id , process->pid ); … … 108 108 } 109 109 110 #if CONFIG_DEBUG_SYS_ISATTY110 #if DEBUG_SYS_ISATTY 111 111 tm_end = hal_get_cycles(); 112 if( CONFIG_DEBUG_SYS_ISATTY < tm_end )112 if( DEBUG_SYS_ISATTY < tm_end ) 113 113 printk("\n[DBG] %s : thread %x exit / process %x / cost %d / cycle %d\n", 114 114 __FUNCTION__, this, process->pid, (uint32_t)(tm_end - tm_start), (uint32_t)tm_end ); -
trunk/kernel/syscalls/sys_kill.c
r436 r438 50 50 trdid_t trdid = this->trdid; 51 51 52 #if CONFIG_DEBUG_SYS_KILL52 #if DEBUG_SYS_KILL 53 53 uint64_t tm_start; 54 54 uint64_t tm_end; 55 55 tm_start = hal_get_cycles(); 56 if( CONFIG_DEBUG_SYS_KILL < tm_start )56 if( DEBUG_SYS_KILL < tm_start ) 57 57 printk("\n[DBG] %s : thread %x enter / process %x / sig %d / cycle %d\n", 58 58 __FUNCTION__ , this, pid, sig_id, (uint32_t)tm_start ); … … 68 68 { 69 69 70 #if CONFIG_DEBUG_SYSCALLS_ERROR70 #if DEBUG_SYSCALLS_ERROR 71 71 printk("\n[ERROR] in %s : process %x not found\n", __FUNCTION__, pid ); 72 72 #endif … … 79 79 { 80 80 81 #if CONFIG_DEBUG_SYSCALLS_ERROR81 #if DEBUG_SYSCALLS_ERROR 82 82 printk("\n[ERROR] in %s : only main thread can kill itself\n", __FUNCTION__ ); 83 83 #endif … … 96 96 { 97 97 98 #if CONFIG_DEBUG_SYSCALLS_ERROR98 #if DEBUG_SYSCALLS_ERROR 99 99 printk("\n[ERROR] in %s : process_init cannot be killed\n", __FUNCTION__ ); 100 100 #endif … … 167 167 { 168 168 169 #if CONFIG_DEBUG_SYSCALLS_ERROR169 #if DEBUG_SYSCALLS_ERROR 170 170 printk("\n[ERROR] in %s : illegal signal %d / process %x\n", __FUNCTION__, sig_id, pid ); 171 171 #endif … … 178 178 hal_fence(); 179 179 180 #if CONFIG_DEBUG_SYS_KILL180 #if DEBUG_SYS_KILL 181 181 tm_end = hal_get_cycles(); 182 if( CONFIG_DEBUG_SYS_KILL < tm_end )182 if( DEBUG_SYS_KILL < tm_end ) 183 183 printk("\n[DBG] %s : thread %x exit / process %x / sig %d / cost = %d / cycle %d\n", 184 184 __FUNCTION__ , this, pid, sig_id, (uint32_t)(tm_end - tm_start), (uint32_t)tm_end ); -
trunk/kernel/syscalls/sys_mmap.c
r435 r438 50 50 process_t * process = this->process; 51 51 52 #if CONFIG_DEBUG_SYS_MMAP52 #if DEBUG_SYS_MMAP 53 53 uint64_t tm_start; 54 54 uint64_t tm_end; 55 55 tm_start = hal_get_cycles(); 56 if ( CONFIG_DEBUG_SYS_MMAP < tm_start )56 if ( DEBUG_SYS_MMAP < tm_start ) 57 57 printk("\n[DBG] %s : thread %x enter / process %x / cycle %d\n", 58 58 __FUNCTION__, this, process->pid, (uint32_t)tm_start ); … … 65 65 { 66 66 67 #if CONFIG_DEBUG_SYSCALLS_ERROR67 #if DEBUG_SYSCALLS_ERROR 68 68 printk("\n[ERROR] in %s : arguments not in used space = %x\n", __FUNCTION__ , (intptr_t)attr ); 69 69 #endif … … 91 91 { 92 92 93 #if CONFIG_DEBUG_SYSCALLS_ERROR93 #if DEBUG_SYSCALLS_ERROR 94 94 printk("\n[ERROR] in %s : MAP_FIXED not supported\n", __FUNCTION__ ); 95 95 #endif … … 101 101 { 102 102 103 #if CONFIG_DEBUG_SYSCALLS_ERROR103 #if DEBUG_SYSCALLS_ERROR 104 104 printk("\n[ERROR] in %s : MAP_SHARED xor MAP_PRIVATE\n", __FUNCTION__ ); 105 105 #endif … … 123 123 { 124 124 125 #if CONFIG_DEBUG_SYSCALLS_ERROR125 #if DEBUG_SYSCALLS_ERROR 126 126 printk("\n[ERROR] in %s: bad file descriptor = %d\n", __FUNCTION__ , fdid ); 127 127 #endif … … 136 136 { 137 137 138 #if CONFIG_DEBUG_SYSCALLS_ERROR138 #if DEBUG_SYSCALLS_ERROR 139 139 printk("\n[ERROR] in %s: file %d not found\n", __FUNCTION__ , fdid ); 140 140 #endif … … 159 159 { 160 160 161 #if CONFIG_DEBUG_SYSCALLS_ERROR161 #if DEBUG_SYSCALLS_ERROR 162 162 printk("\n[ERROR] in %s: offset (%d) + len (%d) >= file's size (%d)\n", 163 163 __FUNCTION__, k_attr.offset, k_attr.length, size ); … … 172 172 { 173 173 174 #if CONFIG_DEBUG_SYSCALLS_ERROR174 #if DEBUG_SYSCALLS_ERROR 175 175 printk("\n[ERROR] in %s: prot = %x / file_attr = %x)\n", 176 176 __FUNCTION__ , k_attr.prot , file_attr ); … … 205 205 { 206 206 207 #if CONFIG_DEBUG_SYSCALLS_ERROR207 #if DEBUG_SYSCALLS_ERROR 208 208 printk("\n[ERROR] in %s : illegal cxy for MAP_REMOTE\n", __FUNCTION__ ); 209 209 #endif … … 254 254 { 255 255 256 #if CONFIG_DEBUG_SYSCALLS_ERROR256 #if DEBUG_SYSCALLS_ERROR 257 257 printk("\n[ERROR] in %s : cannot create vseg\n", __FUNCTION__ ); 258 258 #endif … … 266 266 hal_fence(); 267 267 268 #if CONFIG_DEBUG_SYS_MMAP268 #if DEBUG_SYS_MMAP 269 269 tm_end = hal_get_cycles(); 270 if ( CONFIG_DEBUG_SYS_MMAP < tm_start )270 if ( DEBUG_SYS_MMAP < tm_start ) 271 271 printk("\n[DBG] %s : thread %x enter / process %x / cycle %d\n" 272 272 "vseg %s / cluster %x / base %x / size %x / cost %d\n", -
trunk/kernel/syscalls/sys_munmap.c
r437 r438 43 43 process_t * process = this->process; 44 44 45 #if CONFIG_DEBUG_SYS_MUNMAP45 #if DEBUG_SYS_MUNMAP 46 46 uint64_t tm_start; 47 47 uint64_t tm_end; 48 48 tm_start = hal_get_cycles(); 49 if( CONFIG_DEBUG_SYS_MUNMAP < tm_start )49 if( DEBUG_SYS_MUNMAP < tm_start ) 50 50 printk("\n[DBG] %s : thread %x enter / process %x / cycle %d\n" 51 51 __FUNCTION__ , this, process->pid, (uint32_t)tm_start ); … … 58 58 { 59 59 60 #if CONFIG_DEBUG_SYSCALLS_ERROR60 #if DEBUG_SYSCALLS_ERROR 61 61 printk("\n[ERROR] in %s : cannot remove mapping\n", __FUNCTION__ ); 62 62 #endif … … 65 65 } 66 66 67 #if CONFIG_DEBUG_SYS_MUNMAP67 #if DEBUG_SYS_MUNMAP 68 68 tm_end = hal_get_cycles(); 69 if( CONFIG_DEBUG_SYS_MUNMAP < tm_start )69 if( DEBUG_SYS_MUNMAP < tm_start ) 70 70 printk("\n[DBG] %s : thread %x exit / process %x / cycle %d\n" 71 71 __FUNCTION__ , this, process->pid, (uint32_t)tm_end ); -
trunk/kernel/syscalls/sys_read.c
r436 r438 66 66 process_t * process = this->process; 67 67 68 #if CONFIG_DEBUG_SYS_READ68 #if DEBUG_SYS_READ 69 69 uint64_t tm_start; 70 70 uint64_t tm_end; 71 71 tm_start = hal_get_cycles(); 72 if( CONFIG_DEBUG_SYS_READ < tm_start )72 if( DEBUG_SYS_READ < tm_start ) 73 73 printk("\n[DBG] %s : thread %x enter / process %x / vaddr = %x / count %d / cycle %d\n", 74 74 __FUNCTION__, this, process->pid, vaddr, count, (uint32_t)tm_start ); 75 75 #endif 76 76 77 #if ( CONFIG_DEBUG_SYS_READ & 1)77 #if (DEBUG_SYS_READ & 1) 78 78 enter_sys_read = (uint32_t)tm_start; 79 79 #endif … … 83 83 { 84 84 85 #if CONFIG_DEBUG_SYSCALLS_ERROR85 #if DEBUG_SYSCALLS_ERROR 86 86 printk("\n[ERROR] in %s : illegal file descriptor index = %d\n", __FUNCTION__ , file_id ); 87 87 #endif … … 96 96 { 97 97 98 #if CONFIG_DEBUG_SYSCALLS_ERROR98 #if DEBUG_SYSCALLS_ERROR 99 99 printk("\n[ERROR] in %s : user buffer unmapped = %x\n", 100 100 __FUNCTION__ , (intptr_t)vaddr ); … … 113 113 { 114 114 115 #if CONFIG_DEBUG_SYSCALLS_ERROR115 #if DEBUG_SYSCALLS_ERROR 116 116 printk("\n[ERROR] in %s : undefined fd_id %d in process %x\n", 117 117 __FUNCTION__ , file_id , process->pid ); … … 130 130 { 131 131 132 #if CONFIG_DEBUG_SYSCALLS_ERROR132 #if DEBUG_SYSCALLS_ERROR 133 133 printk("\n[ERROR] in %s : file %d not readable in process %x\n", 134 134 __FUNCTION__ , file_id , process->pid ); … … 149 149 { 150 150 151 #if CONFIG_DEBUG_SYSCALLS_ERROR151 #if DEBUG_SYSCALLS_ERROR 152 152 printk("\n[ERROR] in %s : file %d not readable in process %x\n", 153 153 __FUNCTION__ , file_id , process->pid ); … … 205 205 { 206 206 207 #if CONFIG_DEBUG_SYSCALLS_ERROR207 #if DEBUG_SYSCALLS_ERROR 208 208 printk("\n[ERROR] in %s cannot read data from file %d in process %x\n", 209 209 __FUNCTION__ , file_id , process->pid ); … … 218 218 hal_fence(); 219 219 220 #if CONFIG_DEBUG_SYS_READ220 #if DEBUG_SYS_READ 221 221 tm_end = hal_get_cycles(); 222 if( CONFIG_DEBUG_SYS_READ < tm_end )222 if( DEBUG_SYS_READ < tm_end ) 223 223 printk("\n[DBG] %s : thread %x exit / process %x / cycle %d\n" 224 224 "nbytes = %d / first byte = %c / file_id = %d / cost = %d\n", … … 228 228 #endif 229 229 230 #if ( CONFIG_DEBUG_SYS_READ & 1)230 #if (DEBUG_SYS_READ & 1) 231 231 exit_sys_read = (uint32_t)tm_end; 232 232 -
trunk/kernel/syscalls/sys_thread_cancel.c
r436 r438 45 45 { 46 46 47 #if CONFIG_DEBUG_SYSCALLS_ERROR47 #if DEBUG_SYSCALLS_ERROR 48 48 printk("\n[ERROR] in %s : target thread %x not found\n", __FUNCTION__, trdid ); 49 49 #endif … … 52 52 } 53 53 54 #if CONFIG_DEBUG_SYS_THREAD_CANCEL54 #if DEBUG_SYS_THREAD_CANCEL 55 55 uint64_t tm_start; 56 56 uint64_t tm_end; 57 57 tm_start = hal_get_cycles(); 58 if( CONFIG_DEBUG_SYS_THREAD_CANCEL < tm_start )58 if( DEBUG_SYS_THREAD_CANCEL < tm_start ) 59 59 printk("\n[DBG] %s : thread %x enter to kill thread %x / cycle %d\n", 60 60 __FUCTION__, this, GET_PTR( target_xp ), (uint32_t)tm_start ); … … 66 66 0 ); // is forced 67 67 68 #if CONFIG_DEBUG_SYS_THREAD_CANCEL68 #if DEBUG_SYS_THREAD_CANCEL 69 69 tm_end = hal_get_cycles(); 70 if( CONFIG_DEBUG_SYS_THREAD_CANCEL < tm_end )70 if( DEBUG_SYS_THREAD_CANCEL < tm_end ) 71 71 printk("\n[DBG] %s : thread %x exit after kill thread %x / cycle %d\n", 72 72 __FUCTION__, this, GET_PTR( target_xp ), (uint32_t)tm_end ); -
trunk/kernel/syscalls/sys_thread_create.c
r437 r438 62 62 process = parent->process; 63 63 64 #if CONFIG_DEBUG_SYS_THREAD_CREATE64 #if DEBUG_SYS_THREAD_CREATE 65 65 uint64_t tm_start; 66 66 uint64_t tm_end; 67 67 tm_start = hal_get_cycles(); 68 if( CONFIG_DEBUG_SYS_THREAD_CREATE < tm_start )68 if( DEBUG_SYS_THREAD_CREATE < tm_start ) 69 69 printk("\n[DBG] %s : thread %x enter / process %x / cycle %d\n" 70 70 __FUNCTION__ , parent , process->pid, (uint32_t)tm_start ); … … 79 79 { 80 80 81 #if CONFIG_DEBUG_SYSCALLS_ERROR81 #if DEBUG_SYSCALLS_ERROR 82 82 printk("\n[ERROR] in %s : user_attr unmapped\n", __FUNCTION__ ); 83 83 #endif … … 95 95 { 96 96 97 #if CONFIG_DEBUG_SYSCALLS_ERROR97 #if DEBUG_SYSCALLS_ERROR 98 98 printk("\n[ERROR] in %s : start_func unmapped\n", __FUNCTION__ ); 99 99 #endif … … 108 108 { 109 109 110 #if CONFIG_DEBUG_SYSCALLS_ERROR110 #if DEBUG_SYSCALLS_ERROR 111 111 printk("\n[ERROR] in %s : start_arg unmapped\n", __FUNCTION__ ); 112 112 #endif … … 124 124 { 125 125 126 #if CONFIG_DEBUG_SYSCALLS_ERROR126 #if DEBUG_SYSCALLS_ERROR 127 127 printk("\n[ERROR] in %s : illegal target cluster = %x\n", __FUNCTION__ , kern_attr.cxy ); 128 128 #endif … … 174 174 { 175 175 176 #if CONFIG_DEBUG_SYSCALLS_ERROR176 #if DEBUG_SYSCALLS_ERROR 177 177 printk("\n[ERROR] in %s : cannot create thread\n", __FUNCTION__ ); 178 178 #endif … … 196 196 hal_fence(); 197 197 198 #if CONFIG_DEBUG_SYS_THREAD_CREATE198 #if DEBUG_SYS_THREAD_CREATE 199 199 tm_end = hal_get_cycles(); 200 if( CONFIG_DEBUG_SYS_THREAD_CREATE < tm_end )200 if( DEBUG_SYS_THREAD_CREATE < tm_end ) 201 201 printk("\n[DBG] %s : thread %x created thread %x for process %x in cluster %x / cycle %d\n" 202 202 __FUNCTION__, parent, child_ptr, process->pid, target_cxy, (uint32_t)tm_end ); -
trunk/kernel/syscalls/sys_thread_exit.c
r436 r438 39 39 { 40 40 41 #if CONFIG_DEBUG_SYSCALLS_ERROR41 #if DEBUG_SYSCALLS_ERROR 42 42 printk("\n[ERROR] in %s : exit_value argument must be NULL for thread %x in process %x\n", 43 43 __FUNCTION__ , exit_value, this->trdid , process->pid ); … … 47 47 } 48 48 49 #if CONFIG_DEBUG_SYS_THREAD_EXIT49 #if DEBUG_SYS_THREAD_EXIT 50 50 uint64_t tm_start; 51 51 uint64_t tm_end; 52 52 tm_start = hal_get_cycles(); 53 if( CONFIG_DEBUG_SYS_THREAD_EXIT < tm_start )53 if( DEBUG_SYS_THREAD_EXIT < tm_start ) 54 54 printk("\n[DBG] %s : thread %x enter / process %x / cycle %d\n", 55 55 __FUNCTION__ , this, process->pid , (uint32_t)tm_start ); … … 61 61 0 ); // is forced 62 62 63 #if CONFIG_DEBUG_SYS_THREAD_EXIT63 #if DEBUG_SYS_THREAD_EXIT 64 64 tm_end = hal_get_cycles(); 65 if( CONFIG_DEBUG_SYS_THREAD_EXIT < tm_end )65 if( DEBUG_SYS_THREAD_EXIT < tm_end ) 66 66 printk("\n[DBG] %s : thread %x exit / process %x / cost %d / cycle %d\n", 67 67 __FUNCTION__, this, this->process->pid, (uint32_t)(tm_end - tm_start), (uint32_t)tm_end ); -
trunk/kernel/syscalls/sys_thread_join.c
r436 r438 60 60 target_cxy = CXY_FROM_TRDID( trdid ); 61 61 62 #if CONFIG_DEBUG_SYS_THREAD_JOIN62 #if DEBUG_SYS_THREAD_JOIN 63 63 uint64_t tm_start; 64 64 uint64_t tm_end; 65 65 tm_start = hal_get_cycles(); 66 if( CONFIG_DEBUG_SYS_THREAD_JOIN < tm_start )66 if( DEBUG_SYS_THREAD_JOIN < tm_start ) 67 67 printk("\n[DBG] %s : parent thread %x enter / process %x / target trdid %x / cycle %d\n", 68 68 __FUNCTION__ , joining_ptr , process->pid , trdid , (uint32_t)tm_start ); … … 73 73 { 74 74 75 #if CONFIG_DEBUG_SYSCALLS_ERROR75 #if DEBUG_SYSCALLS_ERROR 76 76 printk("\n[ERROR] in %s : illegal trdid argument %x\n", __FUNCTION__, trdid ); 77 77 #endif … … 84 84 { 85 85 86 #if CONFIG_DEBUG_SYSCALLS_ERROR86 #if DEBUG_SYSCALLS_ERROR 87 87 printk("\n[ERROR] in %s : exit_value argument must be NULL\n", __FUNCTION__ ); 88 88 #endif … … 95 95 { 96 96 97 #if CONFIG_DEBUG_SYSCALLS_ERROR97 #if DEBUG_SYSCALLS_ERROR 98 98 printk("\n[ERROR] in %s : this thread == target thread\n", __FUNCTION__ ); 99 99 #endif … … 109 109 { 110 110 111 #if CONFIG_DEBUG_SYSCALLS_ERROR111 #if DEBUG_SYSCALLS_ERROR 112 112 printk("\n[ERROR] in %s : target thread %x not found\n", __FUNCTION__, trdid ); 113 113 #endif … … 126 126 { 127 127 128 #if CONFIG_DEBUG_SYSCALLS_ERROR128 #if DEBUG_SYSCALLS_ERROR 129 129 printk("\n[ERROR] in %s : target thread %x not joinable\n", __FUNCTION__, trdid ); 130 130 #endif … … 178 178 } 179 179 180 #if CONFIG_DEBUG_SYS_THREAD_JOIN180 #if DEBUG_SYS_THREAD_JOIN 181 181 tm_end = hal_get_cycles(); 182 if( CONFIG_DEBUG_SYS_THREAD_JOIN < tm_end )182 if( DEBUG_SYS_THREAD_JOIN < tm_end ) 183 183 printk("\n[DBG] %s : parent thread %x exit / process %x / target trdid %x / cycle %d\n", 184 184 __FUNCTION__, joining_ptr, process->pid, trdid, (uint32_t)tm_end ); -
trunk/kernel/syscalls/sys_thread_sleep.c
r436 r438 33 33 thread_t * this = CURRENT_THREAD; 34 34 35 #if CONFIG_DEBUG_SYS_THREAD_SLEEP35 #if DEBUG_SYS_THREAD_SLEEP 36 36 uint64_t tm_start; 37 37 uint64_t tm_end; 38 38 tm_start = hal_get_cycles(); 39 if( CONFIG_DEBUG_SYS_THREAD_SLEEP < tm_start )39 if( DEBUG_SYS_THREAD_SLEEP < tm_start ) 40 40 printk("\n[DBG] %s : thread %x blocked / process %x / cycle %d\n", 41 41 __FUNCTION__ , this, this->process->pid , (uint32_t)tm_start ); … … 45 45 sched_yield("blocked on sleep"); 46 46 47 #if CONFIG_DEBUG_SYS_THREAD_SLEEP47 #if DEBUG_SYS_THREAD_SLEEP 48 48 tm_end = hal_get_cycles(); 49 if( CONFIG_DEBUG_SYS_THREAD_SLEEP < tm_end )49 if( DEBUG_SYS_THREAD_SLEEP < tm_end ) 50 50 printk("\n[DBG] %s : thread %x resume / process %x / cycle %d\n", 51 51 __FUNCTION__ , this, this->process->pid , (uint32_t)tm_end ); -
trunk/kernel/syscalls/sys_thread_wakeup.c
r436 r438 34 34 process_t * process = this->process; 35 35 36 #if CONFIG_DEBUG_SYS_THREAD_WAKEUP36 #if DEBUG_SYS_THREAD_WAKEUP 37 37 uint64_t tm_start; 38 38 uint64_t tm_end; 39 39 tm_start = hal_get_cycles(); 40 if( CONFIG_DEBUG_SYS_THREAD_WAKEUP < tm_start )40 if( DEBUG_SYS_THREAD_WAKEUP < tm_start ) 41 41 printk("\n[DBG] %s : thread %x enter / activate thread %x in process %x / cycle %d\n", 42 42 __FUNCTION__ , this, trdid, this->process->pid, (uint32_t)tm_start ); … … 51 51 { 52 52 53 #if CONFIG_DEBUG_SISCALLS_ERROR53 #if DEBUG_SISCALLS_ERROR 54 54 printk("\n[ERROR] in %s : illegal trdid argument %x\n", __FUNCTION__, trdid ); 55 55 #endif … … 64 64 { 65 65 66 #if CONFIG_DEBUG_SISCALLS_ERROR66 #if DEBUG_SISCALLS_ERROR 67 67 printk("\n[ERROR] in %s : cannot find thread %x in process %x/n", 68 68 __FUNCTION__ , trdid , this->process->pid ); … … 75 75 thread_unblock( thread_xp , THREAD_BLOCKED_GLOBAL ); 76 76 77 #if CONFIG_DEBUG_SYS_THREAD_WAKEUP77 #if DEBUG_SYS_THREAD_WAKEUP 78 78 tm_end = hal_get_cycles(); 79 if( CONFIG_DEBUG_SYS_THREAD_WAKEUP < tm_end )79 if( DEBUG_SYS_THREAD_WAKEUP < tm_end ) 80 80 printk("\n[DBG] %s : thread %x exit / thread %x in process %x activated / cycle %d\n", 81 81 __FUNCTION__ , this, trdid, this->process->pid, (uint32_t)tm_end ); -
trunk/kernel/syscalls/sys_wait.c
r436 r438 49 49 pid_t pid = process->pid; 50 50 51 #if CONFIG_DEBUG_SYS_WAIT51 #if DEBUG_SYS_WAIT 52 52 uint64_t tm_start; 53 53 uint64_t tm_end; 54 54 tm_start = hal_get_cycles(); 55 if( CONFIG_DEBUG_SYS_WAIT < tm_start )55 if( DEBUG_SYS_WAIT < tm_start ) 56 56 printk("\n[DBG] %s : thread %x enter / process %x / cycle %d\n", 57 57 __FUNCTION__, this, process->pid, (uint32_t)tm_start ); … … 64 64 { 65 65 66 #if CONFIG_DEBUG_SYSCALLS_ERROR66 #if DEBUG_SYSCALLS_ERROR 67 67 printk("\n[ERROR] in %s : status buffer unmapped for thread %x in process %x\n", 68 68 __FUNCTION__ , this->trdid , process->pid ); … … 80 80 { 81 81 82 #if CONFIG_DEBUG_SYSCALL_ERROR82 #if DEBUG_SYSCALL_ERROR 83 83 printk("\n[ERROR] in %s : calling thread %x is not thread 0 in owner cluster %x\n", 84 84 __FUNCTION__ , trdid , owner_cxy ); … … 135 135 remote_spinlock_unlock( children_lock_xp ); 136 136 137 #if CONFIG_DEBUG_SYS_WAIT137 #if DEBUG_SYS_WAIT 138 138 tm_end = hal_get_cycles(); 139 if( CONFIG_DEBUG_SYS_WAIT < tm_end )139 if( DEBUG_SYS_WAIT < tm_end ) 140 140 printk("\n[DBG] %s : thread %x exit / parent %x / child %x / cycle %d\n", 141 141 __FUNCTION__, this, process->pid, child_pid, (uint32_t)tm_end ); -
trunk/kernel/syscalls/sys_write.c
r435 r438 46 46 reg_t save_sr; // required to enable IRQs during syscall 47 47 48 #if ( CONFIG_DEBUG_SYS_WRITE_DEBUG & 1)48 #if (DEBUG_SYS_WRITE_DEBUG & 1) 49 49 enter_sys_read = (uint32_t)tm_start; 50 50 #endif … … 53 53 process_t * process = this->process; 54 54 55 #if CONFIG_DEBUG_SYS_WRITE55 #if DEBUG_SYS_WRITE 56 56 uint32_t tm_start; 57 57 uint32_t tm_end; 58 58 tm_start = hal_get_cycles(); 59 if( CONFIG_DEBUG_SYS_WRITE < tm_start )59 if( DEBUG_SYS_WRITE < tm_start ) 60 60 printk("\n[DBG] %s : thread %x enter / process %x / vaddr %x / count %d / cycle %d\n", 61 61 __FUNCTION__, this, process->pid, vaddr, count, (uint32_t)tm_start ); … … 66 66 { 67 67 68 #if CONFIG_DEBUG_SYSCALLS_ERROR68 #if DEBUG_SYSCALLS_ERROR 69 69 printk("\n[ERROR] in %s : illegal file descriptor index\n", __FUNCTION__ ); 70 70 #endif … … 79 79 { 80 80 81 #if CONFIG_DEBUG_SYSCALLS_ERROR81 #if DEBUG_SYSCALLS_ERROR 82 82 printk("\n[ERROR] in %s : user buffer unmapped = %x\n", __FUNCTION__ , (intptr_t)vaddr ); 83 83 #endif … … 95 95 { 96 96 97 #if CONFIG_DEBUG_SYSCALLS_ERROR97 #if DEBUG_SYSCALLS_ERROR 98 98 printk("\n[ERROR] in %s : undefined file descriptor index = %d in process %x\n", 99 99 __FUNCTION__ , file_id , process->pid ); … … 119 119 { 120 120 121 #if CONFIG_DEBUG_SYSCALLS_ERROR121 #if DEBUG_SYSCALLS_ERROR 122 122 printk("\n[ERROR] in %s : file %d not writable in process %x\n", 123 123 __FUNCTION__ , file_id , process->pid ); … … 150 150 { 151 151 152 #if CONFIG_DEBUG_SYSCALLS_ERROR152 #if DEBUG_SYSCALLS_ERROR 153 153 printk("\n[ERROR] in %s cannot write data to file %d in process %x\n", 154 154 __FUNCTION__ , file_id , process->pid ); … … 163 163 hal_fence(); 164 164 165 #if CONFIG_DEBUG_SYS_WRITE165 #if DEBUG_SYS_WRITE 166 166 tm_end = hal_get_cycles(); 167 if( CONFIG_DEBUG_SYS_WRITE < tm_end )167 if( DEBUG_SYS_WRITE < tm_end ) 168 168 printk("\n[DBG] %s : thread %x exit / process %x / cycle %d\n" 169 169 "nbytes = %d / first byte = %c / file_id = %d / cost = %d\n", … … 172 172 #endif 173 173 174 #if ( CONFIG_DEBUG_SYS_WRITE & 1)174 #if (DEBUG_SYS_WRITE & 1) 175 175 exit_sys_write = (uint32_t)tm_end; 176 176
Note: See TracChangeset
for help on using the changeset viewer.