Changeset 492 for trunk/kernel/mm
- Timestamp:
- Aug 22, 2018, 11:55:48 PM (6 years ago)
- Location:
- trunk/kernel/mm
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/mm/kcm.c
r464 r492 56 56 #endif 57 57 58 assert( kcm_page->active , __FUNCTION__ ,"kcm_page should be active" );58 assert( kcm_page->active , "kcm_page should be active" ); 59 59 60 60 // get first block available 61 61 int32_t index = bitmap_ffs( kcm_page->bitmap , kcm->blocks_nr ); 62 62 63 assert( (index != -1) , __FUNCTION__ ,"kcm_page should not be full" );63 assert( (index != -1) , "kcm_page should not be full" ); 64 64 65 65 // allocate block … … 113 113 index = ((uint8_t *)ptr - (uint8_t *)kcm_page - CONFIG_KCM_SLOT_SIZE) / kcm->block_size; 114 114 115 assert( !bitmap_state( kcm_page->bitmap , index ) , __FUNCTION__ ,"page already freed" );116 assert( (kcm_page->count > 0) , __FUNCTION__ ,"count already zero" );115 assert( !bitmap_state( kcm_page->bitmap , index ) , "page already freed" ); 116 assert( (kcm_page->count > 0) , "count already zero" ); 117 117 118 118 bitmap_set( kcm_page->bitmap , index ); … … 216 216 // the kcm_page descriptor mut fit in the KCM slot 217 217 assert( (sizeof(kcm_page_t) <= CONFIG_KCM_SLOT_SIZE) , 218 __FUNCTION__ ,"KCM slot too small\n" );218 "KCM slot too small\n" ); 219 219 220 220 // initialize lock … … 329 329 kcm_t * kcm; 330 330 331 assert( (ptr != NULL) , __FUNCTION__ ,"pointer cannot be NULL" );331 assert( (ptr != NULL) , "pointer cannot be NULL" ); 332 332 333 333 kcm_page = (kcm_page_t *)((intptr_t)ptr & ~CONFIG_PPM_PAGE_MASK); -
trunk/kernel/mm/khm.c
r457 r492 40 40 { 41 41 // check config parameters 42 assert( ((CONFIG_PPM_PAGE_SHIFT + CONFIG_PPM_HEAP_ORDER) < 32 ) , __FUNCTION__ ,42 assert( ((CONFIG_PPM_PAGE_SHIFT + CONFIG_PPM_HEAP_ORDER) < 32 ) , 43 43 "CONFIG_PPM_HEAP_ORDER too large" ); 44 44 … … 142 142 spinlock_lock(&khm->lock); 143 143 144 assert( (current->busy == 1) , __FUNCTION__ ,"page already freed" );144 assert( (current->busy == 1) , "page already freed" ); 145 145 146 146 // release block -
trunk/kernel/mm/kmem.c
r486 r492 143 143 kcm_t * kcm; 144 144 145 assert( ((type > 1) && (type < KMEM_TYPES_NR) ) , __FUNCTION__ ,"illegal KCM type" );145 assert( ((type > 1) && (type < KMEM_TYPES_NR) ) , "illegal KCM type" ); 146 146 147 147 #if DEBUG_KMEM … … 198 198 flags = req->flags; 199 199 200 assert( (type < KMEM_TYPES_NR) , __FUNCTION__ ,"illegal KMEM request type" );200 assert( (type < KMEM_TYPES_NR) , "illegal KMEM request type" ); 201 201 202 202 #if DEBUG_KMEM … … 293 293 if( req->type >= KMEM_TYPES_NR ) 294 294 { 295 assert( false , __FUNCTION__ ,"illegal request type\n" );295 assert( false , "illegal request type\n" ); 296 296 } 297 297 -
trunk/kernel/mm/ppm.c
r486 r492 152 152 page_t * pages_tbl = ppm->pages_tbl; 153 153 154 assert( !page_is_flag( page , PG_FREE ) , __FUNCTION__ ,154 assert( !page_is_flag( page , PG_FREE ) , 155 155 "page already released : ppn = %x\n" , ppm_page2ppn(XPTR(local_cxy,page)) ); 156 156 157 assert( !page_is_flag( page , PG_RESERVED ) , __FUNCTION__ ,157 assert( !page_is_flag( page , PG_RESERVED ) , 158 158 "reserved page : ppn = %x\n" , ppm_page2ppn(XPTR(local_cxy,page)) ); 159 159 … … 215 215 ppm_t * ppm = &LOCAL_CLUSTER->ppm; 216 216 217 assert( (order < CONFIG_PPM_MAX_ORDER) , __FUNCTION__ ,217 assert( (order < CONFIG_PPM_MAX_ORDER) , 218 218 "illegal order argument = %x\n" , order ); 219 219 -
trunk/kernel/mm/vmm.c
r473 r492 79 79 80 80 assert( ((CONFIG_VMM_KENTRY_SIZE + CONFIG_VMM_ARGS_SIZE + CONFIG_VMM_ENVS_SIZE) 81 <= CONFIG_VMM_ELF_BASE) , __FUNCTION__ ,"UTILS zone too small\n" );82 83 assert( (CONFIG_THREAD_MAX_PER_CLUSTER <= 32) , __FUNCTION__ ,81 <= CONFIG_VMM_ELF_BASE) , "UTILS zone too small\n" ); 82 83 assert( (CONFIG_THREAD_MAX_PER_CLUSTER <= 32) , 84 84 "no more than 32 threads per cluster for a single process\n"); 85 85 86 86 assert( ((CONFIG_VMM_STACK_SIZE * CONFIG_THREAD_MAX_PER_CLUSTER) <= 87 (CONFIG_VMM_VSPACE_SIZE - CONFIG_VMM_STACK_BASE)) , __FUNCTION__ ,87 (CONFIG_VMM_VSPACE_SIZE - CONFIG_VMM_STACK_BASE)) , 88 88 "STACK zone too small\n"); 89 89 … … 274 274 275 275 // check cluster is reference 276 assert( (GET_CXY( process->ref_xp ) == local_cxy) , __FUNCTION__,276 assert( (GET_CXY( process->ref_xp ) == local_cxy) , 277 277 "not called in reference cluster\n"); 278 278 … … 346 346 347 347 // check cluster is reference 348 assert( (GET_CXY( process->ref_xp ) == local_cxy) , __FUNCTION__,348 assert( (GET_CXY( process->ref_xp ) == local_cxy) , 349 349 "local cluster is not process reference cluster\n"); 350 350 … … 386 386 vseg = GET_PTR( vseg_xp ); 387 387 388 assert( (GET_CXY( vseg_xp ) == local_cxy) , __FUNCTION__,388 assert( (GET_CXY( vseg_xp ) == local_cxy) , 389 389 "all vsegs in reference VSL must be local\n" ); 390 390 … … 1112 1112 1113 1113 // check small page 1114 assert( (attr & GPT_SMALL) , __FUNCTION__ ,1114 assert( (attr & GPT_SMALL) , 1115 1115 "an user vseg must use small pages" ); 1116 1116 … … 1380 1380 uint32_t flags = vseg->flags; 1381 1381 1382 assert( ( type != VSEG_TYPE_FILE ) , __FUNCTION__ ,"illegal vseg type\n" );1382 assert( ( type != VSEG_TYPE_FILE ) , "illegal vseg type\n" ); 1383 1383 1384 1384 if( flags & VSEG_DISTRIB ) // distributed => cxy depends on vpn LSB … … 1448 1448 xptr_t mapper_xp = vseg->mapper_xp; 1449 1449 1450 assert( (mapper_xp != XPTR_NULL), __FUNCTION__,1450 assert( (mapper_xp != XPTR_NULL), 1451 1451 "mapper not defined for a FILE vseg\n" ); 1452 1452 … … 1486 1486 xptr_t mapper_xp = vseg->mapper_xp; 1487 1487 1488 assert( (mapper_xp != XPTR_NULL), __FUNCTION__,1488 assert( (mapper_xp != XPTR_NULL), 1489 1489 "mapper not defined for a CODE or DATA vseg\n" ); 1490 1490 … … 1655 1655 1656 1656 // vseg has been checked by the vmm_handle_page_fault() function 1657 assert( (vseg != NULL) , __FUNCTION__, 1658 "vseg undefined / vpn %x / thread %x in process %x / core[%x,%d] / cycle %d\n", 1659 vpn, this->trdid, process->pid, local_cxy, this->core->lid, 1660 (uint32_t)hal_get_cycles() ); 1657 assert( (vseg != NULL) , "vseg undefined / vpn %x\n"); 1661 1658 1662 1659 if( cow ) //////////////// copy_on_write request ////////////////////// … … 1669 1666 hal_gpt_get_pte( &vmm->gpt , vpn , &old_attr , &old_ppn ); 1670 1667 1671 assert( (old_attr & GPT_MAPPED), __FUNCTION__, 1672 "PTE unmapped for a COW exception / vpn %x / thread %x in process %x / cycle %d\n", 1673 vpn, this, process->pid, (uint32_t)hal_get_cycles() ); 1668 assert( (old_attr & GPT_MAPPED), 1669 "PTE unmapped for a COW exception / vpn %x\n" ); 1674 1670 1675 1671 #if( DEBUG_VMM_GET_PTE & 1 ) -
trunk/kernel/mm/vseg.c
r473 r492 145 145 else 146 146 { 147 assert( false , __FUNCTION__ ,"illegal vseg type\n" );147 assert( false , "illegal vseg type\n" ); 148 148 } 149 149 … … 191 191 default: 192 192 { 193 assert( false, __FUNCTION__,"Illegal vseg type" );193 assert( false, "Illegal vseg type" ); 194 194 break; 195 195 }
Note: See TracChangeset
for help on using the changeset viewer.