Changeset 68 for trunk/kernel/mm
- Timestamp:
- Jun 27, 2017, 10:24:13 AM (7 years ago)
- Location:
- trunk/kernel/mm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/mm/page.h
r23 r68 61 61 { 62 62 uint32_t flags; /*! flags defined above (4) */ 63 uint32_t order; /*! log2( number of 4Kbytes pages)(4) */63 uint32_t order; /*! log2( number of small pages) (4) */ 64 64 struct mapper_s * mapper; /*! local pointer on associated mapper (4) */ 65 65 uint32_t index; /*! page index in mapper (4) */ -
trunk/kernel/mm/vmm.c
r50 r68 616 616 617 617 618 ////////////////////////////////////////// 619 error_t vmm_map_ vseg( vseg_t * vseg,620 uint32_t attr )618 ////////////////////////////////////////////// 619 error_t vmm_map_kernel_vseg( vseg_t * vseg, 620 uint32_t attr ) 621 621 { 622 622 vpn_t vpn; // VPN of PTE to be set … … 628 628 error_t error; 629 629 630 // check vseg type 630 // check vseg type : must be a kernel vseg 631 631 uint32_t type = vseg->type; 632 if( (type != VSEG_TYPE_KCODE) && (type != VSEG_TYPE_KDATA) && (type != VSEG_TYPE_KDEV) ) 633 { 634 printk("\n[PANIC] in %s : not a kernel vseg\n", __FUNCTION__ ); 635 hal_core_sleep(); 636 } 632 assert( ((type==VSEG_TYPE_KCODE) || (type==VSEG_TYPE_KDATA) || (type==VSEG_TYPE_KDEV)), 633 __FUNCTION__ , "not a kernel vseg\n" ); 637 634 638 635 // get pointer on page table … … 648 645 for( vpn = vpn_min ; vpn < vpn_max ; vpn++ ) 649 646 { 647 // allocate a physical page from local PPM 650 648 kmem_req_t req; 651 649 req.type = KMEM_PAGE; … … 782 780 783 781 // this function must be called by a thread running in the reference cluster 784 if( GET_CXY( process->ref_xp ) != local_cxy ); 785 { 786 printk("\n[PANIC] in %s : not called in the reference cluster\n", __FUNCTION__ ); 787 hal_core_sleep(); 788 } 782 assert( (GET_CXY( process->ref_xp ) == local_cxy ) , __FUNCTION__ , 783 " not called in the reference cluster\n" ); 789 784 790 785 // get VMM pointer … … 954 949 } // end vmm_v2p_translate() 955 950 956 //////////////////////////////////////////////957 951 958 952 -
trunk/kernel/mm/vmm.h
r23 r68 223 223 * This function allocates physical memory from the local cluster to map all PTEs 224 224 * of a "kernel" vseg (type KCODE , KDATA, or KDEV) in the page table of process_zero. 225 * It should not be used for other vseg types, because "user" vsegs usethe225 * WARNING : It should not be used for "user" vsegs, that must be mapped using the 226 226 * "on-demand-paging" policy. 227 227 ********************************************************************************************* … … 230 230 * @ returns 0 if success / returns ENOMEM if no memory 231 231 ********************************************************************************************/ 232 error_t vmm_map_ vseg( vseg_t * vseg,233 uint32_t attr );232 error_t vmm_map_kernel_vseg( vseg_t * vseg, 233 uint32_t attr ); 234 234 235 235 /********************************************************************************************* … … 312 312 /********************************************************************************************* 313 313 * This function makes the virtual to physical address translation, using the calling 314 * process page table. It uses identity mapping if required by the ident flag.314 * process page table. It uses identity mapping if required by the <ident> argument. 315 315 * This address translation is required to configure the peripherals having a DMA 316 316 * capability, or to implement the software L2/L3 cache cohérence, using the MMC device
Note: See TracChangeset
for help on using the changeset viewer.