- Timestamp:
- Aug 25, 2018, 6:29:34 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 38 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hal/tsar_mips32/drivers/soclib_nic.c
r493 r506 271 271 } 272 272 break; // end READABLE 273 } 273 } 274 274 } // end soclib_nic_cmd() 275 275 -
trunk/kernel/syscalls/sys_alarm.c
r473 r506 30 30 #include <core.h> 31 31 32 #include <syscalls.h> 33 32 34 //////////////////////////////// 33 int sys_alarm( uint 64_t cycles )35 int sys_alarm( uint32_t cycles ) 34 36 { 35 37 thread_t * this = CURRENT_THREAD; -
trunk/kernel/syscalls/sys_chdir.c
r457 r506 32 32 #include <process.h> 33 33 34 #include <syscalls.h> 35 34 36 ///////////////////////////////// 35 int sys_chdir ( c har * pathname )37 int sys_chdir ( const char * pathname ) 36 38 { 37 39 error_t error; -
trunk/kernel/syscalls/sys_chmod.c
r457 r506 30 30 #include <process.h> 31 31 32 #include <syscalls.h> 33 32 34 ////////////////////////////////// 33 int sys_chmod( c har* pathname,34 uint32_t rights )35 int sys_chmod( const char * pathname, 36 uint32_t rights ) 35 37 { 36 38 error_t error; -
trunk/kernel/syscalls/sys_close.c
r459 r506 29 29 #include <thread.h> 30 30 #include <printk.h> 31 32 #include <syscalls.h> 31 33 32 34 ////////////////////////////////// -
trunk/kernel/syscalls/sys_display.c
r457 r506 31 31 #include <string.h> 32 32 #include <shared_syscalls.h> 33 34 #include <syscalls.h> 33 35 34 36 ///////////////////////////////////////////////////////////////////////////////// -
trunk/kernel/syscalls/sys_exec.c
r492 r506 36 36 #include <rpc.h> 37 37 38 #include <syscalls.h> 38 39 39 40 ////////////////////////////////////////////////i////////////////////////////////////// … … 162 163 // TODO : the args & envs arguments are not supported yet : both must be NULL [AG] 163 164 ///////////////////////////////////////////////////////////////////////////////////////// 164 int sys_exec( c har * pathname,// .elf file pathname165 char ** args, // process arguments166 char ** envs ) // environment variables165 int sys_exec( const char * pathname, // .elf file pathname 166 char ** args, // process arguments 167 char ** envs ) // environment variables 167 168 { 168 169 exec_info_t exec_info; // structure to pass to process_make_exec() -
trunk/kernel/syscalls/sys_exit.c
r457 r506 32 32 #include <cluster.h> 33 33 #include <rpc.h> 34 35 #include <syscalls.h> 34 36 35 37 /////////////////////////////// -
trunk/kernel/syscalls/sys_fg.c
r457 r506 32 32 #include <cluster.h> 33 33 #include <rpc.h> 34 35 #include <syscalls.h> 34 36 35 37 /////////////////////// -
trunk/kernel/syscalls/sys_fork.c
r479 r506 37 37 #include <dqdt.h> 38 38 #include <process.h> 39 40 #include <syscalls.h> 39 41 40 42 ////////////// -
trunk/kernel/syscalls/sys_get_config.c
r457 r506 32 32 #include <printk.h> 33 33 34 #include <syscalls.h> 35 34 36 ////////////////////////////////////// 35 37 int sys_get_config( uint32_t * x_size, 36 38 uint32_t * y_size, 39 uint32_t * y_width, 37 40 uint32_t * ncores ) 38 41 { -
trunk/kernel/syscalls/sys_get_core.c
r457 r506 32 32 #include <printk.h> 33 33 34 #include <syscalls.h> 34 35 35 36 ///////////////////////////////// -
trunk/kernel/syscalls/sys_get_cycle.c
r457 r506 31 31 #include <vmm.h> 32 32 #include <printk.h> 33 34 #include <syscalls.h> 33 35 34 36 ////////////////////////////////////// -
trunk/kernel/syscalls/sys_getcwd.c
r457 r506 32 32 #include <thread.h> 33 33 #include <printk.h> 34 35 #include <syscalls.h> 34 36 35 37 /* TODO: user page(s) need to be locked [AG] */ -
trunk/kernel/syscalls/sys_getpid.c
r479 r506 24 24 #include <thread.h> 25 25 26 #include <syscalls.h> 27 26 28 //////////////// 27 29 int sys_getpid( void ) -
trunk/kernel/syscalls/sys_is_fg.c
r469 r506 33 33 #include <shared_syscalls.h> 34 34 #include <cluster.h> 35 36 #include <syscalls.h> 35 37 36 38 ////////////////////////////// -
trunk/kernel/syscalls/sys_isatty.c
r457 r506 34 34 #include <printk.h> 35 35 #include <process.h> 36 37 #include <syscalls.h> 36 38 37 39 //////////////////////////////////// -
trunk/kernel/syscalls/sys_kill.c
r457 r506 32 32 #include <cluster.h> 33 33 #include <rpc.h> 34 35 #include <syscalls.h> 34 36 35 37 /////////////////////////// -
trunk/kernel/syscalls/sys_mmap.c
r457 r506 35 35 #include <vmm.h> 36 36 37 #include <syscalls.h> 38 37 39 ////////////////////////////////// 38 40 int sys_mmap( mmap_attr_t * attr ) -
trunk/kernel/syscalls/sys_munmap.c
r457 r506 33 33 #include <process.h> 34 34 #include <vmm.h> 35 36 #include <syscalls.h> 35 37 36 38 //////////////////////////////// -
trunk/kernel/syscalls/sys_open.c
r459 r506 33 33 #include <remote_rwlock.h> 34 34 35 #include <syscalls.h> 36 35 37 /////////////////////////////////// 36 int sys_open ( c har* pathname,37 uint32_t flags,38 uint32_t mode )38 int sys_open ( const char * pathname, 39 uint32_t flags, 40 uint32_t mode ) 39 41 { 40 42 error_t error; -
trunk/kernel/syscalls/sys_pipe.c
r473 r506 28 28 #include <printk.h> 29 29 30 #include <syscalls.h> 31 30 32 ////////////////////////////////////// 31 int sys_pipe ( uint32_t *file_fd[2] )33 int sys_pipe ( uint32_t file_fd[2] ) 32 34 { 33 thread_t * this = CURRENT_THREAD;34 35 35 printk("\n[ERROR] in %d : not implemented yet\n", __FUNCTION__, file_fd ); 36 return -1;36 return ENOSYS; 37 37 } -
trunk/kernel/syscalls/sys_read.c
r492 r506 33 33 #include <printk.h> 34 34 #include <process.h> 35 36 #include <syscalls.h> 35 37 36 38 // TODO: concurrent user page(s) munmap need to be handled [AG] -
trunk/kernel/syscalls/sys_rmdir.c
r457 r506 31 31 #include <process.h> 32 32 33 #include <syscalls.h> 34 33 35 //////////////////////////////// 34 int sys_rmdir( c har * pathname )36 int sys_rmdir( const char * pathname ) 35 37 { 36 38 error_t error; -
trunk/kernel/syscalls/sys_signal.c
r473 r506 28 28 #include <printk.h> 29 29 30 #include <syscalls.h> 31 30 32 ////////////////////////////////// 31 33 int sys_signal( uint32_t sig_id, 32 34 void * handler ) 33 { 34 35 { 36 thread_t * this = CURRENT_THREAD; 35 37 process_t * process = this->process; 36 38 37 39 printk("\n[ERROR] in %s : thread %x in process %x / not implemented yet\n", 38 40 __FUNCTION__, this->trdid, process->pid, sig_id, handler ); 39 return -1;41 return ENOSYS; 40 42 } 41 43 -
trunk/kernel/syscalls/sys_stat.c
r457 r506 32 32 #include <process.h> 33 33 34 #include <syscalls.h> 35 34 36 ///////////////////////////////////// 35 int sys_stat( c har* pathname,37 int sys_stat( const char * pathname, 36 38 struct stat * u_stat ) 37 39 { -
trunk/kernel/syscalls/sys_thread_cancel.c
r457 r506 29 29 #include <errno.h> 30 30 #include <printk.h> 31 32 #include <syscalls.h> 31 33 32 34 ////////////////////////////////////// -
trunk/kernel/syscalls/sys_thread_create.c
r457 r506 39 39 #include <rpc.h> 40 40 41 #include <syscalls.h> 41 42 42 43 /////////////////////////////////////////////////// 43 int sys_thread_create ( pthread_t * trdid_ptr, 44 pthread_attr_t * user_attr, 45 void * start_func, 46 void * start_arg ) 44 int sys_thread_create( 45 struct thread_s * new_thread, 46 const struct pthread_attr_s * user_attr, 47 const void * start_func, 48 const void * start_args ) 47 49 { 48 50 pthread_attr_t kern_attr; // copy of pthread attributes in kernel space … … 72 74 73 75 // check trdid buffer in user space 74 error = vmm_get_vseg( process , (intptr_t) trdid_ptr, &vseg );76 error = vmm_get_vseg( process , (intptr_t)new_thread , &vseg ); 75 77 76 78 if ( error ) … … 79 81 #if DEBUG_SYSCALLS_ERROR 80 82 printk("\n[ERROR] in %s : trdid buffer unmapped %x / thread %x / process %x\n", 81 __FUNCTION__ , (intptr_t) trdid_ptr, parent->trdid, process->pid );83 __FUNCTION__ , (intptr_t)new_thread, parent->trdid, process->pid ); 82 84 vmm_display( process , false ); 83 85 #endif … … 121 123 } 122 124 123 // check start_arg buffer in user space124 if( start_arg != NULL )125 { 126 error = vmm_get_vseg( process , (intptr_t)start_arg , &vseg );125 // check start_args buffer in user space 126 if( start_args != NULL ) 127 { 128 error = vmm_get_vseg( process , (intptr_t)start_args , &vseg ); 127 129 128 130 if( error ) … … 130 132 131 133 #if DEBUG_SYSCALLS_ERROR 132 printk("\n[ERROR] in %s : start_arg buffer unmapped %x / thread %x / process %x\n",133 __FUNCTION__ , (intptr_t)start_arg , parent->trdid , process->pid );134 printk("\n[ERROR] in %s : start_args buffer unmapped %x / thread %x / process %x\n", 135 __FUNCTION__ , (intptr_t)start_args , parent->trdid , process->pid ); 134 136 vmm_display( process , false ); 135 137 #endif … … 176 178 error = thread_user_create( process->pid, 177 179 start_func, 178 start_arg ,180 start_args, 179 181 &kern_attr, 180 182 &child_ptr ); … … 187 189 process->pid, 188 190 start_func, 189 start_arg ,191 start_args, 190 192 &kern_attr, 191 193 &child_xp, … … 209 211 // returns trdid to user space 210 212 trdid = hal_remote_lw( XPTR( target_cxy , &child_ptr->trdid ) ); 211 hal_copy_to_uspace( trdid_ptr, &trdid , sizeof(pthread_t) );213 hal_copy_to_uspace( new_thread , &trdid , sizeof(pthread_t) ); 212 214 213 215 // activate new thread -
trunk/kernel/syscalls/sys_thread_detach.c
r457 r506 28 28 #include <errno.h> 29 29 #include <printk.h> 30 31 #include <syscalls.h> 30 32 31 33 ////////////////////////////////////// -
trunk/kernel/syscalls/sys_thread_exit.c
r457 r506 30 30 #include <scheduler.h> 31 31 #include <printk.h> 32 33 #include <syscalls.h> 32 34 33 35 //////////////////////////////////////// -
trunk/kernel/syscalls/sys_thread_join.c
r473 r506 32 32 #include <printk.h> 33 33 #include <remote_spinlock.h> 34 35 #include <syscalls.h> 34 36 35 37 /////////////////////////////////////// -
trunk/kernel/syscalls/sys_thread_sleep.c
r479 r506 26 26 #include <thread.h> 27 27 #include <printk.h> 28 #include <syscalls.h> 28 29 29 30 ////////////////////// -
trunk/kernel/syscalls/sys_thread_wakeup.c
r467 r506 27 27 #include <process.h> 28 28 #include <errno.h> 29 30 #include <syscalls.h> 29 31 30 32 ////////////////////////////////////// -
trunk/kernel/syscalls/sys_thread_yield.c
r479 r506 27 27 #include <thread.h> 28 28 29 #include <syscalls.h> 30 29 31 int sys_thread_yield( void ) 30 32 { -
trunk/kernel/syscalls/sys_timeofday.c
r457 r506 31 31 #include <core.h> 32 32 #include <shared_syscalls.h> 33 34 #include <syscalls.h> 33 35 34 36 //////////////////////////////////////// -
trunk/kernel/syscalls/sys_unlink.c
r457 r506 28 28 #include <printk.h> 29 29 30 #include <syscalls.h> 31 30 32 ////////////////////////////////// 31 int sys_unlink ( c har * pathname )33 int sys_unlink ( const char * pathname ) 32 34 { 33 35 error_t error; -
trunk/kernel/syscalls/sys_wait.c
r457 r506 30 30 #include <vmm.h> 31 31 #include <printk.h> 32 33 #include <syscalls.h> 32 34 33 35 ///////////////////////////////// -
trunk/kernel/syscalls/syscalls.h
r479 r506 36 36 struct mmap_attr_s; // defined in vmm.h 37 37 38 // debug: 39 const char * syscall_str( uint32_t index ); 40 38 41 /****************************************************************************************** 39 42 * [0] This function terminates the execution of the calling user thread, … … 70 73 * @ return 0 if success / return -1 if failure. 71 74 *****************************************************************************************/ 72 int sys_thread_create( struct thread_s * new_thread, 73 struct pthread_attr_s * user_attr, 74 void * start_func, 75 void * start_args ); 75 int sys_thread_create( 76 struct thread_s * new_thread, 77 const struct pthread_attr_s * user_attr, 78 const void * start_func, 79 const void * start_args ); 76 80 77 81 /****************************************************************************************** … … 201 205 * @ return file descriptor index in fd_array if success / return -1 if failure. 202 206 *****************************************************************************************/ 203 int sys_open( c har* pathname,204 uint32_t flags,205 uint32_t mode );207 int sys_open( const char * pathname, 208 uint32_t flags, 209 uint32_t mode ); 206 210 207 211 /****************************************************************************************** … … 276 280 * @ return 0 if success / returns -1 if failure. 277 281 *****************************************************************************************/ 278 int sys_unlink( c har * pathname );282 int sys_unlink( const char * pathname ); 279 283 280 284 /****************************************************************************************** … … 295 299 * @ return 0 if success / returns -1 if failure. 296 300 *****************************************************************************************/ 297 int sys_chdir( c har * pathname );301 int sys_chdir( const char * pathname ); 298 302 299 303 /****************************************************************************************** … … 383 387 * @ return 0 if success / returns -1 if failure. 384 388 *****************************************************************************************/ 385 int sys_rmdir( c har * pathname );389 int sys_rmdir( const char * pathname ); 386 390 387 391 /****************************************************************************************** … … 404 408 * @ return 0 if success / returns -1 if failure. 405 409 *****************************************************************************************/ 406 int sys_chmod( c har* pathname,407 uint32_t rights );410 int sys_chmod( const char * pathname, 411 uint32_t rights ); 408 412 409 413 /****************************************************************************************** … … 490 494 * @ does not return if success / returns -1 if failure. 491 495 *****************************************************************************************/ 492 int sys_exec( c har * filename,493 char ** argv,494 char ** envp );496 int sys_exec( const char * filename, 497 char ** argv, 498 char ** envp ); 495 499 496 500 /****************************************************************************************** … … 610 614 * @ return 0 if success / return -1 if failure. 611 615 *****************************************************************************************/ 612 int sys_thread_wakeup( void );616 int sys_thread_wakeup( trdid_t trdid ); 613 617 614 618 /******************************************************************************************
Note: See TracChangeset
for help on using the changeset viewer.