Subversion Repositories HelenOS-historic

Compare Revisions

Ignore whitespace Rev 761 → Rev 762

/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);
frames[allocated] = frame_alloc(FRAME_ATOMIC | FRAME_KA, order, &status, NULL);
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
63,7 → 63,7
printf("Thread #%d: Allocating %d frames blocks ... \n", THREAD->tid, 1 << order);
allocated = 0;
for (i = 0; i < (MAX_FRAMES >> order); i++) {
frames[allocated] = frame_alloc(FRAME_ATOMIC | FRAME_KA, order, &status);
frames[allocated] = frame_alloc(FRAME_ATOMIC | FRAME_KA, order, &status, NULL);
if (status == 0) {
memsetb(frames[allocated], FRAME_SIZE << order, val);
allocated++;
/kernel/trunk/test/mm/slab1/test.c
28,8 → 28,37
 
#include <test.h>
#include <mm/slab.h>
#include <print.h>
 
#define VAL_SIZE 128
#define VAL_COUNT 1024
 
void * data[16384];
 
void test(void)
{
slab_cache_create("test_cache", 10, 0, NULL, NULL, 0);
slab_cache_t *cache;
int i;
 
printf("Creating cache.\n");
cache = slab_cache_create("test_cache", VAL_SIZE, 0, NULL, NULL, SLAB_CACHE_NOMAGAZINE);
slab_print_list();
printf("Destroying cache.\n");
slab_cache_destroy(cache);
 
printf("Creating cache.\n");
cache = slab_cache_create("test_cache", VAL_SIZE, 0, NULL, NULL,
SLAB_CACHE_NOMAGAZINE);
printf("Allocating %d items...", VAL_COUNT);
for (i=0; i < VAL_COUNT; i++) {
data[i] = slab_alloc(cache, 0);
}
printf("done.\n");
printf("Freeing %d items...", VAL_COUNT);
for (i=0; i < VAL_COUNT; i++) {
slab_free(cache, data[i]);
}
printf("done.\n");
}
/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);
frame1 = frame_alloc(FRAME_KA, ONE_FRAME, NULL);
frame0 = frame_alloc(FRAME_KA, ONE_FRAME, NULL, NULL);
frame1 = frame_alloc(FRAME_KA, ONE_FRAME, NULL, NULL);
 
printf("Writing %L to physical address %P.\n", VALUE0, KA2PA(frame0));
*((__u32 *) frame0) = VALUE0;