Rev 1221 | Rev 1766 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1221 | Rev 1760 | ||
---|---|---|---|
Line 53... | Line 53... | ||
53 | for (run = 0; run < TEST_RUNS; run++) { |
53 | for (run = 0; run < TEST_RUNS; run++) { |
54 | for (order = 0; order <= MAX_ORDER; order++) { |
54 | for (order = 0; order <= MAX_ORDER; order++) { |
55 | printf("Allocating %d frames blocks ... ", 1 << order); |
55 | printf("Allocating %d frames blocks ... ", 1 << order); |
56 | allocated = 0; |
56 | allocated = 0; |
57 | for (i = 0; i < MAX_FRAMES >> order; i++) { |
57 | for (i = 0; i < MAX_FRAMES >> order; i++) { |
58 | frames[allocated] = PA2KA(PFN2ADDR(frame_alloc_rc(order, FRAME_ATOMIC | FRAME_KA, &status))); |
58 | frames[allocated] = frame_alloc_rc(order, FRAME_ATOMIC | FRAME_KA, &status); |
59 | 59 | ||
60 | if (ALIGN_UP(frames[allocated], FRAME_SIZE << order) != frames[allocated]) { |
60 | if (ALIGN_UP(frames[allocated], FRAME_SIZE << order) != frames[allocated]) { |
61 | panic("Test failed. Block at address %p (size %dK) is not aligned\n", frames[allocated], (FRAME_SIZE << order) >> 10); |
61 | panic("Test failed. Block at address %p (size %dK) is not aligned\n", frames[allocated], (FRAME_SIZE << order) >> 10); |
62 | } |
62 | } |
63 | 63 | ||
Line 78... | Line 78... | ||
78 | } else |
78 | } else |
79 | results[order] = allocated; |
79 | results[order] = allocated; |
80 | 80 | ||
81 | printf("Deallocating ... "); |
81 | printf("Deallocating ... "); |
82 | for (i = 0; i < allocated; i++) { |
82 | for (i = 0; i < allocated; i++) { |
83 | frame_free(ADDR2PFN(KA2PA(frames[i]))); |
83 | frame_free(KA2PA(frames[i])); |
84 | } |
84 | } |
85 | printf("done.\n"); |
85 | printf("done.\n"); |
86 | } |
86 | } |
87 | } |
87 | } |
88 | 88 |