Changeset 437 for trunk/kernel/syscalls
- Timestamp:
- Mar 28, 2018, 2:40:29 PM (7 years ago)
- Location:
- trunk/kernel/syscalls
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/syscalls/shared_syscalls.h
r435 r437 61 61 SYS_CLOSEDIR = 25, 62 62 SYS_GETCWD = 26, 63 SYS_ UNDEFINED_27 = 27, ///63 SYS_ISATTY = 27, 64 64 SYS_ALARM = 28, 65 65 SYS_RMDIR = 29, -
trunk/kernel/syscalls/sys_munmap.c
r410 r437 3 3 * 4 4 * Authors Ghassan Almaless (2008,2009,2010,2011,2012) 5 * Alain Greiner (2016,2017 )5 * Alain Greiner (2016,2017,2018) 6 6 * 7 7 * Copyright (c) UPMC Sorbonne Universites … … 40 40 error_t error; 41 41 42 uint32_t tm_start;43 uint32_t tm_end;44 45 tm_start = hal_get_cycles();46 47 42 thread_t * this = CURRENT_THREAD; 48 43 process_t * process = this->process; 44 45 #if CONFIG_DEBUG_SYS_MUNMAP 46 uint64_t tm_start; 47 uint64_t tm_end; 48 tm_start = hal_get_cycles(); 49 if( CONFIG_DEBUG_SYS_MUNMAP < tm_start ) 50 printk("\n[DBG] %s : thread %x enter / process %x / cycle %d\n" 51 __FUNCTION__ , this, process->pid, (uint32_t)tm_start ); 52 #endif 49 53 50 54 // call relevant kernel function … … 53 57 if ( error ) 54 58 { 55 printk("\n[ERROR] in %s : cannot remove mapping\n", __FUNCTION__ ); 59 60 #if CONFIG_DEBUG_SYSCALLS_ERROR 61 printk("\n[ERROR] in %s : cannot remove mapping\n", __FUNCTION__ ); 62 #endif 56 63 this->errno = EINVAL; 57 64 return -1; 58 65 } 59 66 60 tm_end = hal_get_cycles(); 67 #if CONFIG_DEBUG_SYS_MUNMAP 68 tm_end = hal_get_cycles(); 69 if( CONFIG_DEBUG_SYS_MUNMAP < tm_start ) 70 printk("\n[DBG] %s : thread %x exit / process %x / cycle %d\n" 71 __FUNCTION__ , this, process->pid, (uint32_t)tm_end ); 72 #endif 61 73 62 syscall_dmsg("\n[DBG] %s : core[%x,%d] removed vseg in process %x / cycle %d\n" 63 " base = %x / size = %x / cost = %d\n", 64 __FUNCTION__, local_cxy , this->core->lid , process->pid , tm_start , 65 vaddr , size , tm_end - tm_start ); 74 return 0; 66 75 67 return 0; 76 } // end sys_munmap() 68 77 69 } // end sys_mmap()70 -
trunk/kernel/syscalls/sys_thread_create.c
r407 r437 2 2 * sys_thread_create.c - creates a new user thread 3 3 * 4 * Author Alain Greiner (2016,2017 )4 * Author Alain Greiner (2016,2017,2018) 5 5 * 6 6 * Copyright (c) UPMC Sorbonne Universites … … 57 57 error_t error; 58 58 59 uint32_t tm_start;60 uint32_t tm_end;61 62 tm_start = hal_get_cycles();63 64 59 // get parent thead pointer, extended pointer, and process 65 60 parent = CURRENT_THREAD; … … 67 62 process = parent->process; 68 63 64 #if CONFIG_DEBUG_SYS_THREAD_CREATE 65 uint64_t tm_start; 66 uint64_t tm_end; 67 tm_start = hal_get_cycles(); 68 if( CONFIG_DEBUG_SYS_THREAD_CREATE < tm_start ) 69 printk("\n[DBG] %s : thread %x enter / process %x / cycle %d\n" 70 __FUNCTION__ , parent , process->pid, (uint32_t)tm_start ); 71 #endif 72 69 73 // check user_attr in user space & copy to kernel space 70 74 if( user_attr != NULL ) … … 74 78 if( error ) 75 79 { 76 printk("\n[ERROR] in %s : user_attr unmapped\n", __FUNCTION__ ); 80 81 #if CONFIG_DEBUG_SYSCALLS_ERROR 82 printk("\n[ERROR] in %s : user_attr unmapped\n", __FUNCTION__ ); 83 #endif 77 84 parent->errno = EINVAL; 78 85 return -1; … … 87 94 if( error ) 88 95 { 89 printk("\n[ERROR] in %s : start_func unmapped\n", __FUNCTION__ ); 96 97 #if CONFIG_DEBUG_SYSCALLS_ERROR 98 printk("\n[ERROR] in %s : start_func unmapped\n", __FUNCTION__ ); 99 #endif 90 100 parent->errno = EINVAL; 91 101 return -1; … … 97 107 if( error ) 98 108 { 99 printk("\n[ERROR] in %s : start_arg unmapped\n", __FUNCTION__ ); 109 110 #if CONFIG_DEBUG_SYSCALLS_ERROR 111 printk("\n[ERROR] in %s : start_arg unmapped\n", __FUNCTION__ ); 112 #endif 100 113 parent->errno = EINVAL; 101 114 return -1; … … 110 123 if( cluster_is_undefined( kern_attr.cxy ) ) 111 124 { 112 printk("\n[ERROR] in %s : illegal target cluster = %x\n", 113 __FUNCTION__ , kern_attr.cxy ); 125 126 #if CONFIG_DEBUG_SYSCALLS_ERROR 127 printk("\n[ERROR] in %s : illegal target cluster = %x\n", __FUNCTION__ , kern_attr.cxy ); 128 #endif 114 129 parent->errno = EINVAL; 115 130 return -1; … … 158 173 if( error ) 159 174 { 160 printk("\n[ERROR] in %s : cannot create thread\n", __FUNCTION__ ); 175 176 #if CONFIG_DEBUG_SYSCALLS_ERROR 177 printk("\n[ERROR] in %s : cannot create thread\n", __FUNCTION__ ); 178 #endif 161 179 return ENOMEM; 162 180 } … … 178 196 hal_fence(); 179 197 180 tm_end = hal_get_cycles(); 181 182 syscall_dmsg("\n[DBG] %s : core[%x,%d] created thread %x for process %x / cycle %d\n" 183 " cluster %x / cost = %d cycles\n", 184 __FUNCTION__ , local_cxy , parent->core->lid , trdid , process->pid , tm_end ,185 target_cxy , tm_end - tm_start ); 198 #if CONFIG_DEBUG_SYS_THREAD_CREATE 199 tm_end = hal_get_cycles(); 200 if( CONFIG_DEBUG_SYS_THREAD_CREATE < tm_end ) 201 printk("\n[DBG] %s : thread %x created thread %x for process %x in cluster %x / cycle %d\n" 202 __FUNCTION__, parent, child_ptr, process->pid, target_cxy, (uint32_t)tm_end ); 203 #endif 186 204 187 205 return 0; -
trunk/kernel/syscalls/syscalls.h
r436 r437 356 356 357 357 /****************************************************************************************** 358 * [27] This slot is not used. 359 *****************************************************************************************/ 358 * [27] This function tests whether a given file descriptor dentified by the <file_id> 359 * argument is an open file descriptor referring to a terminal. 360 ****************************************************************************************** 361 * @ file_id : file descriptor index 362 * @ return 1 if it is a TXT device / return 0 if it is not a TXT device. 363 *****************************************************************************************/ 364 int sys_isatty( uint32_t file_id ); 360 365 361 366 /******************************************************************************************
Note: See TracChangeset
for help on using the changeset viewer.