Changeset 635 for trunk/kernel/syscalls
- Timestamp:
- Jun 26, 2019, 11:42:37 AM (5 years ago)
- Location:
- trunk/kernel/syscalls
- Files:
-
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/syscalls/sys_barrier.c
r629 r635 76 76 printk("\n[ERROR] in %s : unmapped barrier %x / thread %x / process %x\n", 77 77 __FUNCTION__ , vaddr , this->trdid , process->pid ); 78 hal_vmm_display( process , false );79 78 #endif 80 79 this->errno = error; … … 97 96 printk("\n[ERROR] in %s : unmapped barrier attributes %x / thread %x / process %x\n", 98 97 __FUNCTION__ , attr , this->trdid , process->pid ); 99 hal_vmm_display( process , false );100 98 #endif 101 99 this->errno = EINVAL; -
trunk/kernel/syscalls/sys_condvar.c
r624 r635 76 76 printk("\n[ERROR] in %s : unmapped condvar %x / thread %x / process %x\n", 77 77 __FUNCTION__ , (intptr_t)condvar , this->trdid , process->pid ); 78 hal_vmm_display( process , false );79 78 #endif 80 79 this->errno = error; -
trunk/kernel/syscalls/sys_display.c
r626 r635 160 160 } 161 161 162 // get local pointer on process163 process_t * process = (process_t *)GET_PTR( process_xp );164 165 162 // call kernel function 166 if( cxy == local_cxy ) 167 { 168 hal_vmm_display( process , true ); 169 } 170 else 171 { 172 rpc_hal_vmm_display_client( cxy , process , true ); 173 } 163 hal_vmm_display( process_xp , true ); 174 164 175 165 break; -
trunk/kernel/syscalls/sys_exec.c
r626 r635 63 63 uint32_t length; // string length 64 64 kmem_req_t req; // kmem request 65 page_t * page; // page descriptor66 xptr_t base_xp; // extended pointer on page base67 65 uint32_t order; // ln2( number of pages to store strings ) 68 66 char ** k_pointers; // base of kernel array of pointers 67 char * k_buf_base; // base address of the kernel strings buffer 69 68 char * k_buf_ptr; // pointer on first empty slot in kernel strings buffer 70 char * k_buf_base; // base address of the kernel strings buffer71 69 72 70 // compute ln2( number of pages for kernel strings buffer ) … … 74 72 else order = bits_log2( CONFIG_VMM_ENVS_SIZE ); 75 73 76 req.type = KMEM_PAGE; 74 // allocate one physical page for kernel array of pointers 75 req.type = KMEM_PPM; 76 req.order = 0; 77 77 req.flags = AF_KERNEL | AF_ZERO; 78 79 // allocate one physical page for kernel array of pointers 80 req.type = 0; 81 page = kmem_alloc( &req ); 82 83 if( page == NULL ) return ENOMEM; 84 85 base_xp = ppm_page2base( XPTR( local_cxy , page ) ); 86 k_pointers = (char **)GET_PTR( base_xp ); 78 k_pointers = kmem_alloc( &req ); 79 80 if( k_pointers == NULL ) return ENOMEM; 87 81 88 82 // allocate several physical pages to store the strings themselve 89 req.type = order; 90 page = kmem_alloc( &req ); 91 92 if( page == NULL ) return ENOMEM; 93 94 base_xp = ppm_page2base( XPTR( local_cxy , page ) ); 95 k_buf_base = (char *)GET_PTR( base_xp ); 83 req.type = KMEM_PPM; 84 req.order = order; 85 req.flags = AF_KERNEL | AF_ZERO; 86 k_buf_base = kmem_alloc( &req ); 87 88 if( k_buf_base == NULL ) return ENOMEM; 96 89 97 90 // copy the array of pointers to kernel buffer -
trunk/kernel/syscalls/sys_fork.c
r625 r635 72 72 73 73 #if DEBUG_SYS_FORK 74 if( DEBUG_SYS_FORK < tm_start )74 if( DEBUG_SYS_FORK < (uint32_t)tm_start ) 75 75 printk("\n[%s] thread[%x,%x] enter / cycle = %d\n", 76 76 __FUNCTION__, parent_pid, parent_thread_ptr->trdid, (uint32_t)tm_start ); … … 109 109 110 110 #if (DEBUG_SYS_FORK & 1 ) 111 if( DEBUG_SYS_FORK < tm_start )111 if( DEBUG_SYS_FORK < (uint32_t)tm_start ) 112 112 printk("\n[%s] thread[%x,%x] selected cluster %x\n", 113 113 __FUNCTION__, parent_pid, parent_thread_ptr->trdid, child_cxy ); … … 150 150 } 151 151 152 // set remote child CPU context from parent_thread register values 152 // set the remote child CPU context from parent register values, 153 // set the remote child uzone from 153 154 // replicates the parent thread kernel stack to the child thread descriptor, 154 155 // and finally unblock the child thread. … … 171 172 172 173 #if DEBUG_SYS_FORK 173 if( DEBUG_SYS_FORK < tm_end )174 if( DEBUG_SYS_FORK < (uint32_t)tm_end ) 174 175 printk("\n[%s] parent thread[%x,%x] exit / child_pid %x / cycle %d\n", 175 176 __FUNCTION__, current->process->pid, current->trdid, child_pid, (uint32_t)tm_end ); 176 177 #endif 177 178 178 // only parent contribute to instrumentation 179 // only parent display the parent and child VMM 180 #if (DEBUG_SYS_FORK & 1 ) 181 if( DEBUG_SYS_FORK < (uint32_t)tm_end ) 182 { 183 process_t * child_process_ptr = hal_remote_lpt( XPTR( child_cxy , 184 &child_thread_ptr->process ) ); 185 xptr_t child_process_xp = XPTR( child_cxy , child_process_ptr ); 186 187 hal_vmm_display( ref_process_xp , true ); 188 hal_vmm_display( child_process_xp , true ); 189 } 190 #endif 191 192 // only parent contribute to syscalls instrumentation 179 193 #if CONFIG_INSTRUMENTATION_SYSCALLS 180 194 hal_atomic_add( &syscalls_cumul_cost[SYS_FORK] , tm_end - tm_start ); … … 187 201 188 202 #if DEBUG_SYS_FORK 189 if( DEBUG_SYS_FORK < tm_end )203 if( DEBUG_SYS_FORK < (uint32_t)tm_end ) 190 204 printk("\n[%s] child thread[%x,%x] exit / child_pid %x / cycle %d\n", 191 205 __FUNCTION__, current->process->pid, current->trdid, child_pid, (uint32_t)tm_end ); -
trunk/kernel/syscalls/sys_get_config.c
r626 r635 69 69 printk("\n[ERROR] in %s : x_size buffer unmapped / thread %x / process %x\n", 70 70 __FUNCTION__ , (intptr_t)x_size , this->trdid , process->pid ); 71 hal_vmm_display( process , false );72 71 #endif 73 72 this->errno = EINVAL; … … 84 83 printk("\n[ERROR] in %s : y_size buffer unmapped / thread %x / process %x\n", 85 84 __FUNCTION__ , (intptr_t)y_size , this->trdid , process->pid ); 86 hal_vmm_display( process , false );87 85 #endif 88 86 this->errno = EINVAL; … … 99 97 printk("\n[ERROR] in %s : ncores buffer unmapped / thread %x / process %x\n", 100 98 __FUNCTION__ , (intptr_t)ncores , this->trdid , process->pid ); 101 hal_vmm_display( process , false );102 99 #endif 103 100 this->errno = EINVAL; -
trunk/kernel/syscalls/sys_get_core.c
r626 r635 56 56 printk("\n[ERROR] in %s : cxy buffer unmapped %x / thread %x / process %x\n", 57 57 __FUNCTION__ , (intptr_t)cxy , this->trdid , process->pid ); 58 hal_vmm_display( process , false );59 58 #endif 60 59 this->errno = EFAULT; … … 71 70 printk("\n[ERROR] in %s : lid buffer unmapped %x / thread %x / process %x\n", 72 71 __FUNCTION__ , (intptr_t)lid , this->trdid , process->pid ); 73 hal_vmm_display( process , false );74 72 #endif 75 73 this->errno = EFAULT; -
trunk/kernel/syscalls/sys_get_cycle.c
r626 r635 54 54 printk("\n[ERROR] in %s : user buffer unmapped %x / thread %x / process %x\n", 55 55 __FUNCTION__ , (intptr_t)cycle , this->trdid , process->pid ); 56 hal_vmm_display( process , false );57 56 #endif 58 57 this->errno = EFAULT; -
trunk/kernel/syscalls/sys_is_fg.c
r626 r635 68 68 printk("\n[ERROR] in %s : unmapped owner buffer %x / thread %x in process %x\n", 69 69 __FUNCTION__ , (intptr_t)is_fg, this->trdid, process->pid ); 70 hal_vmm_display( process , false );71 70 #endif 72 71 this->errno = EINVAL; -
trunk/kernel/syscalls/sys_mmap.c
r626 r635 70 70 printk("\n[ERROR] in %s : thread[%x,%x] / mmap attributes unmapped %x\n", 71 71 __FUNCTION__ , process->pid, this->trdid, (intptr_t)attr ); 72 hal_vmm_display( process , false );73 72 #endif 74 73 this->errno = EINVAL; -
trunk/kernel/syscalls/sys_munmap.c
r625 r635 67 67 printk("\n[ERROR] in %s : thread[%x,%x] / user buffer unmapped %x\n", 68 68 __FUNCTION__ , process->pid, this->trdid, (intptr_t)vaddr ); 69 hal_vmm_display( process , false );70 69 #endif 71 70 this->errno = EINVAL; -
trunk/kernel/syscalls/sys_mutex.c
r625 r635 76 76 printk("\n[ERROR] in %s : mutex unmapped %x / thread %x / process %x\n", 77 77 __FUNCTION__ , (intptr_t)vaddr , this->trdid , process->pid ); 78 hal_vmm_display( process , false );79 78 #endif 80 79 this->errno = error; -
trunk/kernel/syscalls/sys_opendir.c
r626 r635 67 67 printk("\n[ERROR] in %s / thread[%x,%x] : DIR buffer %x unmapped\n", 68 68 __FUNCTION__ , process->pid , this->trdid, dirp ); 69 hal_vmm_display( process , false );70 69 #endif 71 70 this->errno = EINVAL; -
trunk/kernel/syscalls/sys_read.c
r633 r635 106 106 printk("\n[ERROR] in %s : thread[%x,%x] user buffer unmapped %x\n", 107 107 __FUNCTION__ , process->pid, this->trdid, (intptr_t)vaddr ); 108 hal_vmm_display( process , false );109 108 #endif 110 109 this->errno = EINVAL; -
trunk/kernel/syscalls/sys_readdir.c
r626 r635 70 70 printk("\n[ERROR] in %s / thread[%x,%x] : user buffer %x unmapped\n", 71 71 __FUNCTION__ , process->pid , this->trdid, buffer ); 72 hal_vmm_display( process , false );73 72 #endif 74 73 this->errno = EINVAL; -
trunk/kernel/syscalls/sys_sem.c
r626 r635 75 75 printk("\n[ERROR] in %s : unmapped semaphore pointer %x / thread %x in process %x / cycle %d\n", 76 76 __FUNCTION__ , (intptr_t)vaddr, this->trdid, process->pid, (uint32_t)hal_get_cycles() ); 77 hal_vmm_display( process , false );78 77 #endif 79 78 this->errno = EINVAL; … … 113 112 printk("\n[ERROR] in %s GETVALUE: unmapped buffer %x / thread %x in process %x / cycle %d\n", 114 113 __FUNCTION__ , (intptr_t)current_value, this->trdid, process->pid, (uint32_t)hal_get_cycles() ); 115 hal_vmm_display( process , false );116 114 #endif 117 115 this->errno = EINVAL; … … 158 156 printk("\n[ERROR] in %s WAIT: semaphore %x not found / thread %x in process %x / cycle %d\n", 159 157 __FUNCTION__ , (intptr_t)vaddr, this->trdid, process->pid, (uint32_t)hal_get_cycles() ); 160 hal_vmm_display( process , true );161 158 #endif 162 159 this->errno = EINVAL; -
trunk/kernel/syscalls/sys_stat.c
r626 r635 62 62 printk("\n[ERROR] in %s / thread[%x,%x] : stat structure %x unmapped\n", 63 63 __FUNCTION__ , process->pid , this->trdid, u_stat ); 64 hal_vmm_display( process , false );65 64 #endif 66 65 this->errno = EINVAL; -
trunk/kernel/syscalls/sys_thread_create.c
r633 r635 81 81 printk("\n[ERROR] in %s : thread[%x,%x] / trdid buffer %x unmapped %x\n", 82 82 __FUNCTION__, process->pid, parent->trdid, (intptr_t)trdid_ptr ); 83 hal_vmm_display( process , false );84 83 #endif 85 84 parent->errno = EINVAL; … … 98 97 printk("\n[ERROR] in %s : thread[%x,%x] / user_attr buffer unmapped %x\n", 99 98 __FUNCTION__, process->pid, parent->trdid, (intptr_t)user_attr ); 100 hal_vmm_display( process , false );101 99 #endif 102 100 parent->errno = EINVAL; … … 119 117 printk("\n[ERROR] in %s : thread[%x,%x] / start_func unmapped %x\n", 120 118 __FUNCTION__, process->pid, parent->trdid, (intptr_t)start_func ); 121 hal_vmm_display( process , false );122 119 #endif 123 120 parent->errno = EINVAL; … … 136 133 printk("\n[ERROR] in %s : thread[%x,%x] / start_args buffer unmapped %x\n", 137 134 __FUNCTION__, process->pid, parent->trdid, (intptr_t)start_args ); 138 hal_vmm_display( process , false );139 135 #endif 140 136 parent->errno = EINVAL; -
trunk/kernel/syscalls/sys_thread_exit.c
r625 r635 2 2 * sys_thread_exit.c - terminates the execution of calling thread 3 3 * 4 * Authors Alain Greiner (2016,2017,2018 )4 * Authors Alain Greiner (2016,2017,2018,2019) 5 5 * 6 6 * Copyright (c) UPMC Sorbonne Universites … … 46 46 47 47 #if DEBUG_SYSCALLS_ERROR 48 printk("\n[ERROR] in %s : exit_value argument must be NULL / thread %x in process %x\n",49 __FUNCTION__ , this , pid);48 printk("\n[ERROR] in %s : thread[%x,%x] / exit_value argument %x must be NULL\n", 49 __FUNCTION__ , pid, trdid , exit_value ); 50 50 #endif 51 51 this->errno = EINVAL; 52 52 return -1; 53 53 } 54 55 54 56 55 // If calling thread is the main thread, the process must be deleted. -
trunk/kernel/syscalls/sys_timeofday.c
r626 r635 71 71 printk("\n[ERROR] in %s : user buffer tz unmapped / thread %x / process %x\n", 72 72 __FUNCTION__ , (intptr_t)tz , this->trdid , process->pid ); 73 hal_vmm_display( process , false );74 73 #endif 75 74 this->errno = EINVAL; -
trunk/kernel/syscalls/sys_wait.c
r626 r635 69 69 printk("\n[ERROR] in %s : status buffer %x unmapped for thread[%x,%x]\n", 70 70 __FUNCTION__ , (intptr_t)status, pid, this->trdid ); 71 hal_vmm_display( process , false );72 71 #endif 73 72 this->errno = EINVAL; -
trunk/kernel/syscalls/sys_write.c
r625 r635 106 106 printk("\n[ERROR] in %s : thread[%x,%x] user buffer unmapped %x\n", 107 107 __FUNCTION__ , process->pid, this->trdid, (intptr_t)vaddr ); 108 hal_vmm_display( process , false );109 108 #endif 110 109 this->errno = EINVAL;
Note: See TracChangeset
for help on using the changeset viewer.