Changeset 612 for trunk/kernel/syscalls
- Timestamp:
- Jan 11, 2019, 6:35:07 PM (6 years ago)
- Location:
- trunk/kernel/syscalls
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/syscalls/sys_closedir.c
r611 r612 28 28 #include <thread.h> 29 29 #include <process.h> 30 #include < remote_dir.h>30 #include <user_dir.h> 31 31 #include <errno.h> 32 32 #include <syscalls.h> … … 36 36 int sys_closedir ( DIR * dirp ) 37 37 { 38 xptr_t dir_xp; // extended pointer on remote_dir_t structure 38 xptr_t dir_xp; // extended pointer on user_dir_t structure 39 user_dir_t * dir_ptr; // lcal pointer on user_dir_t structure 40 cxy_t dir_cxy; // cluster identifier (inode cluster) 39 41 40 42 thread_t * this = CURRENT_THREAD; // client thread … … 51 53 #endif 52 54 53 // get extended pointer on kernel remote_dir_t structure from dirp54 dir_xp = remote_dir_from_ident( (intptr_t)dirp );55 // get extended pointer on kernel user_dir_t structure from dirp 56 dir_xp = user_dir_from_ident( (intptr_t)dirp ); 55 57 56 58 if( dir_xp == XPTR_NULL ) … … 65 67 } 66 68 67 // delete kernel remote_dir_t structure 68 remote_dir_destroy( dir_xp ); 69 // get cluster and localpointer for user_dir_t structure 70 dir_ptr = GET_PTR( dir_xp ); 71 dir_cxy = GET_CXY( dir_xp ); 72 73 // delete both user_dir_t structure and dirent array 74 if( dir_cxy == local_cxy ) 75 { 76 user_dir_destroy( dir_ptr ); 77 } 78 else 79 { 80 rpc_user_dir_destroy_client( dir_cxy, 81 dir_ptr ); 82 } 69 83 70 84 hal_fence(); -
trunk/kernel/syscalls/sys_display.c
r611 r612 52 52 else if( type == DISPLAY_DQDT ) return "DQDT"; 53 53 else if( type == DISPLAY_BUSYLOCKS ) return "BUSYLOCKS"; 54 else if( type == DISPLAY_MAPPER ) return "MAPPER"; 55 else return "undefined"; 54 56 } 55 57 #endif -
trunk/kernel/syscalls/sys_opendir.c
r611 r612 1 1 /* 2 * sys_opendir.c - Open a VFS directory.2 * sys_opendir.c - Open an user accessible VFS directory. 3 3 * 4 4 * Author Alain Greiner (2016,2017,2018) … … 27 27 #include <thread.h> 28 28 #include <process.h> 29 #include < remote_dir.h>29 #include <user_dir.h> 30 30 #include <printk.h> 31 31 #include <errno.h> … … 45 45 cxy_t inode_cxy; // directory inode cluster 46 46 uint32_t inode_type; // to check directory inode type 47 xptr_t dir_xp; // extended pointer on remote_dir_t 48 remote_dir_t * dir_ptr; // local pointer on remote_dir_t 49 cxy_t dir_cxy; // remote_dir_t cluster identifier 47 user_dir_t * dir_ptr; // local pointer on user_dir_t 50 48 vseg_t * vseg; // for user space checking 51 49 intptr_t ident; // dirent array pointer in user space … … 145 143 } 146 144 147 // allocate, initialize, and register a new remote_dir_t structure 148 // in the calling process reference cluster 149 dir_xp = remote_dir_create( inode_xp ); 150 dir_ptr = GET_PTR( dir_xp ); 151 dir_cxy = GET_CXY( dir_xp ); 145 // create a new user_dir_t structure in inode cluster 146 // and get the user space pointer on dirent array 147 if( inode_cxy == local_cxy ) 148 { 149 dir_ptr = user_dir_create( inode_ptr ); 150 } 151 else 152 { 153 rpc_user_dir_create_client( inode_cxy, 154 inode_ptr, 155 &dir_ptr ); 156 } 152 157 153 if( dir_ xp == XPTR_NULL )158 if( dir_ptr == NULL ) 154 159 { 155 160 156 161 #if DEBUG_SYSCALLS_ERROR 157 printk("\n[ERROR] in %s / thread[%x,%x] : cannot create remote_dir for <%s>\n",162 printk("\n[ERROR] in %s / thread[%x,%x] : cannot create user_dir for <%s>\n", 158 163 __FUNCTION__ , process->pid , this->trdid , kbuf ); 159 164 #endif … … 162 167 } 163 168 164 // get ident from remote_dir structure165 ident = (intptr_t)hal_remote_lpt( XPTR( dir_cxy , &dir_ptr->ident ) );169 // get ident from user_dir structure 170 ident = (intptr_t)hal_remote_lpt( XPTR( inode_cxy , &dir_ptr->ident ) ); 166 171 167 172 // set ident value in user buffer -
trunk/kernel/syscalls/sys_readdir.c
r611 r612 30 30 #include <vfs.h> 31 31 #include <process.h> 32 #include < remote_dir.h>32 #include <user_dir.h> 33 33 #include <syscalls.h> 34 34 #include <shared_syscalls.h> … … 40 40 error_t error; 41 41 vseg_t * vseg; // for user space checking of buffer 42 xptr_t dir_xp; // extended pointer on remote_dir_tstructure43 remote_dir_t * dir_ptr; // local pointer on remote_dir_tstructure44 cxy_t dir_cxy; // remote_dir_tstucture cluster identifier42 xptr_t dir_xp; // extended pointer on user_dir structure 43 user_dir_t * dir_ptr; // local pointer on user_dir structure 44 cxy_t dir_cxy; // user_dir stucture cluster identifier 45 45 struct dirent * direntp; // dirent pointer in user space 46 46 uint32_t entries; // total number of dirent entries … … 75 75 } 76 76 77 // get pointers on remote_dir_tstructure from dirp78 dir_xp = remote_dir_from_ident( (intptr_t)dirp );77 // get pointers on user_dir structure from dirp 78 dir_xp = user_dir_from_ident( (intptr_t)dirp ); 79 79 dir_ptr = GET_PTR( dir_xp ); 80 80 dir_cxy = GET_CXY( dir_xp ); … … 91 91 } 92 92 93 // get "current" and "entries_nr" values from remote_dir_t structure93 // get "current" and "entries_nr" values from user_dir_t structure 94 94 current = hal_remote_l32( XPTR( dir_cxy , &dir_ptr->current ) ); 95 95 entries = hal_remote_l32( XPTR( dir_cxy , &dir_ptr->entries ) ); … … 114 114 hal_copy_to_uspace( buffer, &direntp , sizeof(void *) ); 115 115 116 // update current index in "remote_dir_t"structure116 // update current index in user_dir structure 117 117 hal_remote_atomic_add( XPTR( dir_cxy , &dir_ptr->current ) , 1 ); 118 118
Note: See TracChangeset
for help on using the changeset viewer.