Changeset 1093620 in mainline for test/mm/falloc2/test.c


Ignore:
Timestamp:
2006-01-22T16:51:11Z (20 years ago)
Author:
Sergey Bondari <bondari@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0d8d27c
Parents:
bd6e392
Message:

Fixes, comments, tests to frame allocator

File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/mm/falloc2/test.c

    rbd6e392 r1093620  
    3030#include <mm/page.h>
    3131#include <mm/frame.h>
     32#include <mm/heap.h>
    3233#include <arch/mm/page.h>
    3334#include <arch/types.h>
     
    3738#include <memstr.h>
    3839
    39 #define MAX_FRAMES 128
    40 #define MAX_ORDER 2
     40#define MAX_FRAMES 256
     41#define MAX_ORDER 8
    4142
    4243#define THREAD_RUNS 1
    43 #define THREADS 6
     44#define THREADS 8
    4445
    4546static void thread(void * arg);
     
    5455        index_t k;
    5556       
    56         __address frames[MAX_FRAMES];
     57        __address * frames =  (__address *) malloc(MAX_FRAMES * sizeof(__address));
    5758
    5859        for (run=0;run<THREAD_RUNS;run++) {
     
    6162                        printf("Thread #%d: Allocating %d frames blocks ... \n",val, 1<<order);
    6263                        allocated = 0;
    63                         for (i=0;i<MAX_FRAMES>>order;i++) {
     64                        for (i=0;i < (MAX_FRAMES >> order);i++) {
    6465                                frames[allocated] = frame_alloc(FRAME_NON_BLOCKING | FRAME_KA,order, &status);
    6566                                if (status == 0) {
     
    7576                        printf("Thread #%d: Deallocating ... \n", val);
    7677                        for (i=0;i<allocated;i++) {
     78                       
    7779                                for (k=0;k<=((FRAME_SIZE << order) - 1);k++) {
    7880                                        if ( ((char *) frames[i])[k] != val ) {
     
    8284                               
    8385                                }
    84                        
     86                               
    8587                                frame_free(frames[i]);
    8688                        }
Note: See TracChangeset for help on using the changeset viewer.