Changeset 315 for trunk/kernel
- Timestamp:
- Aug 3, 2017, 10:15:18 AM (7 years ago)
- Location:
- trunk/kernel
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/kern/rpc.c
r313 r315 1404 1404 user_buffer = (void *)(intptr_t)hal_remote_lwd( XPTR( client_cxy , &desc->args[4] ) ); 1405 1405 1406 error = mapper_move_user _buffer( mapper,1407 1408 1409 1410 1406 error = mapper_move_user( mapper, 1407 to_buffer, 1408 file_offset, 1409 user_buffer, 1410 size ); 1411 1411 } 1412 1412 else … … 1414 1414 kern_buffer = (xptr_t)hal_remote_lwd( XPTR( client_cxy , &desc->args[4] ) ); 1415 1415 1416 error = mapper_move_ user_buffer( mapper,1417 1418 1419 1420 1416 error = mapper_move_kernel( mapper, 1417 to_buffer, 1418 file_offset, 1419 kern_buffer, 1420 size ); 1421 1421 } 1422 1422 -
trunk/kernel/kern/thread.c
r296 r315 82 82 page = kmem_alloc( &req ); 83 83 84 if( page == NULL ) return NULL; 85 84 86 // return pointer on new thread descriptor 85 if( page == NULL ) return NULL; 86 else return (thread_t *)ppm_page2vaddr( page ); 87 } 87 xptr_t base_xp = ppm_page2base( XPTR(local_cxy , page ) ); 88 return (thread_t *)GET_PTR( base_xp ); 89 90 } // end thread_alloc() 91 88 92 89 93 ///////////////////////////////////////////////////////////////////////////////////// … … 100 104 kmem_req_t req; 101 105 106 xptr_t base_xp = ppm_base2page( XPTR(local_cxy , thread ) ); 107 102 108 req.type = KMEM_PAGE; 103 req.ptr = ppm_vaddr2page( thread);109 req.ptr = GET_PTR( base_xp ); 104 110 kmem_free( &req ); 105 111 } -
trunk/kernel/libk/elf.c
r313 r315 89 89 90 90 // load .elf header 91 count = vfs_move( true, // to_buffer 92 false, // is_user 93 file_xp, 94 buffer, 95 size ); 91 count = vfs_user_move( true, // to_buffer 92 file_xp, 93 buffer, 94 size ); 96 95 97 96 if( count != size ) … … 135 134 process_t * process ) 136 135 { 137 error_t error;138 136 uint32_t index; 139 137 intptr_t file_size; … … 163 161 { 164 162 type = VSEG_TYPE_CODE; 165 process->vmm.code_vpn_base = start>> CONFIG_PPM_PAGE_SHIFT;163 process->vmm.code_vpn_base = vbase >> CONFIG_PPM_PAGE_SHIFT; 166 164 167 165 elf_dmsg("\n[INFO] %s : found CODE vseg / base = %x / size = %x\n", 168 __FUNCTION__ , start, mem_size );166 __FUNCTION__ , vbase , mem_size ); 169 167 } 170 168 else // found DATA segment 171 169 { 172 170 type = VSEG_TYPE_DATA; 173 process->vmm.data_vpn_base = start>> CONFIG_PPM_PAGE_SHIFT;171 process->vmm.data_vpn_base = vbase >> CONFIG_PPM_PAGE_SHIFT; 174 172 175 173 elf_dmsg("\n[INFO] %s : found DATA vseg / base = %x / size = %x\n", 176 __FUNCTION__, start, mem_size );174 __FUNCTION__, vbase , mem_size ); 177 175 } 178 176 … … 194 192 195 193 // initialize "file_mapper", "file_offset", "file_size" fields in vseg 196 vseg-> file_mapper = hal_remote_lwd( XPTR( file_cxy , &file_ptr->mapper);194 vseg->mapper_xp = (xptr_t)hal_remote_lwd( XPTR( file_cxy , &file_ptr->mapper ) ); 197 195 vseg->file_offset = file_offset; 198 196 vseg->file_size = file_size; … … 289 287 290 288 // load seg descriptors array to local buffer 291 count = vfs_move( true, // to_buffer 292 false, // is_user 293 file_xp, 294 segs_base, 295 segs_size ); 289 count = vfs_user_move( true, // to_buffer 290 file_xp, 291 segs_base, 292 segs_size ); 296 293 297 294 if( count != segs_size ) -
trunk/kernel/mm/kcm.c
r182 r315 160 160 161 161 // get page base address 162 kcm_page = (kcm_page_t *)ppm_page2vaddr( page ); 162 xptr_t base_xp = ppm_page2base( XPTR( local_cxy , page ) ); 163 kcm_page = (kcm_page_t *)GET_PTR( base_xp ); 163 164 164 165 // initialize KCM-page descriptor -
trunk/kernel/mm/khm.c
r175 r315 51 51 // get kernel heap base from PPM 52 52 page_t * page = ppm_alloc_pages( CONFIG_PPM_HEAP_ORDER ); 53 void * heap_base = ppm_page2vaddr( page ); 53 xptr_t base_xp = ppm_page2base( XPTR( local_cxy, page ) ); 54 void * heap_base = GET_PTR( base_xp ); 54 55 55 56 // initialize first block (complete heap) -
trunk/kernel/mm/mapper.c
r313 r315 349 349 350 350 // compute pointer in mapper 351 map_ptr = (uint8_t *)ppm_page2vaddr( page ) + page_offset; 351 xptr_t base_xp = ppm_page2base( XPTR( local_cxy, page ) ); 352 map_ptr = (uint8_t *)GET_PTR( base_xp ) + page_offset; 352 353 353 354 // compute pointer in buffer … … 446 447 if ( page == NULL ) return EINVAL; 447 448 449 // get page base address 450 uint8_t * base = (uint8_t *)GET_PTR( XPTR( local_cxy , page ) ); 451 448 452 // compute source and destination pointers 449 453 if( to_buffer ) 450 454 { 451 dst_ptr = buf _ptr + done;452 src_ptr = (uint8_t *)ppm_page2vaddr( page )+ page_offset;455 dst_ptr = buffer_ptr + done; 456 src_ptr = base + page_offset; 453 457 } 454 458 else 455 459 { 456 src_ptr = buf _ptr + done;457 dst_ptr = (uint8_t *)ppm_page2vaddr( page )+ page_offset;460 src_ptr = buffer_ptr + done; 461 dst_ptr = base + page_offset; 458 462 459 463 page_do_dirty( page ); -
trunk/kernel/mm/mapper.h
r313 r315 130 130 * @ mapper : local pointer on mapper. 131 131 * @ to_buffer : mapper -> buffer if true / buffer -> mapper if false. 132 * @ is_user : user space buffer if true / kernel local buffer if false.133 132 * @ file_offset : first byte to move in file. 134 133 * @ buffer : user space pointer on user buffer. … … 138 137 error_t mapper_move_user( mapper_t * mapper, 139 138 bool_t to_buffer, 140 bool_t is_user,141 139 uint32_t file_offset, 142 140 void * buffer, -
trunk/kernel/mm/page.c
r296 r315 232 232 } 233 233 234 //////////////////////////////235 void page_copy( page_t * dst,236 page_t * src )237 {238 uint32_t size;239 void * src_base;240 void * dst_base;241 242 assert( (dst->order == src->order) , __FUNCTION__ , "src size != dst size\n" );243 244 size = (1 << dst->order) * CONFIG_PPM_PAGE_SIZE;245 src_base = ppm_page2vaddr( src );246 dst_base = ppm_page2vaddr( dst );247 248 memcpy( dst_base , src_base , size );249 }250 251 234 /////////////////////////////// 252 235 void page_zero( page_t * page ) 253 236 { 254 uint32_t size; 255 void * base; 256 257 size = (1 << page->order) * CONFIG_PPM_PAGE_SIZE; 258 base = ppm_page2vaddr( page ); 259 260 memset( base , 0 , size ); 237 uint32_t size = (1 << page->order) * CONFIG_PPM_PAGE_SIZE; 238 239 xptr_t base_xp = ppm_page2base( XPTR( local_cxy , page ) ); 240 241 memset( GET_PTR( base_xp ) , 0 , size ); 261 242 } 262 243 … … 266 247 printk("*** Page %d : base = %x / flags = %x / order = %d / count = %d\n", 267 248 page->index, 268 ppm_page2vaddr( page),249 GET_PTR( ppm_page2base( XPTR( local_cxy , page ) ) ), 269 250 page->flags, 270 251 page->order, -
trunk/kernel/mm/page.h
r68 r315 132 132 133 133 /************************************************************************************* 134 * This function makes a local copy of the content of a src page to a dst page.135 *************************************************************************************136 * @ dst : pointer on destination page descriptor.137 * @ src : pointer on source page descriptor.138 ************************************************************************************/139 void page_copy( page_t * dst,140 page_t * src );141 142 /*************************************************************************************143 134 * This function resets to 0 all bytes in a given page. 144 135 ************************************************************************************* -
trunk/kernel/mm/ppm.c
r313 r315 47 47 48 48 49 49 50 ///////////////////////////////////////////// 50 inline void * ppm_page2vaddr( page_t * page ) 51 { 52 ppm_t * ppm = &LOCAL_CLUSTER->ppm; 53 return ppm->vaddr_base + ((page - ppm->pages_tbl) << CONFIG_PPM_PAGE_SHIFT); 54 } 55 56 ////////////////////////////////////////////// 57 inline page_t * ppm_vaddr2page( void * vaddr ) 58 { 59 ppm_t * ppm = &LOCAL_CLUSTER->ppm; 60 return ppm->pages_tbl + (vaddr - ppm->vaddr_base); 61 } 51 inline xptr_t ppm_page2base( xptr_t page_xp ) 52 { 53 ppm_t * ppm = &LOCAL_CLUSTER->ppm; 54 55 cxy_t page_cxy = GET_CXY( page_xp ); 56 page_t * page_ptr = (page_t *)GET_PTR( page_xp ); 57 58 void * base_ptr = ppm->vaddr_base + 59 ((page_ptr - ppm->pages_tbl)<<CONFIG_PPM_PAGE_SHIFT); 60 61 return XPTR( page_cxy , base_ptr ); 62 63 } // end ppm_page2base() 64 65 ///////////////////////////////////////////// 66 inline xptr_t ppm_base2page( xptr_t base_xp ) 67 { 68 ppm_t * ppm = &LOCAL_CLUSTER->ppm; 69 70 cxy_t base_cxy = GET_CXY( base_xp ); 71 void * base_ptr = (void *)GET_PTR( base_xp ); 72 73 page_t * page_ptr = ppm->pages_tbl + 74 ((base_ptr - ppm->vaddr_base)>>CONFIG_PPM_PAGE_SHIFT); 75 76 return XPTR( base_cxy , page_ptr ); 77 78 } // end ppm_base2page() 79 80 81 82 /////////////////////////////////////////// 83 inline ppn_t ppm_page2ppn( xptr_t page_xp ) 84 { 85 ppm_t * ppm = &LOCAL_CLUSTER->ppm; 86 87 cxy_t page_cxy = GET_CXY( page_xp ); 88 page_t * page_ptr = (page_t *)GET_PTR( page_xp ); 89 90 paddr_t paddr = PADDR( page_cxy , (page_ptr - ppm->pages_tbl)<<CONFIG_PPM_PAGE_SHIFT ); 91 92 return paddr >> CONFIG_PPM_PAGE_SHIFT; 93 94 } // end hal_page2ppn() 95 96 /////////////////////////////////////// 97 inline xptr_t ppm_ppn2page( ppn_t ppn ) 98 { 99 ppm_t * ppm = &LOCAL_CLUSTER->ppm; 100 101 paddr_t paddr = ppn << CONFIG_PPM_PAGE_SHIFT; 102 103 cxy_t page_cxy = CXY_FROM_PADDR( paddr ); 104 lpa_t page_lpa = LPA_FROM_PADDR( paddr ); 105 106 return XPTR( page_cxy , &ppm->pages_tbl[page_lpa>>CONFIG_PPM_PAGE_SHIFT] ); 107 108 } // end hal_ppn2page 109 110 111 112 /////////////////////////////////////// 113 inline xptr_t ppm_ppn2base( ppn_t ppn ) 114 { 115 ppm_t * ppm = &LOCAL_CLUSTER->ppm; 116 117 paddr_t paddr = ppn << CONFIG_PPM_PAGE_SHIFT; 118 119 cxy_t page_cxy = CXY_FROM_PADDR( paddr ); 120 lpa_t page_lpa = LPA_FROM_PADDR( paddr ); 121 122 void * base_ptr = (void *)ppm->vaddr_base + (page_lpa & ~CONFIG_PPM_PAGE_SHIFT); 123 124 return XPTR( page_cxy , base_ptr ); 125 126 } // end ppm_ppn2base() 127 128 /////////////////////////////////////////// 129 inline ppn_t ppm_base2ppn( xptr_t base_xp ) 130 { 131 ppm_t * ppm = &LOCAL_CLUSTER->ppm; 132 133 cxy_t base_cxy = GET_CXY( base_xp ); 134 void * base_ptr = (void *)GET_PTR( base_xp ); 135 136 paddr_t paddr = PADDR( base_cxy , (base_ptr - ppm->vaddr_base) ); 137 138 return paddr >> CONFIG_PPM_PAGE_SHIFT; 139 140 } // end ppm_base2ppn() 141 142 62 143 63 144 /////////////////////////////////////////// -
trunk/kernel/mm/ppm.h
r313 r315 106 106 inline bool_t ppm_page_is_valid( page_t * page ); 107 107 108 /***************************************************************************************** 109 * Get the page virtual address from the page descriptor pointer. 110 ***************************************************************************************** 111 * @ page : pointer to page descriptor 112 * @ returns virtual address of page itself. 113 ****************************************************************************************/ 114 inline void* ppm_page2vaddr( page_t * page ); 108 115 109 116 110 /***************************************************************************************** 117 * Get the page descriptor pointer from the page virtual address.111 * Get extended pointer on page base from extended pointer on page descriptor. 118 112 ***************************************************************************************** 119 * @ vaddr : page virtual address120 * @ returns pointer on page descriptor113 * @ page_xp : extended pointer to page descriptor 114 * @ returns extended pointer on page base. 121 115 ****************************************************************************************/ 122 inline page_t * ppm_vaddr2page( void * vaddr ); 116 inline xptr_t ppm_page2base( xptr_t page_xp ); 117 118 /***************************************************************************************** 119 * Get extended pointer on page descriptor from extended pointer on page base. 120 ***************************************************************************************** 121 * @ base_xp : extended pointer to page base. 122 * @ returns extended pointer on page descriptor 123 ****************************************************************************************/ 124 inline xptr_t ppm_base2page( xptr_t base_xp ); 125 126 127 128 /***************************************************************************************** 129 * Get extended pointer on page base from Global PPN. 130 ***************************************************************************************** 131 * @ ppn : global physical page number. 132 * @ returns extended pointer on page base. 133 ****************************************************************************************/ 134 inline xptr_t ppm_ppn2base( ppn_t ppn ); 135 136 /***************************************************************************************** 137 * Get global PPN from extended pointer on page base. 138 ***************************************************************************************** 139 * @ base_xp : extended pointer to page base. 140 * @ returns global physical page number. 141 ****************************************************************************************/ 142 inline ppn_t ppm_base2ppn( xptr_t base_xp ); 143 144 145 146 /***************************************************************************************** 147 * Get global PPN from extended pointer on page descriptor. 148 ***************************************************************************************** 149 * @ page_xp : pointer to page descriptor 150 * @ returns global physical page number. 151 ****************************************************************************************/ 152 inline ppn_t ppm_page2ppn( xptr_t page_xp ); 153 154 /***************************************************************************************** 155 * Get extended pointer on page descriptor from global PPN. 156 ***************************************************************************************** 157 * @ ppn : global physical page number 158 * @ returns extended pointer on page descriptor. 159 ****************************************************************************************/ 160 inline xptr_t ppm_ppn2page( ppn_t ppn ); 161 162 123 163 124 164 /***************************************************************************************** -
trunk/kernel/mm/vmm.c
r313 r315 524 524 525 525 // initialize vseg descriptor 526 vseg_init( vseg , base, size , vpn_base , vpn_size , type , local_cxy , 0 , 0);526 vseg_init( vseg , base, size , vpn_base , vpn_size , type , local_cxy ); 527 527 528 528 // update "heap_vseg" in VMM … … 633 633 634 634 // set page table entry 635 ppn = ppm_page2ppn( page);635 ppn = ppm_page2ppn( XPTR( local_cxy , page ) ); 636 636 error = hal_gpt_set_pte( gpt , vpn , ppn , attr ); 637 637 if( error ) … … 752 752 uint32_t type = vseg->type; 753 753 xptr_t mapper_xp = vseg->mapper_xp; 754 uint32_t flags = vseg->flags; 754 755 755 756 // get mapper cluster and local pointer … … 816 817 817 818 // compute missing page offset in .elf file 818 intptr_t page_offset = vseg->file_offset + (page_index << PPM_PAGE_SHIFT); 819 820 // compute both local and extended pointer on page first byte 821 // WARNING : the pages_offset must have the same value in all clusters !!! 822 // to use this ppm_page2vaddr() function for a remote cluster 823 uint8_t * base_ptr = (uint8_t *)ppm_page2vaddr( page_ptr ); 824 xptr_t base_xp = XPTR( page_cxy , base_ptr ); 819 intptr_t page_offset = vseg->file_offset + 820 (page_index << CONFIG_PPM_PAGE_SHIFT); 821 822 // compute extended pointer on page first byte 823 xptr_t base_xp = ppm_page2base( XPTR( page_cxy , page_ptr ) ); 825 824 826 825 // file_size can be smaller than vseg_size for BSS 827 file_size = vseg->file_size;828 829 if( file_size < page_offset ) // pagefully in BSS826 intptr_t file_size = vseg->file_size; 827 828 if( file_size < page_offset ) // fully in BSS 830 829 { 831 830 if( page_cxy == local_cxy ) 832 831 { 833 memset( base_ptr , 0 ,PPM_PAGE_SIZE );832 memset( GET_PTR( base_xp ) , 0 , CONFIG_PPM_PAGE_SIZE ); 834 833 } 835 834 else 836 835 { 837 hal_remote_memset( base_xp , 0 , PPM_PAGE_SIZE );836 hal_remote_memset( base_xp , 0 , CONFIG_PPM_PAGE_SIZE ); 838 837 } 839 838 } 840 else if( file size >= (page_offset + PPM_PAGE_SIZE) ) // pagefully in mapper841 839 else if( file_size >= (page_offset + CONFIG_PPM_PAGE_SIZE) ) // fully in mapper 840 { 842 841 if( mapper_cxy == local_cxy ) 843 842 { … … 846 845 page_offset, 847 846 base_xp, 848 PPM_PAGE_SIZE );847 CONFIG_PPM_PAGE_SIZE ); 849 848 } 850 849 else … … 856 855 page_offset, 857 856 (uint64_t)base_xp, 858 PPM_PAGE_SIZE,857 CONFIG_PPM_PAGE_SIZE, 859 858 &error ); 860 859 } … … 865 864 { 866 865 // initialize mapper part 867 if( mapper_cxy == local_cxy ) // mapper is local866 if( mapper_cxy == local_cxy ) 868 867 { 869 868 error = mapper_move_kernel( mapper_ptr, 870 true, // to _buffer869 true, // to buffer 871 870 page_offset, 872 871 base_xp, 873 872 file_size - page_offset ); 874 873 } 875 else // mapper is remote874 else 876 875 { 877 876 rpc_mapper_move_buffer_client( mapper_cxy, 878 877 mapper_ptr, 879 true, 878 true, // to buffer 880 879 false, // kernel buffer 881 880 page_offset, … … 889 888 if( page_cxy == local_cxy ) 890 889 { 891 memset( base_ptr+ file_size - page_offset , 0 ,892 page_offset + PPM_PAGE_SIZE - file_size );890 memset( GET_PTR( base_xp ) + file_size - page_offset , 0 , 891 page_offset + CONFIG_PPM_PAGE_SIZE - file_size ); 893 892 } 894 893 else 895 894 { 896 895 hal_remote_memset( base_xp + file_size - page_offset , 0 , 897 page_offset + PPM_PAGE_SIZE - file_size );896 page_offset + CONFIG_PPM_PAGE_SIZE - file_size ); 898 897 } 899 898 } … … 902 901 903 902 // return ppn 904 *ppn = hal_page2ppn( XPTR( page_cxy , page_ptr ) );903 *ppn = ppm_page2ppn( XPTR( page_cxy , page_ptr ) ); 905 904 return 0; 906 905 … … 1064 1063 return error; 1065 1064 1066 } 1067 /* 1065 } // end vmm_v2p_translate() 1066 1067 /* deprecated 1068 1068 1069 1069 /////////////////////////////////////////////////////////////////// -
trunk/kernel/mm/vseg.c
r184 r315 92 92 vpn_t vpn_size, 93 93 uint32_t type, 94 cxy_t cxy, 95 fdid_t fdid, 96 uint32_t offset ) 94 cxy_t cxy ) 97 95 { 98 96 vseg->type = type; … … 101 99 vseg->vpn_base = vpn_base; 102 100 vseg->vpn_size = vpn_size; 103 vseg->mapper = XPTR_NULL; 104 vseg->fdid = fdid; 105 vseg->offset = offset; 101 vseg->mapper_xp = XPTR_NULL; 106 102 vseg->cxy = cxy; 107 103 … … 171 167 hal_core_sleep(); 172 168 } 173 } 169 170 } // end vseg_init() 174 171 175 172 ////////////////////////////////////////// … … 182 179 183 180 // initialize vseg with remote_read access 184 vseg->type = hal_remote_lw ( XPTR( cxy , &ptr->type ) ); 185 vseg->min = (intptr_t)hal_remote_lpt( XPTR( cxy , &ptr->min ) ); 186 vseg->max = (intptr_t)hal_remote_lpt( XPTR( cxy , &ptr->max ) ); 187 vseg->vpn_base = hal_remote_lw ( XPTR( cxy , &ptr->vpn_base ) ); 188 vseg->vpn_size = hal_remote_lw ( XPTR( cxy , &ptr->vpn_size ) ); 189 vseg->flags = hal_remote_lw ( XPTR( cxy , &ptr->flags ) ); 190 vseg->mapper = (xptr_t) hal_remote_lwd( XPTR( cxy , &ptr->mapper ) ); 191 192 if( vseg->type == VSEG_TYPE_FILE ) 193 { 194 vseg->fdid = hal_remote_lw( XPTR( cxy , &ptr->fdid ) ); 195 vseg->offset = hal_remote_lw( XPTR( cxy , &ptr->offset ) ); 196 } 197 else 198 { 199 vseg->fdid = 0; 200 vseg->offset = 0; 201 } 181 vseg->type = hal_remote_lw ( XPTR( cxy , &ptr->type ) ); 182 vseg->min = (intptr_t)hal_remote_lpt( XPTR( cxy , &ptr->min ) ); 183 vseg->max = (intptr_t)hal_remote_lpt( XPTR( cxy , &ptr->max ) ); 184 vseg->vpn_base = hal_remote_lw ( XPTR( cxy , &ptr->vpn_base ) ); 185 vseg->vpn_size = hal_remote_lw ( XPTR( cxy , &ptr->vpn_size ) ); 186 vseg->flags = hal_remote_lw ( XPTR( cxy , &ptr->flags ) ); 187 vseg->mapper_xp = (xptr_t) hal_remote_lwd( XPTR( cxy , &ptr->mapper_xp ) ); 202 188 } 203 189 -
trunk/kernel/mm/vseg.h
r313 r315 81 81 vpn_t vpn_size; /*! number of pages occupied */ 82 82 uint32_t flags; /*! vseg attributes */ 83 xptr_t file_mapper;/*! xptr on remote mapper (for types CODE / DATA / FILE) */84 intptr_t file_offset; /*! offset in file (for types CODE / DATA / FILE)*/85 intptr_t file_size; /*! max segment size in mapper (for type DATA)*/86 cxy_t cxy; /*! cluster for physical mapping (for non distributed)*/83 xptr_t mapper_xp; /*! xptr on remote mapper (for types CODE / DATA / FILE) */ 84 intptr_t file_offset; /*! vseg offset in file (for types CODE/DATA) */ 85 intptr_t file_size; /*! max segment size in mapper (for type CODE/DATA) */ 86 cxy_t cxy; /*! physical mapping (for non distributed vseg) */ 87 87 } 88 88 vseg_t; … … 123 123 * @ type : vseg type. 124 124 * @ cxy : target cluster for physical mapping. 125 * @ fdid : file descriptor index if VSEG_TYPE_FILE.126 * @ offset : offset in file if VSEG_TYPE_FILE.127 125 *********************************************************************************************/ 128 126 void vseg_init( vseg_t * vseg, … … 132 130 vpn_t vpn_size, 133 131 uint32_t type, 134 cxy_t cxy, 135 fdid_t fdid, 136 uint32_t offset ); 132 cxy_t cxy ); 137 133 138 134 /********************************************************************************************** -
trunk/kernel/syscalls/sys_exec.c
r302 r315 85 85 kmem_req_t req; // kmem request 86 86 page_t * page; // page descriptor 87 xptr_t base_xp; // extended pointer on page base 87 88 uint32_t order; // ln2( number of pages to store strings ) 88 89 char ** k_pointers; // base of kernel array of pointers … … 103 104 if( page == NULL ) return ENOMEM; 104 105 105 k_pointers = ppm_page2vaddr( page ); 106 base_xp = ppm_page2base( XPTR( local_cxy , page ) ); 107 k_pointers = (char **)GET_PTR( base_xp ); 106 108 107 109 // allocate several physical pages to store the strings themselve … … 111 113 if( page == NULL ) return ENOMEM; 112 114 113 k_buf_base = ppm_page2vaddr( page ); 115 base_xp = ppm_page2base( XPTR( local_cxy , page ) ); 116 k_buf_base = (char *)GET_PTR( base_xp ); 114 117 115 118 // copy the array of pointers to kernel buffer -
trunk/kernel/syscalls/sys_write.c
r313 r315 93 93 error = vfs_user_move( false, // from buffer 94 94 file_xp, 95 kbuf ,96 nbytes);95 buf , 96 count ); 97 97 98 98 if( error ) -
trunk/kernel/vfs/fatfs.c
r279 r315 296 296 297 297 // get pointer on buffer for current page 298 current_page_buffer = (uint32_t *)ppm_page2vaddr( current_page_desc ); 298 xptr_t base_xp = ppm_page2base( XPTR( local_cxy , current_page_desc ) ); 299 current_page_buffer = (uint32_t *)GET_PTR( base_xp ); 299 300 300 301 // get FAT slot content … … 473 474 474 475 // get memory buffer base address 475 uint8_t * buffer = (uint8_t *)ppm_page2vaddr( page ); 476 xptr_t base_xp = ppm_page2base( XPTR( local_cxy , page ) ); 477 uint8_t * buffer = (uint8_t *)GET_PTR( base_xp ); 476 478 477 479 // get number of sectors from FATFS context … … 604 606 605 607 // get page base 606 base = ppm_page2vaddr( page ); 608 xptr_t base_xp = ppm_page2base( XPTR( local_cxy , page ) ); 609 base = (uint8_t *)GET_PTR( base_xp ); 607 610 608 611 #if (CONFIG_FATFS_DEBUG > 1) -
trunk/kernel/vfs/vfs.c
r313 r315 702 702 else 703 703 { 704 rpc_mapper_move_ user_client( file_cxy,705 mapper,706 to_buffer,707 true, // user buffer708 file_offset,709 (uint64_t)(intptr_t)buffer,710 size,711 &error );704 rpc_mapper_move_buffer_client( file_cxy, 705 mapper, 706 to_buffer, 707 true, // user buffer 708 file_offset, 709 (uint64_t)(intptr_t)buffer, 710 size, 711 &error ); 712 712 } 713 713
Note: See TracChangeset
for help on using the changeset viewer.