Changeset 430 for trunk/kernel/fs/devfs.c
- Timestamp:
- Jan 29, 2018, 6:10:17 PM (7 years ago)
- File:
-
- 1 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;
Note: See TracChangeset
for help on using the changeset viewer.