H. Peter Anvin | 1965aae | 2008-10-22 22:26:29 -0700 | [diff] [blame] | 1 | #ifndef _ASM_X86_E820_H |
| 2 | #define _ASM_X86_E820_H |
Paul Jackson | 028b785 | 2008-05-14 08:15:40 -0700 | [diff] [blame] | 3 | |
Alex Thorlton | 9d2f86c | 2016-12-05 11:49:13 -0600 | [diff] [blame] | 4 | /* |
| 5 | * E820_X_MAX is the maximum size of the extended E820 table. The extended |
| 6 | * table may contain up to 3 extra E820 entries per possible NUMA node, so we |
| 7 | * make room for 3 * MAX_NUMNODES possible entries, beyond the standard 128. |
Ingo Molnar | 70a9d81 | 2017-01-27 09:58:02 +0100 | [diff] [blame^] | 8 | * Also note that E820_X_MAX *must* be defined before we include asm/e820/types.h. |
Alex Thorlton | 9d2f86c | 2016-12-05 11:49:13 -0600 | [diff] [blame] | 9 | */ |
Paul Jackson | 028b785 | 2008-05-14 08:15:40 -0700 | [diff] [blame] | 10 | #include <linux/numa.h> |
| 11 | #define E820_X_MAX (E820MAX + 3 * MAX_NUMNODES) |
Alex Thorlton | 9d2f86c | 2016-12-05 11:49:13 -0600 | [diff] [blame] | 12 | |
Ingo Molnar | 70a9d81 | 2017-01-27 09:58:02 +0100 | [diff] [blame^] | 13 | #include <asm/e820/types.h> |
Alex Thorlton | 9d2f86c | 2016-12-05 11:49:13 -0600 | [diff] [blame] | 14 | |
Rusty Russell | ee8e7cf | 2007-10-22 10:56:19 +1000 | [diff] [blame] | 15 | #ifndef __ASSEMBLY__ |
Bernhard Walle | 5dfcf14 | 2008-06-27 13:12:55 +0200 | [diff] [blame] | 16 | /* see comment in arch/x86/kernel/e820.c */ |
Denys Vlasenko | 4753396 | 2016-09-17 23:39:26 +0200 | [diff] [blame] | 17 | extern struct e820map *e820; |
| 18 | extern struct e820map *e820_saved; |
Yinghai Lu | b79cd8f | 2008-05-11 00:30:15 -0700 | [diff] [blame] | 19 | |
Jaswinder Singh | a7b7511 | 2008-07-21 22:19:29 +0530 | [diff] [blame] | 20 | extern unsigned long pci_mem_start; |
Yinghai Lu | b79cd8f | 2008-05-11 00:30:15 -0700 | [diff] [blame] | 21 | extern int e820_any_mapped(u64 start, u64 end, unsigned type); |
| 22 | extern int e820_all_mapped(u64 start, u64 end, unsigned type); |
Yinghai Lu | d0be6bd | 2008-06-15 18:58:51 -0700 | [diff] [blame] | 23 | extern void e820_add_region(u64 start, u64 size, int type); |
Yinghai Lu | b79cd8f | 2008-05-11 00:30:15 -0700 | [diff] [blame] | 24 | extern void e820_print_map(char *who); |
Paul Jackson | c3965bd | 2008-05-14 08:15:34 -0700 | [diff] [blame] | 25 | extern int |
Jaswinder Singh Rajput | ba63903 | 2009-03-23 02:13:01 +0530 | [diff] [blame] | 26 | sanitize_e820_map(struct e820entry *biosmap, int max_nr_map, u32 *pnr_map); |
Yinghai Lu | d0be6bd | 2008-06-15 18:58:51 -0700 | [diff] [blame] | 27 | extern u64 e820_update_range(u64 start, u64 size, unsigned old_type, |
Yinghai Lu | b79cd8f | 2008-05-11 00:30:15 -0700 | [diff] [blame] | 28 | unsigned new_type); |
Yinghai Lu | 7a1fd98 | 2008-06-21 14:48:05 -0700 | [diff] [blame] | 29 | extern u64 e820_remove_range(u64 start, u64 size, unsigned old_type, |
| 30 | int checktype); |
Yinghai Lu | b79cd8f | 2008-05-11 00:30:15 -0700 | [diff] [blame] | 31 | extern void update_e820(void); |
| 32 | extern void e820_setup_gap(void); |
Huang, Ying | 8c5beb5 | 2008-06-11 11:33:39 +0800 | [diff] [blame] | 33 | struct setup_data; |
Linn Crosetto | 30e46b5 | 2013-08-13 15:46:41 -0600 | [diff] [blame] | 34 | extern void parse_e820_ext(u64 phys_addr, u32 data_len); |
Yinghai Lu | b79cd8f | 2008-05-11 00:30:15 -0700 | [diff] [blame] | 35 | |
Yinghai Lu | bf62f39 | 2008-05-20 20:10:58 -0700 | [diff] [blame] | 36 | #if defined(CONFIG_X86_64) || \ |
| 37 | (defined(CONFIG_X86_32) && defined(CONFIG_HIBERNATION)) |
| 38 | extern void e820_mark_nosave_regions(unsigned long limit_pfn); |
| 39 | #else |
| 40 | static inline void e820_mark_nosave_regions(unsigned long limit_pfn) |
| 41 | { |
| 42 | } |
| 43 | #endif |
| 44 | |
Yinghai Lu | f361a45 | 2008-07-10 20:38:26 -0700 | [diff] [blame] | 45 | extern unsigned long e820_end_of_ram_pfn(void); |
| 46 | extern unsigned long e820_end_of_low_ram_pfn(void); |
Tejun Heo | ab5d140 | 2011-07-12 11:15:58 +0200 | [diff] [blame] | 47 | extern u64 early_reserve_e820(u64 sizet, u64 align); |
Yinghai Lu | 72d7c3b | 2010-08-25 13:39:17 -0700 | [diff] [blame] | 48 | |
| 49 | void memblock_x86_fill(void); |
Yinghai Lu | 6f2a753 | 2010-08-25 13:39:18 -0700 | [diff] [blame] | 50 | void memblock_find_dma_reserve(void); |
| 51 | |
Yinghai Lu | ab4a465 | 2008-06-10 12:55:54 -0700 | [diff] [blame] | 52 | extern void finish_e820_parsing(void); |
Yinghai Lu | 41c094f | 2008-06-16 13:03:31 -0700 | [diff] [blame] | 53 | extern void e820_reserve_resources(void); |
Yinghai Lu | 58f7c98 | 2008-08-28 13:52:25 -0700 | [diff] [blame] | 54 | extern void e820_reserve_resources_late(void); |
Yinghai Lu | 064d25f | 2008-06-16 19:58:28 -0700 | [diff] [blame] | 55 | extern void setup_memory_map(void); |
Yinghai Lu | 95a71a4 | 2008-06-18 17:27:08 -0700 | [diff] [blame] | 56 | extern char *default_machine_specific_memory_setup(void); |
H. Peter Anvin | 65f116f | 2009-11-23 14:44:39 -0800 | [diff] [blame] | 57 | |
Denys Vlasenko | 4753396 | 2016-09-17 23:39:26 +0200 | [diff] [blame] | 58 | extern void e820_reallocate_tables(void); |
| 59 | |
H. Peter Anvin | ccef086 | 2009-11-30 21:33:51 -0800 | [diff] [blame] | 60 | /* |
| 61 | * Returns true iff the specified range [s,e) is completely contained inside |
| 62 | * the ISA region. |
| 63 | */ |
H. Peter Anvin | 65f116f | 2009-11-23 14:44:39 -0800 | [diff] [blame] | 64 | static inline bool is_ISA_range(u64 s, u64 e) |
| 65 | { |
H. Peter Anvin | ccef086 | 2009-11-30 21:33:51 -0800 | [diff] [blame] | 66 | return s >= ISA_START_ADDRESS && e <= ISA_END_ADDRESS; |
H. Peter Anvin | 65f116f | 2009-11-23 14:44:39 -0800 | [diff] [blame] | 67 | } |
| 68 | |
Rusty Russell | ee8e7cf | 2007-10-22 10:56:19 +1000 | [diff] [blame] | 69 | #endif /* __ASSEMBLY__ */ |
Yinghai Lu | 064d25f | 2008-06-16 19:58:28 -0700 | [diff] [blame] | 70 | #include <linux/ioport.h> |
| 71 | |
Yinghai Lu | 064d25f | 2008-06-16 19:58:28 -0700 | [diff] [blame] | 72 | #define HIGH_MEMORY (1024*1024) |
H. Peter Anvin | 1965aae | 2008-10-22 22:26:29 -0700 | [diff] [blame] | 73 | #endif /* _ASM_X86_E820_H */ |