Changeset 492 for trunk/kernel/mm/kcm.c
- Timestamp:
- Aug 22, 2018, 11:55:48 PM (6 years ago)
- File:
-
- 1 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);
Note: See TracChangeset
for help on using the changeset viewer.