Changeset 683 for trunk/kernel/fs/fatfs.c
- Timestamp:
- Jan 13, 2021, 12:36:17 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/fs/fatfs.c
r673 r683 1630 1630 xptr_t fatfs_ctx_alloc( cxy_t cxy ) 1631 1631 { 1632 kmem_req_t req;1633 1634 1632 // allocate memory from remote cluster 1635 req.type = KMEM_KCM; 1636 req.order = bits_log2( sizeof(fatfs_ctx_t) ); 1637 req.flags = AF_KERNEL | AF_ZERO; 1638 1639 return XPTR( cxy , kmem_remote_alloc( cxy , &req ) ); 1633 void * ptr = kmem_remote_alloc( cxy, 1634 bits_log2(sizeof(fatfs_ctx_t)), 1635 AF_ZERO ); 1636 1637 if( ptr == NULL ) return XPTR_NULL; 1638 else return XPTR( cxy , ptr ); 1640 1639 1641 1640 } //end faffs_ctx_alloc() … … 1645 1644 { 1646 1645 error_t error; 1647 kmem_req_t req;1648 1646 cxy_t cxy; // FATFS context cluster identifier 1649 1647 fatfs_ctx_t * fatfs_ctx_ptr; // local pointer on FATFS context … … 1667 1665 // allocate a 512 bytes buffer in remote cluster, used to store 1668 1666 // temporarily the BOOT sector, and permanently the FS_INFO sector 1669 req.type = KMEM_KCM; 1670 req.order = 9; // 512 bytes 1671 req.flags = AF_KERNEL | AF_ZERO; 1672 buffer = kmem_remote_alloc( cxy , &req ); 1673 1667 buffer = kmem_remote_alloc( cxy, 1668 9, 1669 AF_ZERO ); 1674 1670 if( buffer == NULL ) 1675 1671 { … … 1827 1823 void fatfs_ctx_destroy( xptr_t fatfs_ctx_xp ) 1828 1824 { 1829 kmem_req_t req;1830 1825 mapper_t * fat_mapper; 1831 1826 uint8_t * fs_info_buffer; … … 1844 1839 fs_info_buffer = hal_remote_lpt( XPTR( fatfs_ctx_cxy , &fatfs_ctx_ptr->fs_info_buffer ) ); 1845 1840 1846 // release FS_INFO buffer 1847 req.type = KMEM_KCM;1848 req.ptr = fs_info_buffer;1849 kmem_remote_free( fatfs_ctx_cxy , &req );1841 // release FS_INFO buffer (512 bytes) 1842 kmem_remote_free( fatfs_ctx_cxy, 1843 fs_info_buffer, 1844 9 ); 1850 1845 1851 1846 // release FATFS context descriptor 1852 req.type = KMEM_KCM;1853 req.ptr = fatfs_ctx_ptr;1854 kmem_remote_free( fatfs_ctx_cxy , &req);1847 kmem_remote_free( fatfs_ctx_cxy, 1848 fatfs_ctx_ptr, 1849 bits_log2(sizeof(fatfs_ctx_t)) ); 1855 1850 1856 1851 } // end fatfs_ctx_destroy() … … 2857 2852 2858 2853 // compute number of pages 2859 npages = size >> CONFIG_PPM_PAGE_ SHIFT;2854 npages = size >> CONFIG_PPM_PAGE_ORDER; 2860 2855 if( size & CONFIG_PPM_PAGE_MASK ) npages++; 2861 2856
Note: See TracChangeset
for help on using the changeset viewer.