/kernel/trunk/test/mm/falloc1/test.c |
---|
29,7 → 29,7 |
#include <test.h> |
#include <mm/page.h> |
#include <mm/frame.h> |
#include <mm/heap.h> |
#include <mm/slab.h> |
#include <arch/mm/page.h> |
#include <arch/types.h> |
#include <debug.h> |
55,7 → 55,7 |
printf("Allocating %d frames blocks ... ", 1 << order); |
allocated = 0; |
for (i = 0; i < MAX_FRAMES >> order; i++) { |
frames[allocated] = frame_alloc_rc(order, FRAME_ATOMIC | FRAME_KA, &status); |
frames[allocated] = PA2KA(PFN2ADDR(frame_alloc_rc(order, FRAME_ATOMIC | FRAME_KA, &status))); |
if (ALIGN_UP(frames[allocated], FRAME_SIZE << order) != frames[allocated]) { |
panic("Test failed. Block at address %X (size %dK) is not aligned\n", frames[allocated], (FRAME_SIZE << order) >> 10); |
80,7 → 80,7 |
printf("Deallocating ... "); |
for (i = 0; i < allocated; i++) { |
frame_free(frames[i]); |
frame_free(ADDR2PFN(KA2PA(frames[i]))); |
} |
printf("done.\n"); |
} |
/kernel/trunk/test/mm/falloc2/test.c |
---|
29,7 → 29,7 |
#include <test.h> |
#include <mm/page.h> |
#include <mm/frame.h> |
#include <mm/heap.h> |
#include <mm/slab.h> |
#include <arch/mm/page.h> |
#include <arch/types.h> |
#include <arch/atomic.h> |
63,7 → 63,7 |
printf("Thread #%d (cpu%d): Allocating %d frames blocks ... \n", THREAD->tid, CPU->id, 1 << order); |
allocated = 0; |
for (i = 0; i < (MAX_FRAMES >> order); i++) { |
frames[allocated] = frame_alloc_rc(order, FRAME_ATOMIC | FRAME_KA, &status); |
frames[allocated] = PA2KA(PFN2ADDR(frame_alloc_rc(order, FRAME_ATOMIC | FRAME_KA, &status))); |
if (status == 0) { |
memsetb(frames[allocated], FRAME_SIZE << order, val); |
allocated++; |
81,7 → 81,7 |
failed(); |
} |
} |
frame_free(frames[i]); |
frame_free(ADDR2PFN(KA2PA(frames[i]))); |
} |
printf("Thread #%d (cpu%d): Finished run.\n", THREAD->tid, CPU->id); |
} |