Subversion Repositories HelenOS-historic

Rev

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

Rev 689 Rev 724
Line 31... Line 31...
31
#include <mm/frame.h>
31
#include <mm/frame.h>
32
#include <arch/mm/page.h>
32
#include <arch/mm/page.h>
33
#include <arch/types.h>
33
#include <arch/types.h>
34
#include <debug.h>
34
#include <debug.h>
35
 
35
 
36
#define MAX_FRAMES 1024
36
#define MAX_FRAMES 2048
37
#define MAX_ORDER 8
37
#define MAX_ORDER 8
38
#define TEST_RUNS 4
38
#define TEST_RUNS 4
39
 
39
 
40
void test(void) {
40
void test(void) {
41
    __address frames[MAX_FRAMES];
41
    __address frames[MAX_FRAMES];
Line 50... Line 50...
50
    for (run=0;run<=TEST_RUNS;run++) {
50
    for (run=0;run<=TEST_RUNS;run++) {
51
        for (order=0;order<=MAX_ORDER;order++) {
51
        for (order=0;order<=MAX_ORDER;order++) {
52
            printf("Allocating %d frames blocks ... ", 1<<order);
52
            printf("Allocating %d frames blocks ... ", 1<<order);
53
            allocated = 0;
53
            allocated = 0;
54
            for (i=0;i<MAX_FRAMES>>order;i++) {
54
            for (i=0;i<MAX_FRAMES>>order;i++) {
55
                frames[allocated] = frame_alloc(FRAME_NON_BLOCKING,order, &status);
55
                frames[allocated] = frame_alloc(FRAME_NON_BLOCKING, order, &status);
-
 
56
               
-
 
57
                if (frames[allocated] % (FRAME_SIZE << order) != 0) {
-
 
58
                    panic("Test failed. Block at address %X (size %dK) is not aligned\n", frames[allocated], (FRAME_SIZE << order) >> 10);
-
 
59
                }
-
 
60
               
56
                if (status == 0) {
61
                if (status == 0) {
57
                    allocated++;
62
                    allocated++;
58
                } else {
63
                } else {
59
                    printf("done. ");
64
                    printf("done. ");
60
                    break;
65
                    break;