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

Subversion Repositories c0or1k

[/] [c0or1k/] [trunk/] [src/] [glue/] [tests/] [debug.c] - Blame information for rev 3

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

Line No. Rev Author Line
1 2 drasko
#include <generic/physmem.h>
2
#include "debug.h"
3
#include <stdio.h>
4
 
5
void print_page_area_list(struct page_area *p)
6
{
7
        struct page_area *current_item = p;
8
        struct link *begin = &p->list;
9
        if (!current_item) {
10
                printf("%-20s\n", "Null list.");
11
                return;
12
        }
13
 
14
        printf("%-20s", "Page area:");
15
        printf("%s", (list_empty(&current_item->list) ? "(Single Item.)\n" : "\n"));
16
        printf("%-20s\n","-------------------------");
17
        printf("%-20s %d\n", "Index:", current_item->index);
18
        printf("%-20s %d\n", "Used:", current_item->used);
19
        printf("%-20s %d\n\n", "Number of pages:", current_item->numpages);
20
 
21
        list_foreach_struct (current_item, begin, list) {
22
                printf("%-20s\n%-20s\n", "Page area:","-------------------------");
23
                printf("%-20s %d\n", "Index:", current_item->index);
24
                printf("%-20s %d\n", "Used:", current_item->used);
25
                printf("%-20s %d\n\n", "Number of pages:", current_item->numpages);
26
        }
27
}
28
void print_subpage_area(struct subpage_area *s)
29
{
30
        printf("%-20s\n%-20s\n", "Subpage area:","-------------------------");
31
        printf("%-20s 0x%x\n", "Addr:", s->vaddr);
32
        printf("%-20s 0x%x\n", "Size:", s->size);
33
        printf("%-20s %d\n", "Used:", s->used);
34
        printf("%-20s %d\n\n", "Head_of_pages:", s->head_of_pages);
35
 
36
}
37
 
38
void print_subpage_area_list(struct subpage_area *s)
39
{
40
        struct subpage_area *current_item = s;
41
        struct link *begin = &s->list;
42
        if (!current_item) {
43
                printf("Null list.\n");
44
                return;
45
        }
46
 
47
        printf("%-20s", "Subpage area:");
48
        printf("%s", (list_empty(&current_item->list) ? "(Single Item.)\n" : "\n"));
49
        printf("%-20s\n","-------------------------");
50
        printf("%-20s 0x%x\n", "Addr:", current_item->vaddr);
51
        printf("%-20s 0x%x\n", "Size:", current_item->size);
52
        printf("%-20s %d\n", "Used:", current_item->used);
53
        printf("%-20s %d\n\n", "Head_of_pages:", current_item->head_of_pages);
54
 
55
        list_foreach_struct (current_item, begin, list) {
56
                print_subpage_area(current_item);
57
        }
58
}
59
 

powered by: WebSVN 2.1.0

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