Changeset 430
- Timestamp:
- Jan 29, 2018, 6:10:17 PM (7 years ago)
- Location:
- trunk/kernel/fs
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/fs/devfs.c
r407 r430 387 387 assert( ( size < CONFIG_TXT_KBUF_SIZE ) , __FUNCTION__ , "string size too large" ); 388 388 389 cxy_t file_cxy; // remote file descriptor cluster 390 vfs_file_t * file_ptr; // remote file descriptor local pointer 391 vfs_inode_type_t inode_type; // associated inode type 392 vfs_inode_t * inode_ptr; // associated inode local pointer 389 xptr_t chdev_xp; 390 cxy_t chdev_cxy; 393 391 chdev_t * chdev_ptr; // associated chdev type 394 392 uint32_t func; // chdev functionnal type … … 405 403 #endif 406 404 407 // get cluster and local pointer on remote file descriptor 408 // associated inode and chdev are stored in same cluster as the file desc. 409 file_cxy = GET_CXY( file_xp ); 410 file_ptr = (vfs_file_t *)GET_PTR( file_xp ); 411 412 // get inode type from remote file descriptor 413 inode_type = hal_remote_lw( XPTR( file_cxy , &file_ptr->type ) ); 414 inode_ptr = (vfs_inode_t *)hal_remote_lpt( XPTR( file_cxy , &file_ptr->inode ) ); 415 416 assert( (inode_type == INODE_TYPE_DEV) , __FUNCTION__ , 417 "inode type is not INODE_TYPE_DEV" ); 418 419 // get chdev local pointer from remote inode extension 420 chdev_ptr = (chdev_t *)hal_remote_lpt( XPTR( file_cxy , &inode_ptr->extend ) ); 421 405 // get extended pointer on chdev_xp 406 chdev_xp = chdev_from_file( file_xp ); 407 408 // get cluster and local pointer on chdev 409 chdev_cxy = GET_CXY( chdev_xp ); 410 chdev_ptr = (chdev_t *)GET_PTR( chdev_xp ); 411 422 412 // get chdev functionnal type and channel 423 func = hal_remote_lw( XPTR( file_cxy , &chdev_ptr->func ) );424 channel = hal_remote_lw( XPTR( file_cxy , &chdev_ptr->channel ) );413 func = hal_remote_lw( XPTR( chdev_cxy , &chdev_ptr->func ) ); 414 channel = hal_remote_lw( XPTR( chdev_cxy , &chdev_ptr->channel ) ); 425 415 426 416 // action depends on "func" and "to_buffer" … … 482 472 else 483 473 { 484 panic("device type %s does not support direct user access", chdev_func_str(func) ); 474 assert( false , __FUNCTION__ , 475 "%s does not support direct user access", chdev_func_str(func) ); 485 476 486 477 return -1; -
trunk/kernel/fs/vfs.c
r409 r430 35 35 #include <slist.h> 36 36 #include <xhtab.h> 37 #include <string.h> 37 38 #include <rpc.h> 38 39 #include <errno.h> … … 166 167 { 167 168 ctx = NULL; 168 panic("illegal file system type = %d" , fs_type );169 assert( false , __FUNCTION__ , "illegal file system type = %d\n" , fs_type ); 169 170 } 170 171 … … 243 244 if( inode->refcount ) 244 245 { 245 panic("inode refcount non zero");246 assert( false , __FUNCTION__ , "inode refcount non zero\n" ); 246 247 } 247 248 … … 425 426 { 426 427 ctx = NULL; 427 panic("undefined file system type");428 assert( false , __FUNCTION__ , "undefined file system type\n" ); 428 429 } 429 430 … … 476 477 if( dentry->refcount ) 477 478 { 478 panic("dentry refcount non zero");479 assert( false , __FUNCTION__ , "dentry refcount non zero\n" ); 479 480 } 480 481 … … 529 530 if( file->refcount ) 530 531 { 531 panic("file refcount non zero");532 assert( false , __FUNCTION__ , "refcount non zero\n" ); 532 533 } 533 534 … … 883 884 char * path ) 884 885 { 885 panic("not implemented");886 assert( false , __FUNCTION__ , "not implemented\n" ); 886 887 return 0; 887 888 } … … 891 892 struct stat * k_stat ) 892 893 { 893 panic("not implemented");894 assert( false , __FUNCTION__ , "not implemented\n" ); 894 895 return 0; 895 896 } … … 899 900 struct dirent * k_dirent ) 900 901 { 901 panic("not implemented");902 assert( false , __FUNCTION__ , "not implemented\n" ); 902 903 return 0; 903 904 } … … 908 909 uint32_t mode ) 909 910 { 910 panic("not implemented");911 assert( false , __FUNCTION__ , "not implemented\n" ); 911 912 return 0; 912 913 } … … 916 917 char * path ) 917 918 { 918 panic("not implemented");919 assert( false , __FUNCTION__ , "not implemented\n" ); 919 920 return 0; 920 921 } … … 952 953 } 953 954 954 panic("not fully implemented");955 assert( false , __FUNCTION__ , "not implemented\n" ); 955 956 return 0; 956 957 } … … 984 985 985 986 986 panic("not fully implemented");987 assert( false , __FUNCTION__ , "not implemented\n" ); 987 988 return 0; 988 989 } … … 993 994 uint32_t rights ) 994 995 { 995 panic("not implemented");996 assert( false , __FUNCTION__ , "not implemented\n" ); 996 997 return 0; 997 998 } -
trunk/kernel/fs/vfs.h
r409 r430 159 159 typedef enum 160 160 { 161 INODE_TYPE_FILE = 0 x001, /*! file*/162 INODE_TYPE_DIR = 0x002, /*! directory*/163 INODE_TYPE_FIFO = 0x004, /*! POSIX named pipe*/164 INODE_TYPE_PIPE = 0x008, /*! POSIX anonymous pipe*/165 INODE_TYPE_SOCK = 0x010, /*! POSIX socket*/166 INODE_TYPE_DEV = 0x020, /*! device channel*/167 INODE_TYPE_SYML = 0x080, /*! symbolic link*/161 INODE_TYPE_FILE = 0, /*! file */ 162 INODE_TYPE_DIR = 1, /*! directory */ 163 INODE_TYPE_FIFO = 2, /*! POSIX named pipe */ 164 INODE_TYPE_PIPE = 3, /*! POSIX anonymous pipe */ 165 INODE_TYPE_SOCK = 4, /*! POSIX socket */ 166 INODE_TYPE_DEV = 5, /*! device channel */ 167 INODE_TYPE_SYML = 6, /*! symbolic link */ 168 168 } 169 169 vfs_inode_type_t;
Note: See TracChangeset
for help on using the changeset viewer.