Subversion Repositories HelenOS-historic

Rev

Rev 1760 | Rev 1767 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1760 Rev 1766
Line 43... Line 43...
43
    __address * frames = (__address *) malloc(MAX_FRAMES*sizeof(__address), 0);
43
    __address * frames = (__address *) malloc(MAX_FRAMES*sizeof(__address), 0);
44
    int results[MAX_ORDER+1];
44
    int results[MAX_ORDER+1];
45
   
45
   
46
    int i, order, run;
46
    int i, order, run;
47
    int allocated;
47
    int allocated;
48
    int status;
-
 
49
 
48
 
50
    ASSERT(TEST_RUNS > 1);
49
    ASSERT(TEST_RUNS > 1);
51
    ASSERT(frames != NULL)
50
    ASSERT(frames != NULL)
52
 
51
 
53
    for (run = 0; run < TEST_RUNS; run++) {
52
    for (run = 0; run < TEST_RUNS; run++) {
54
        for (order = 0; order <= MAX_ORDER; order++) {
53
        for (order = 0; order <= MAX_ORDER; order++) {
55
            printf("Allocating %d frames blocks ... ", 1 << order);
54
            printf("Allocating %d frames blocks ... ", 1 << order);
56
            allocated = 0;
55
            allocated = 0;
57
            for (i = 0; i < MAX_FRAMES >> order; i++) {
56
            for (i = 0; i < MAX_FRAMES >> order; i++) {
58
                frames[allocated] = frame_alloc_rc(order, FRAME_ATOMIC | FRAME_KA, &status);
57
                frames[allocated] = frame_alloc(order, FRAME_ATOMIC | FRAME_KA);
59
               
58
               
60
                if (ALIGN_UP(frames[allocated], FRAME_SIZE << order) != frames[allocated]) {
59
                if (ALIGN_UP(frames[allocated], FRAME_SIZE << order) != frames[allocated]) {
61
                    panic("Test failed. Block at address %p (size %dK) is not aligned\n", frames[allocated], (FRAME_SIZE << order) >> 10);
60
                    panic("Test failed. Block at address %p (size %dK) is not aligned\n", frames[allocated], (FRAME_SIZE << order) >> 10);
62
                }
61
                }
63
               
62