Rev 1787 | Rev 2028 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 1787 | Rev 2021 | ||
|---|---|---|---|
| Line 33... | Line 33... | ||
| 33 | #include <arch/mm/page.h> |
33 | #include <arch/mm/page.h> |
| 34 | #include <arch/types.h> |
34 | #include <arch/types.h> |
| 35 | #include <debug.h> |
35 | #include <debug.h> |
| 36 | #include <align.h> |
36 | #include <align.h> |
| 37 | 37 | ||
| - | 38 | #ifdef CONFIG_BENCH |
|
| - | 39 | #include <arch/cycle.h> |
|
| - | 40 | #endif |
|
| - | 41 | ||
| 38 | #define MAX_FRAMES 1024 |
42 | #define MAX_FRAMES 1024 |
| 39 | #define MAX_ORDER 8 |
43 | #define MAX_ORDER 8 |
| 40 | #define TEST_RUNS 2 |
44 | #define TEST_RUNS 2 |
| 41 | 45 | ||
| 42 | void test(void) { |
46 | void test_falloc1(void) { |
| - | 47 | #ifdef CONFIG_BENCH |
|
| - | 48 | uint64_t t0 = get_cycle(); |
|
| - | 49 | #endif |
|
| 43 | uintptr_t * frames = (uintptr_t *) malloc(MAX_FRAMES*sizeof(uintptr_t), 0); |
50 | uintptr_t * frames = (uintptr_t *) malloc(MAX_FRAMES*sizeof(uintptr_t), 0); |
| 44 | int results[MAX_ORDER+1]; |
51 | int results[MAX_ORDER+1]; |
| 45 | 52 | ||
| 46 | int i, order, run; |
53 | int i, order, run; |
| 47 | int allocated; |
54 | int allocated; |
| Line 86... | Line 93... | ||
| 86 | } |
93 | } |
| 87 | 94 | ||
| 88 | free(frames); |
95 | free(frames); |
| 89 | 96 | ||
| 90 | printf("Test passed.\n"); |
97 | printf("Test passed.\n"); |
| - | 98 | #ifdef CONFIG_BENCH |
|
| - | 99 | uint64_t dt = get_cycle() - t0; |
|
| - | 100 | printf("Time: %.*d cycles\n", sizeof(dt) * 2, dt); |
|
| - | 101 | #endif |
|
| 91 | } |
102 | } |
| 92 | 103 | ||