OpenCores
URL https://opencores.org/ocsvn/c0or1k/c0or1k/trunk

Subversion Repositories c0or1k

[/] [c0or1k/] [trunk/] [src/] [glue/] [tests/] [test_kmalloc.c] - Blame information for rev 6

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 drasko
#include <macros.h>
2
#include <config.h>
3
#include <lib/list.h>
4
#include <lib/printk.h>
5
#include INC_GLUE(memory.h)
6
#include <stdlib.h>
7
#include <stdio.h>
8
#include <string.h>
9
#include <time.h>
10
#include "test_alloc_generic.h"
11
#include "test_allocpage.h"
12
#include "debug.h"
13
#include "tests.h"
14
 
15
 
16
extern struct subpage_area *km_areas;
17
extern struct page_area *areas;
18
 
19
void print_kmalloc_state(void)
20
{
21
        print_subpage_area_list(km_areas);
22
}
23
 
24
void test_kmalloc(int kmalloc_allocations, int kmalloc_alloc_size_max,
25
                  FILE *init_state, FILE *exit_state)
26
{
27
        unsigned int KMALLOC_ALLOCATIONS = 20;
28
        unsigned int KMALLOC_ALLOC_SIZE_MAX = (PAGE_SIZE * 3);
29
 
30
        if (!kmalloc_allocations)
31
                kmalloc_allocations = KMALLOC_ALLOCATIONS;
32
        if (!kmalloc_alloc_size_max)
33
                kmalloc_alloc_size_max = KMALLOC_ALLOC_SIZE_MAX;
34
 
35
        test_alloc_free_random_order(kmalloc_allocations, kmalloc_alloc_size_max,
36
                                     kmalloc, kfree, print_kmalloc_state,
37
                                     init_state, exit_state);
38
}
39
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.