Rev 1760 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1760 | Rev 1767 | ||
---|---|---|---|
Line 49... | Line 49... | ||
49 | 49 | ||
50 | static atomic_t thread_count; |
50 | static atomic_t thread_count; |
51 | 51 | ||
52 | void falloc(void * arg) |
52 | void falloc(void * arg) |
53 | { |
53 | { |
54 | int status, order, run, allocated, i; |
54 | int order, run, allocated, i; |
55 | __u8 val = THREAD->tid % THREADS; |
55 | __u8 val = THREAD->tid % THREADS; |
56 | index_t k; |
56 | index_t k; |
57 | 57 | ||
58 | __address * frames = (__address *) malloc(MAX_FRAMES * sizeof(__address), FRAME_ATOMIC); |
58 | __address * frames = (__address *) malloc(MAX_FRAMES * sizeof(__address), FRAME_ATOMIC); |
59 | ASSERT(frames != NULL); |
59 | ASSERT(frames != NULL); |
Line 63... | Line 63... | ||
63 | for (run = 0; run < THREAD_RUNS; run++) { |
63 | for (run = 0; run < THREAD_RUNS; run++) { |
64 | for (order = 0; order <= MAX_ORDER; order++) { |
64 | for (order = 0; order <= MAX_ORDER; order++) { |
65 | printf("Thread #%d (cpu%d): Allocating %d frames blocks ... \n", THREAD->tid, CPU->id, 1 << order); |
65 | printf("Thread #%d (cpu%d): Allocating %d frames blocks ... \n", THREAD->tid, CPU->id, 1 << order); |
66 | allocated = 0; |
66 | allocated = 0; |
67 | for (i = 0; i < (MAX_FRAMES >> order); i++) { |
67 | for (i = 0; i < (MAX_FRAMES >> order); i++) { |
68 | frames[allocated] = frame_alloc_rc(order, FRAME_ATOMIC | FRAME_KA, &status); |
68 | frames[allocated] = (__address)frame_alloc(order, FRAME_ATOMIC | FRAME_KA); |
69 | if (status == 0) { |
69 | if (frames[allocated]) { |
70 | memsetb(frames[allocated], FRAME_SIZE << order, val); |
70 | memsetb(frames[allocated], FRAME_SIZE << order, val); |
71 | allocated++; |
71 | allocated++; |
72 | } else { |
72 | } else { |
73 | break; |
73 | break; |
74 | } |
74 | } |