Add malloc_high/fseg() and rework bios table creation to use them.
[seabios.git] / src / memmap.h
1 #ifndef __E820MAP_H
2 #define __E820MAP_H
3
4 #include "types.h" // u64
5
6 #define E820_RAM          1
7 #define E820_RESERVED     2
8 #define E820_ACPI         3
9 #define E820_NVS          4
10 #define E820_UNUSABLE     5
11 #define E820_HOLE         ((u32)-1) // Useful for removing entries
12
13 struct e820entry {
14     u64 start;
15     u64 size;
16     u32 type;
17 };
18
19 void add_e820(u64 start, u64 size, u32 type);
20 void memmap_setup();
21 void memmap_finalize();
22
23 void *malloc_high(u32 size);
24 void *malloc_fseg(u32 size);
25 void malloc_setup();
26 void malloc_finalize();
27
28 // e820 map storage (defined in system.c)
29 extern struct e820entry e820_list[];
30 extern int e820_count;
31
32 // Space for exported bios tables (defined in misc.c)
33 extern char BiosTableSpace[];
34
35 #endif // e820map.h