Changes in kernel/generic/src/mm/frame.c [c12f891:63e27ef] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/mm/frame.c
rc12f891 r63e27ef 47 47 #include <mm/as.h> 48 48 #include <panic.h> 49 #include < debug.h>49 #include <assert.h> 50 50 #include <adt/list.h> 51 51 #include <synch/mutex.h> … … 349 349 NO_TRACE static frame_t *zone_get_frame(zone_t *zone, size_t index) 350 350 { 351 ASSERT(index < zone->count);351 assert(index < zone->count); 352 352 353 353 return &zone->frames[index]; … … 370 370 pfn_t constraint) 371 371 { 372 ASSERT(zone->flags & ZONE_AVAILABLE);372 assert(zone->flags & ZONE_AVAILABLE); 373 373 374 374 /* Allocate frames from zone */ … … 377 377 FRAME_LOWPRIO, constraint, &index); 378 378 379 ASSERT(avail);380 ASSERT(index != (size_t) -1);379 assert(avail); 380 assert(index != (size_t) -1); 381 381 382 382 /* Update frame reference count */ … … 384 384 frame_t *frame = zone_get_frame(zone, index + i); 385 385 386 ASSERT(frame->refcount == 0);386 assert(frame->refcount == 0); 387 387 frame->refcount = 1; 388 388 } … … 407 407 NO_TRACE static size_t zone_frame_free(zone_t *zone, size_t index) 408 408 { 409 ASSERT(zone->flags & ZONE_AVAILABLE);409 assert(zone->flags & ZONE_AVAILABLE); 410 410 411 411 frame_t *frame = zone_get_frame(zone, index); 412 412 413 ASSERT(frame->refcount > 0);413 assert(frame->refcount > 0); 414 414 415 415 if (!--frame->refcount) { … … 429 429 NO_TRACE static void zone_mark_unavailable(zone_t *zone, size_t index) 430 430 { 431 ASSERT(zone->flags & ZONE_AVAILABLE);431 assert(zone->flags & ZONE_AVAILABLE); 432 432 433 433 frame_t *frame = zone_get_frame(zone, index); … … 456 456 void *confdata) 457 457 { 458 ASSERT(zones.info[z1].flags & ZONE_AVAILABLE);459 ASSERT(zones.info[z2].flags & ZONE_AVAILABLE);460 ASSERT(zones.info[z1].flags == zones.info[z2].flags);461 ASSERT(zones.info[z1].base < zones.info[z2].base);462 ASSERT(!overlaps(zones.info[z1].base, zones.info[z1].count,458 assert(zones.info[z1].flags & ZONE_AVAILABLE); 459 assert(zones.info[z2].flags & ZONE_AVAILABLE); 460 assert(zones.info[z1].flags == zones.info[z2].flags); 461 assert(zones.info[z1].base < zones.info[z2].base); 462 assert(!overlaps(zones.info[z1].base, zones.info[z1].count, 463 463 zones.info[z2].base, zones.info[z2].count)); 464 464 … … 509 509 NO_TRACE static void return_config_frames(size_t znum, pfn_t pfn, size_t count) 510 510 { 511 ASSERT(zones.info[znum].flags & ZONE_AVAILABLE);511 assert(zones.info[znum].flags & ZONE_AVAILABLE); 512 512 513 513 size_t cframes = SIZE2FRAMES(zone_conf_size(count)); … … 704 704 * the assert 705 705 */ 706 ASSERT(confframe != ADDR2PFN((uintptr_t ) NULL));706 assert(confframe != ADDR2PFN((uintptr_t ) NULL)); 707 707 708 708 /* Update the known end of physical memory. */ … … 792 792 size_t znum = find_zone(pfn, 1, hint); 793 793 794 ASSERT(znum != (size_t) -1);794 assert(znum != (size_t) -1); 795 795 796 796 zone_get_frame(&zones.info[znum], … … 806 806 size_t znum = find_zone(pfn, 1, hint); 807 807 808 ASSERT(znum != (size_t) -1);808 assert(znum != (size_t) -1); 809 809 810 810 void *res = zone_get_frame(&zones.info[znum], … … 830 830 uintptr_t constraint, size_t *pzone) 831 831 { 832 ASSERT(count > 0);832 assert(count > 0); 833 833 834 834 size_t hint = pzone ? (*pzone) : 0; … … 970 970 size_t znum = find_zone(pfn, 1, 0); 971 971 972 ASSERT(znum != (size_t) -1);972 assert(znum != (size_t) -1); 973 973 974 974 freed += zone_frame_free(&zones.info[znum], … … 1030 1030 size_t znum = find_zone(pfn, 1, 0); 1031 1031 1032 ASSERT(znum != (size_t) -1);1032 assert(znum != (size_t) -1); 1033 1033 1034 1034 zones.info[znum].frames[pfn - zones.info[znum].base].refcount++; … … 1153 1153 uint64_t *free) 1154 1154 { 1155 ASSERT(total != NULL);1156 ASSERT(unavail != NULL);1157 ASSERT(busy != NULL);1158 ASSERT(free != NULL);1155 assert(total != NULL); 1156 assert(unavail != NULL); 1157 assert(busy != NULL); 1158 assert(free != NULL); 1159 1159 1160 1160 irq_spinlock_lock(&zones.lock, true);
Note:
See TracChangeset
for help on using the changeset viewer.