Ignore:
File:
1 edited

Legend:

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

    rb0c2075 r8cbf1c3  
    4040#include <arch.h>
    4141
    42 #define MAX_FRAMES  256
     42#define MAX_FRAMES  256U
     43#define MAX_ORDER   8
    4344
    4445#define THREAD_RUNS  1
     
    6566       
    6667        for (unsigned int run = 0; run < THREAD_RUNS; run++) {
    67                 for (size_t count = 1; count <= MAX_FRAMES; count++) {
    68                         size_t bytes = FRAMES2SIZE(count);
    69                        
     68                for (unsigned int order = 0; order <= MAX_ORDER; order++) {
    7069                        TPRINTF("Thread #%" PRIu64 " (cpu%u): "
    71                             "Allocating %zu frames blocks (%zu bytes) ... \n", THREAD->tid,
    72                             CPU->id, count, bytes);
     70                            "Allocating %u frames blocks ... \n", THREAD->tid,
     71                            CPU->id, 1 << order);
    7372                       
    7473                        unsigned int allocated = 0;
    75                         for (unsigned int i = 0; i < (MAX_FRAMES / count); i++) {
     74                        for (unsigned int i = 0; i < (MAX_FRAMES >> order); i++) {
    7675                                frames[allocated] =
    77                                     PA2KA(frame_alloc(count, FRAME_ATOMIC, 0));
     76                                    PA2KA(frame_alloc(order, FRAME_ATOMIC, 0));
    7877                                if (frames[allocated]) {
    79                                         memsetb((void *) frames[allocated], bytes, val);
     78                                        memsetb((void *) frames[allocated], FRAME_SIZE << order, val);
    8079                                        allocated++;
    8180                                } else
     
    9089                       
    9190                        for (unsigned int i = 0; i < allocated; i++) {
    92                                 for (size_t k = 0; k < bytes; k++) {
     91                                for (size_t k = 0; k <= (((size_t) FRAME_SIZE << order) - 1);
     92                                    k++) {
    9393                                        if (((uint8_t *) frames[i])[k] != val) {
    9494                                                TPRINTF("Thread #%" PRIu64 " (cpu%u): "
Note: See TracChangeset for help on using the changeset viewer.