78db240b8c2c62ff89280fbdae5505827a538942
[lugburz] / src / amiga / mem.c
1 #include <stdio.h>
2 #include "serial.h"
3 #include "mem.h"
4 #include "amigalib.h"
5 #include "debug.h"
6
7 int init_mem(void)
8 {
9         struct alib_memnode *mem;
10
11         printf("chip memory top: %lx\n", (unsigned long)execbase->chipmem_top);
12
13         printf("memlist head node:\n");
14         memdump(execbase->memlist.head, sizeof(struct alib_memnode));
15
16         printf("Memory ranges:\n");
17         mem = execbase->memlist.head;
18         while(mem->n_next) {
19                 char *stype;
20                 if(mem->attrib & ALIB_MEMF_CHIP) {
21                         stype = "chip";
22                 } else if(mem->attrib & ALIB_MEMF_FAST) {
23                         stype = "fast";
24                 } else {
25                         stype = "unknown";
26                 }
27                 printf(" %06lx - %06lx: %s\n", (unsigned long)mem->start,
28                                 (unsigned long)mem->end, stype);
29                 mem = mem->n_next;
30         }
31
32         return 0;
33 }