Subversion Repositories HelenOS-historic

Compare Revisions

Ignore whitespace Rev 785 → Rev 786

/kernel/trunk/test/mm/falloc1/test.c
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(FRAME_ATOMIC | FRAME_KA, order, &status, NULL);
frames[allocated] = 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);
/kernel/trunk/test/mm/falloc2/test.c
60,10 → 60,10
 
for (run = 0; run < THREAD_RUNS; run++) {
for (order = 0; order <= MAX_ORDER; order++) {
printf("Thread #%d: Allocating %d frames blocks ... \n", THREAD->tid, 1 << order);
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(FRAME_ATOMIC | FRAME_KA, order, &status, NULL);
frames[allocated] = frame_alloc_rc(order, FRAME_ATOMIC | FRAME_KA, &status);
if (status == 0) {
memsetb(frames[allocated], FRAME_SIZE << order, val);
allocated++;
71,24 → 71,24
break;
}
}
printf("Thread #%d: %d blocks allocated.\n", THREAD->tid, allocated);
printf("Thread #%d (cpu%d): %d blocks allocated.\n", THREAD->tid, CPU->id, allocated);
 
printf("Thread #%d: Deallocating ... \n", THREAD->tid);
printf("Thread #%d (cpu%d): Deallocating ... \n", THREAD->tid, CPU->id);
for (i = 0; i < allocated; i++) {
for (k = 0; k <= ((FRAME_SIZE << order) - 1); k++) {
if (((__u8 *) frames[i])[k] != val) {
printf("Thread #%d: Unexpected data (%d) in block %P offset %X\n", THREAD->tid, ((char *) frames[i])[k], frames[i], k);
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);
failed();
}
}
frame_free(frames[i]);
}
printf("Thread #%d: Finished run.\n", val);
printf("Thread #%d (cpu%d): Finished run.\n", THREAD->tid, CPU->id);
}
}
free(frames);
printf("Thread #%d (cpu%d): Exiting\n", THREAD->tid, CPU->id);
atomic_dec(&thread_count);
}
 
/kernel/trunk/test/mm/mapping1/test.c
47,8 → 47,8
 
printf("Memory management test mapping #1\n");
 
frame0 = frame_alloc(FRAME_KA, ONE_FRAME, NULL, NULL);
frame1 = frame_alloc(FRAME_KA, ONE_FRAME, NULL, NULL);
frame0 = frame_alloc(ONE_FRAME, FRAME_KA);
frame1 = frame_alloc(ONE_FRAME, FRAME_KA);
 
printf("Writing %L to physical address %P.\n", VALUE0, KA2PA(frame0));
*((__u32 *) frame0) = VALUE0;