Rev 786 | Rev 822 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 786 | Rev 814 | ||
|---|---|---|---|
| Line 27... | Line 27... | ||
| 27 | */ |
27 | */ |
| 28 | #include <print.h> |
28 | #include <print.h> |
| 29 | #include <test.h> |
29 | #include <test.h> |
| 30 | #include <mm/page.h> |
30 | #include <mm/page.h> |
| 31 | #include <mm/frame.h> |
31 | #include <mm/frame.h> |
| 32 | #include <mm/heap.h> |
32 | #include <mm/slab.h> |
| 33 | #include <arch/mm/page.h> |
33 | #include <arch/mm/page.h> |
| 34 | #include <arch/types.h> |
34 | #include <arch/types.h> |
| 35 | #include <arch/atomic.h> |
35 | #include <arch/atomic.h> |
| 36 | #include <debug.h> |
36 | #include <debug.h> |
| 37 | #include <proc/thread.h> |
37 | #include <proc/thread.h> |
| Line 61... | Line 61... | ||
| 61 | for (run = 0; run < THREAD_RUNS; run++) { |
61 | for (run = 0; run < THREAD_RUNS; run++) { |
| 62 | for (order = 0; order <= MAX_ORDER; order++) { |
62 | for (order = 0; order <= MAX_ORDER; order++) { |
| 63 | printf("Thread #%d (cpu%d): Allocating %d frames blocks ... \n", THREAD->tid, CPU->id, 1 << order); |
63 | printf("Thread #%d (cpu%d): Allocating %d frames blocks ... \n", THREAD->tid, CPU->id, 1 << order); |
| 64 | allocated = 0; |
64 | allocated = 0; |
| 65 | for (i = 0; i < (MAX_FRAMES >> order); i++) { |
65 | for (i = 0; i < (MAX_FRAMES >> order); i++) { |
| 66 | frames[allocated] = frame_alloc_rc(order, FRAME_ATOMIC | FRAME_KA, &status); |
66 | frames[allocated] = PA2KA(PFN2ADDR(frame_alloc_rc(order, FRAME_ATOMIC | FRAME_KA, &status))); |
| 67 | if (status == 0) { |
67 | if (status == 0) { |
| 68 | memsetb(frames[allocated], FRAME_SIZE << order, val); |
68 | memsetb(frames[allocated], FRAME_SIZE << order, val); |
| 69 | allocated++; |
69 | allocated++; |
| 70 | } else { |
70 | } else { |
| 71 | break; |
71 | break; |
| Line 79... | Line 79... | ||
| 79 | if (((__u8 *) frames[i])[k] != val) { |
79 | if (((__u8 *) frames[i])[k] != val) { |
| 80 | printf("Thread #%d (cpu%d): Unexpected data (%d) in block %P offset %X\n", THREAD->tid, CPU->id, ((char *) frames[i])[k], frames[i], k); |
80 | printf("Thread #%d (cpu%d): Unexpected data (%d) in block %P offset %X\n", THREAD->tid, CPU->id, ((char *) frames[i])[k], frames[i], k); |
| 81 | failed(); |
81 | failed(); |
| 82 | } |
82 | } |
| 83 | } |
83 | } |
| 84 | frame_free(frames[i]); |
84 | frame_free(ADDR2PFN(KA2PA(frames[i]))); |
| 85 | } |
85 | } |
| 86 | printf("Thread #%d (cpu%d): Finished run.\n", THREAD->tid, CPU->id); |
86 | printf("Thread #%d (cpu%d): Finished run.\n", THREAD->tid, CPU->id); |
| 87 | } |
87 | } |
| 88 | } |
88 | } |
| 89 | 89 | ||