Changeset 437 for trunk/kernel/mm
- Timestamp:
- Mar 28, 2018, 2:40:29 PM (7 years ago)
- Location:
- trunk/kernel/mm
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/mm/kcm.c
r435 r437 3 3 * 4 4 * Author Ghassan Almaless (2008,2009,2010,2011,2012) 5 * Alain Greiner (2016,2017 )5 * Alain Greiner (2016,2017,2018) 6 6 * 7 7 * Copyright (c) UPMC Sorbonne Universites … … 239 239 uint32_t blocks_nr = (CONFIG_PPM_PAGE_SIZE - CONFIG_KCM_SLOT_SIZE) / block_size; 240 240 kcm->blocks_nr = blocks_nr; 241 242 kcm_dmsg("\n[DBG] %s : KCM %s initialised / block_size = %d / blocks_nr = %d\n",243 __FUNCTION__ , kmem_type_str( type ) , kcm->block_size , kcm->blocks_nr );244 241 } 245 242 -
trunk/kernel/mm/kcm.h
r188 r437 3 3 * 4 4 * Authors Ghassan Almaless (2008,2009,2010,2011,2012) 5 * Alain Greiner (2016 )5 * Alain Greiner (2016,2017,2018) 6 6 * 7 7 * Copyright (c) UPMC Sorbonne Universites -
trunk/kernel/mm/ppm.c
r433 r437 54 54 55 55 cxy_t page_cxy = GET_CXY( page_xp ); 56 page_t * page_ptr = (page_t *)GET_PTR( page_xp );56 page_t * page_ptr = GET_PTR( page_xp ); 57 57 58 58 void * base_ptr = ppm->vaddr_base + … … 69 69 70 70 cxy_t base_cxy = GET_CXY( base_xp ); 71 void * base_ptr = (void *)GET_PTR( base_xp );71 void * base_ptr = GET_PTR( base_xp ); 72 72 73 73 page_t * page_ptr = ppm->pages_tbl + … … 86 86 87 87 cxy_t page_cxy = GET_CXY( page_xp ); 88 page_t * page_ptr = (page_t *)GET_PTR( page_xp );88 page_t * page_ptr = GET_PTR( page_xp ); 89 89 90 90 paddr_t paddr = PADDR( page_cxy , (page_ptr - ppm->pages_tbl)<<CONFIG_PPM_PAGE_SHIFT ); 91 91 92 return paddr >> CONFIG_PPM_PAGE_SHIFT;92 return (ppn_t)(paddr >> CONFIG_PPM_PAGE_SHIFT); 93 93 94 94 } // end hal_page2ppn() … … 97 97 inline xptr_t ppm_ppn2page( ppn_t ppn ) 98 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] );99 ppm_t * ppm = &LOCAL_CLUSTER->ppm; 100 101 paddr_t paddr = ((paddr_t)ppn) << CONFIG_PPM_PAGE_SHIFT; 102 103 cxy_t cxy = CXY_FROM_PADDR( paddr ); 104 lpa_t lpa = LPA_FROM_PADDR( paddr ); 105 106 return XPTR( cxy , &ppm->pages_tbl[lpa>>CONFIG_PPM_PAGE_SHIFT] ); 107 107 108 108 } // end hal_ppn2page … … 113 113 inline xptr_t ppm_ppn2base( ppn_t ppn ) 114 114 { 115 ppm_t * ppm 115 ppm_t * ppm = &LOCAL_CLUSTER->ppm; 116 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 ); 117 paddr_t paddr = ((paddr_t)ppn) << CONFIG_PPM_PAGE_SHIFT; 118 119 cxy_t cxy = CXY_FROM_PADDR( paddr ); 120 lpa_t lpa = LPA_FROM_PADDR( paddr ); 121 122 return XPTR( cxy , (void *)ppm->vaddr_base + lpa ); 125 123 126 124 } // end ppm_ppn2base() … … 132 130 133 131 cxy_t base_cxy = GET_CXY( base_xp ); 134 void * base_ptr = (void *)GET_PTR( base_xp );132 void * base_ptr = GET_PTR( base_xp ); 135 133 136 134 paddr_t paddr = PADDR( base_cxy , (base_ptr - ppm->vaddr_base) ); 137 135 138 return paddr >> CONFIG_PPM_PAGE_SHIFT;136 return (ppn_t)(paddr >> CONFIG_PPM_PAGE_SHIFT); 139 137 140 138 } // end ppm_base2ppn() -
trunk/kernel/mm/vmm.c
r435 r437 673 673 #endif 674 674 675 #if (CONFIG_DEBUG_VMM_DESTROY & 1 ) 676 vmm_display( process , true ); 677 #endif 678 675 679 // get pointer on local VMM 676 680 vmm_t * vmm = &process->vmm; … … 690 694 vseg = GET_PTR( vseg_xp ); 691 695 692 // unmap rand release physical pages if required) 696 #if( CONFIG_DEBUG_VMM_DESTROY & 1 ) 697 if( CONFIG_DEBUG_VMM_DESTROY < cycle ) 698 printk("\n[DBG] %s : %s / vpn_base %x / vpn_size %d\n", 699 __FUNCTION__ , vseg_type_str( vseg->type ), vseg->vpn_base, vseg->vpn_size ); 700 #endif 701 702 // unmap and release physical pages 693 703 vmm_unmap_vseg( process , vseg ); 694 704 … … 1120 1130 if( attr & GPT_MAPPED ) // entry is mapped 1121 1131 { 1132 1133 #if( CONFIG_DEBUG_VMM_UNMAP_VSEG & 1 ) 1134 if( CONFIG_DEBUG_VMM_UNMAP_VSEG < cycle ) 1135 printk("- vpn %x / ppn %x\n" , vpn , ppn ); 1136 #endif 1137 1122 1138 // check small page 1123 1139 assert( (attr & GPT_SMALL) , __FUNCTION__ , … … 1140 1156 // FIXME lock the physical page 1141 1157 1142 // get extended pointer on pending forks counter1143 forks_xp = XPTR( page_cxy , &page_ptr->forks );1144 1145 1158 // get pending forks counter 1146 count = hal_remote_lw( forks_xp);1159 count = hal_remote_lw( XPTR( page_cxy , &page_ptr->forks ) ); 1147 1160 1148 1161 if( count ) // decrement pending forks counter 1149 1162 { 1163 forks_xp = XPTR( page_cxy , &page_ptr->forks ); 1150 1164 hal_remote_atomic_add( forks_xp , -1 ); 1151 1165 } -
trunk/kernel/mm/vmm.h
r433 r437 4 4 * Authors Ghassan Almaless (2008,2009,2010,2011, 2012) 5 5 * Mohamed Lamine Karaoui (2015) 6 * Alain Greiner (2016,2017 )6 * Alain Greiner (2016,2017,2018) 7 7 * 8 8 * Copyright (c) UPMC Sorbonne Universites
Note: See TracChangeset
for help on using the changeset viewer.