Subversion Repositories HelenOS-historic

Rev

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

Rev 1196 Rev 1221
Line 38... Line 38...
38
#define MAX_FRAMES 1024
38
#define MAX_FRAMES 1024
39
#define MAX_ORDER 8
39
#define MAX_ORDER 8
40
#define TEST_RUNS 2
40
#define TEST_RUNS 2
41
 
41
 
42
void test(void) {
42
void test(void) {
43
    __address * frames = (__address *) malloc(MAX_FRAMES*sizeof(__address),
43
    __address * frames = (__address *) malloc(MAX_FRAMES*sizeof(__address), 0);
44
                          0);
-
 
45
    int results[MAX_ORDER+1];
44
    int results[MAX_ORDER+1];
46
   
45
   
47
    int i, order, run;
46
    int i, order, run;
48
    int allocated;
47
    int allocated;
49
    int status;
48
    int status;
Line 57... Line 56...
57
            allocated = 0;
56
            allocated = 0;
58
            for (i = 0; i < MAX_FRAMES >> order; i++) {
57
            for (i = 0; i < MAX_FRAMES >> order; i++) {
59
                frames[allocated] = PA2KA(PFN2ADDR(frame_alloc_rc(order, FRAME_ATOMIC | FRAME_KA, &status)));
58
                frames[allocated] = PA2KA(PFN2ADDR(frame_alloc_rc(order, FRAME_ATOMIC | FRAME_KA, &status)));
60
               
59
               
61
                if (ALIGN_UP(frames[allocated], FRAME_SIZE << order) != frames[allocated]) {
60
                if (ALIGN_UP(frames[allocated], FRAME_SIZE << order) != frames[allocated]) {
62
                    panic("Test failed. Block at address %P (size %dK) is not aligned\n", frames[allocated], (FRAME_SIZE << order) >> 10);
61
                    panic("Test failed. Block at address %p (size %dK) is not aligned\n", frames[allocated], (FRAME_SIZE << order) >> 10);
63
                }
62
                }
64
               
63
               
65
                if (status == 0) {
64
                if (status == 0) {
66
                    allocated++;
65
                    allocated++;
67
                } else {
66
                } else {