Changeset a294ad0 in mainline for test


Ignore:
Timestamp:
2006-02-02T14:00:32Z (20 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2d43f3e
Parents:
758e065
Message:

Currently not-working SLAB allocator.

  • slightly changed interface to frame_alloc, allow zone preference
Location:
test/mm
Files:
4 edited

Legend:

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

    r758e065 ra294ad0  
    5656                        allocated = 0;
    5757                        for (i = 0; i < MAX_FRAMES >> order; i++) {
    58                                 frames[allocated] = frame_alloc(FRAME_ATOMIC | FRAME_KA, order, &status);
     58                                frames[allocated] = frame_alloc(FRAME_ATOMIC | FRAME_KA, order, &status, NULL);
    5959                               
    6060                                if (ALIGN_UP(frames[allocated], FRAME_SIZE << order) != frames[allocated]) {
  • test/mm/falloc2/test.c

    r758e065 ra294ad0  
    6464                        allocated = 0;
    6565                        for (i = 0; i < (MAX_FRAMES >> order); i++) {
    66                                 frames[allocated] = frame_alloc(FRAME_ATOMIC | FRAME_KA, order, &status);
     66                                frames[allocated] = frame_alloc(FRAME_ATOMIC | FRAME_KA, order, &status, NULL);
    6767                                if (status == 0) {
    6868                                        memsetb(frames[allocated], FRAME_SIZE << order, val);
  • test/mm/mapping1/test.c

    r758e065 ra294ad0  
    4848        printf("Memory management test mapping #1\n");
    4949
    50         frame0 = frame_alloc(FRAME_KA, ONE_FRAME, NULL);
    51         frame1 = frame_alloc(FRAME_KA, ONE_FRAME, NULL);       
     50        frame0 = frame_alloc(FRAME_KA, ONE_FRAME, NULL, NULL);
     51        frame1 = frame_alloc(FRAME_KA, ONE_FRAME, NULL, NULL); 
    5252
    5353        printf("Writing %L to physical address %P.\n", VALUE0, KA2PA(frame0));
  • test/mm/slab1/test.c

    r758e065 ra294ad0  
    2929#include <test.h>
    3030#include <mm/slab.h>
     31#include <print.h>
     32
     33#define VAL_SIZE    128
     34#define VAL_COUNT   1024
     35
     36void * data[16384];
    3137
    3238void test(void)
    3339{
    34         slab_cache_create("test_cache", 10, 0, NULL, NULL, 0);
     40        slab_cache_t *cache;
     41        int i;
     42       
     43
     44        printf("Creating cache.\n");
     45        cache = slab_cache_create("test_cache", VAL_SIZE, 0, NULL, NULL, SLAB_CACHE_NOMAGAZINE);
     46        slab_print_list();
     47        printf("Destroying cache.\n");
     48        slab_cache_destroy(cache);
     49
     50        printf("Creating cache.\n");
     51        cache = slab_cache_create("test_cache", VAL_SIZE, 0, NULL, NULL,
     52                                  SLAB_CACHE_NOMAGAZINE);
     53       
     54        printf("Allocating %d items...", VAL_COUNT);
     55        for (i=0; i < VAL_COUNT; i++) {
     56                data[i] = slab_alloc(cache, 0);
     57        }
     58        printf("done.\n");
     59        printf("Freeing %d items...", VAL_COUNT);
     60        for (i=0; i < VAL_COUNT; i++) {
     61                slab_free(cache, data[i]);
     62        }
     63        printf("done.\n");
    3564}
Note: See TracChangeset for help on using the changeset viewer.