Rusty Russell | ee8e7cf | 2007-10-22 10:56:19 +1000 | [diff] [blame] | 1 | #ifndef __ASM_E820_H |
| 2 | #define __ASM_E820_H |
| 3 | #define E820MAP 0x2d0 /* our map */ |
| 4 | #define E820MAX 128 /* number of entries in E820MAP */ |
| 5 | #define E820NR 0x1e8 /* # entries in E820MAP */ |
| 6 | |
| 7 | #define E820_RAM 1 |
| 8 | #define E820_RESERVED 2 |
| 9 | #define E820_ACPI 3 |
| 10 | #define E820_NVS 4 |
| 11 | |
| 12 | #ifndef __ASSEMBLY__ |
| 13 | struct e820entry { |
| 14 | __u64 addr; /* start of memory segment */ |
| 15 | __u64 size; /* size of memory segment */ |
| 16 | __u32 type; /* type of memory segment */ |
| 17 | } __attribute__((packed)); |
| 18 | |
| 19 | struct e820map { |
| 20 | __u32 nr_map; |
| 21 | struct e820entry map[E820MAX]; |
| 22 | }; |
Yinghai Lu | b79cd8f | 2008-05-11 00:30:15 -0700 | [diff] [blame] | 23 | |
| 24 | extern struct e820map e820; |
| 25 | |
| 26 | extern int e820_any_mapped(u64 start, u64 end, unsigned type); |
| 27 | extern int e820_all_mapped(u64 start, u64 end, unsigned type); |
| 28 | extern void add_memory_region(u64 start, u64 size, int type); |
| 29 | extern void e820_print_map(char *who); |
Paul Jackson | c3965bd | 2008-05-14 08:15:34 -0700 | [diff] [blame^] | 30 | extern int |
| 31 | sanitize_e820_map(struct e820entry *biosmap, int max_nr_map, char *pnr_map); |
Yinghai Lu | b79cd8f | 2008-05-11 00:30:15 -0700 | [diff] [blame] | 32 | extern int copy_e820_map(struct e820entry *biosmap, int nr_map); |
| 33 | extern u64 update_memory_range(u64 start, u64 size, unsigned old_type, |
| 34 | unsigned new_type); |
| 35 | extern void update_e820(void); |
| 36 | extern void e820_setup_gap(void); |
| 37 | |
Rusty Russell | ee8e7cf | 2007-10-22 10:56:19 +1000 | [diff] [blame] | 38 | #endif /* __ASSEMBLY__ */ |
| 39 | |
Ingo Molnar | 306c142 | 2008-01-30 13:33:08 +0100 | [diff] [blame] | 40 | #define ISA_START_ADDRESS 0xa0000 |
| 41 | #define ISA_END_ADDRESS 0x100000 |
| 42 | |
Thomas Gleixner | 950f9d9 | 2008-01-30 13:34:06 +0100 | [diff] [blame] | 43 | #define BIOS_BEGIN 0x000a0000 |
| 44 | #define BIOS_END 0x00100000 |
| 45 | |
Rusty Russell | ee8e7cf | 2007-10-22 10:56:19 +1000 | [diff] [blame] | 46 | #ifdef __KERNEL__ |
Thomas Gleixner | 96a388d | 2007-10-11 11:20:03 +0200 | [diff] [blame] | 47 | #ifdef CONFIG_X86_32 |
| 48 | # include "e820_32.h" |
| 49 | #else |
| 50 | # include "e820_64.h" |
| 51 | #endif |
Rusty Russell | ee8e7cf | 2007-10-22 10:56:19 +1000 | [diff] [blame] | 52 | #endif /* __KERNEL__ */ |
| 53 | |
| 54 | #endif /* __ASM_E820_H */ |