Changeset 614 for trunk/kernel/mm/mapper.c
- Timestamp:
- Jan 15, 2019, 1:59:32 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/mm/mapper.c
r611 r614 28 28 #include <hal_uspace.h> 29 29 #include <grdxt.h> 30 #include <string.h> 30 31 #include <rwlock.h> 31 32 #include <printk.h> … … 41 42 #include <vfs.h> 42 43 #include <mapper.h> 44 #include <dev_ioc.h> 43 45 44 46 … … 302 304 303 305 // launch I/O operation to load page from device to mapper 304 error = vfs_fs_move_page( XPTR( local_cxy , page ) , true);306 error = vfs_fs_move_page( XPTR( local_cxy , page ) , IOC_SYNC_READ ); 305 307 306 308 if( error ) … … 647 649 error_t mapper_display_page( xptr_t mapper_xp, 648 650 uint32_t page_id, 649 uint32_t nbytes, 650 char * string ) 651 { 652 xptr_t page_xp; // extended pointer on page descriptor 653 xptr_t base_xp; // extended pointer on page base 654 char buffer[4096]; // local buffer 655 uint32_t * tab; // pointer on uint32_t to scan the buffer 656 uint32_t line; // line index 657 uint32_t word; // word index 651 uint32_t nbytes ) 652 { 653 xptr_t page_xp; // extended pointer on page descriptor 654 xptr_t base_xp; // extended pointer on page base 655 char buffer[4096]; // local buffer 656 uint32_t * tabi; // pointer on uint32_t to scan buffer 657 char * tabc; // pointer on char to scan buffer 658 uint32_t line; // line index 659 uint32_t word; // word index 660 uint32_t n; // char index 661 cxy_t mapper_cxy; // mapper cluster identifier 662 mapper_t * mapper_ptr; // mapper local pointer 663 vfs_inode_t * inode_ptr; // inode local pointer 664 665 char name[CONFIG_VFS_MAX_NAME_LENGTH]; 658 666 659 667 if( nbytes > 4096) … … 674 682 } 675 683 684 // get cluster and local pointer 685 mapper_cxy = GET_CXY( mapper_xp ); 686 mapper_ptr = GET_PTR( mapper_xp ); 687 688 // get inode 689 inode_ptr = hal_remote_lpt( XPTR( mapper_cxy , &mapper_ptr->inode ) ); 690 691 // get inode name 692 if( inode_ptr == NULL ) strcpy( name , "fat" ); 693 else vfs_inode_get_name( XPTR( mapper_cxy , inode_ptr ) , name ); 694 676 695 // get extended pointer on page base 677 696 base_xp = ppm_page2base( page_xp ); … … 681 700 682 701 // display 8 words per line 683 tab = (uint32_t *)buffer; 684 printk("\n***** %s : first %d bytes of page %d *****\n", string, nbytes, page_id ); 702 tabi = (uint32_t *)buffer; 703 tabc = (char *)buffer; 704 printk("\n***** <%s> first %d bytes of page %d *****\n", name, nbytes, page_id ); 685 705 for( line = 0 ; line < (nbytes >> 5) ; line++ ) 686 706 { 687 707 printk("%X : ", line ); 688 for( word = 0 ; word < 8 ; word++ ) printk("%X ", tab[(line<<3) + word] ); 708 for( word = 0 ; word < 8 ; word++ ) printk("%X ", tabi[(line<<3) + word] ); 709 printk(" | "); 710 for( n = 0 ; n < 32 ; n++ ) printk("%c", tabc[(line<<5) + n] ); 689 711 printk("\n"); 690 712 }
Note: See TracChangeset
for help on using the changeset viewer.