blob: 55c1d76c169f3c47bce441a5d1c4c8985260ddf5 [file] [log] [blame]
H. Peter Anvin1965aae2008-10-22 22:26:29 -07001#ifndef _ASM_X86_E820_H
2#define _ASM_X86_E820_H
Paul Jackson028b7852008-05-14 08:15:40 -07003
Alex Thorlton9d2f86c2016-12-05 11:49:13 -06004/*
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 Molnar70a9d812017-01-27 09:58:02 +01008 * Also note that E820_X_MAX *must* be defined before we include asm/e820/types.h.
Alex Thorlton9d2f86c2016-12-05 11:49:13 -06009 */
Paul Jackson028b7852008-05-14 08:15:40 -070010#include <linux/numa.h>
11#define E820_X_MAX (E820MAX + 3 * MAX_NUMNODES)
Alex Thorlton9d2f86c2016-12-05 11:49:13 -060012
Ingo Molnar70a9d812017-01-27 09:58:02 +010013#include <asm/e820/types.h>
Alex Thorlton9d2f86c2016-12-05 11:49:13 -060014
Rusty Russellee8e7cf2007-10-22 10:56:19 +100015#ifndef __ASSEMBLY__
Bernhard Walle5dfcf142008-06-27 13:12:55 +020016/* see comment in arch/x86/kernel/e820.c */
Denys Vlasenko47533962016-09-17 23:39:26 +020017extern struct e820map *e820;
18extern struct e820map *e820_saved;
Yinghai Lub79cd8f2008-05-11 00:30:15 -070019
Jaswinder Singha7b75112008-07-21 22:19:29 +053020extern unsigned long pci_mem_start;
Yinghai Lub79cd8f2008-05-11 00:30:15 -070021extern int e820_any_mapped(u64 start, u64 end, unsigned type);
22extern int e820_all_mapped(u64 start, u64 end, unsigned type);
Yinghai Lud0be6bd2008-06-15 18:58:51 -070023extern void e820_add_region(u64 start, u64 size, int type);
Yinghai Lub79cd8f2008-05-11 00:30:15 -070024extern void e820_print_map(char *who);
Paul Jacksonc3965bd2008-05-14 08:15:34 -070025extern int
Jaswinder Singh Rajputba639032009-03-23 02:13:01 +053026sanitize_e820_map(struct e820entry *biosmap, int max_nr_map, u32 *pnr_map);
Yinghai Lud0be6bd2008-06-15 18:58:51 -070027extern u64 e820_update_range(u64 start, u64 size, unsigned old_type,
Yinghai Lub79cd8f2008-05-11 00:30:15 -070028 unsigned new_type);
Yinghai Lu7a1fd982008-06-21 14:48:05 -070029extern u64 e820_remove_range(u64 start, u64 size, unsigned old_type,
30 int checktype);
Yinghai Lub79cd8f2008-05-11 00:30:15 -070031extern void update_e820(void);
32extern void e820_setup_gap(void);
Huang, Ying8c5beb52008-06-11 11:33:39 +080033struct setup_data;
Linn Crosetto30e46b52013-08-13 15:46:41 -060034extern void parse_e820_ext(u64 phys_addr, u32 data_len);
Yinghai Lub79cd8f2008-05-11 00:30:15 -070035
Yinghai Lubf62f392008-05-20 20:10:58 -070036#if defined(CONFIG_X86_64) || \
37 (defined(CONFIG_X86_32) && defined(CONFIG_HIBERNATION))
38extern void e820_mark_nosave_regions(unsigned long limit_pfn);
39#else
40static inline void e820_mark_nosave_regions(unsigned long limit_pfn)
41{
42}
43#endif
44
Yinghai Luf361a452008-07-10 20:38:26 -070045extern unsigned long e820_end_of_ram_pfn(void);
46extern unsigned long e820_end_of_low_ram_pfn(void);
Tejun Heoab5d1402011-07-12 11:15:58 +020047extern u64 early_reserve_e820(u64 sizet, u64 align);
Yinghai Lu72d7c3b2010-08-25 13:39:17 -070048
49void memblock_x86_fill(void);
Yinghai Lu6f2a7532010-08-25 13:39:18 -070050void memblock_find_dma_reserve(void);
51
Yinghai Luab4a4652008-06-10 12:55:54 -070052extern void finish_e820_parsing(void);
Yinghai Lu41c094f2008-06-16 13:03:31 -070053extern void e820_reserve_resources(void);
Yinghai Lu58f7c982008-08-28 13:52:25 -070054extern void e820_reserve_resources_late(void);
Yinghai Lu064d25f2008-06-16 19:58:28 -070055extern void setup_memory_map(void);
Yinghai Lu95a71a42008-06-18 17:27:08 -070056extern char *default_machine_specific_memory_setup(void);
H. Peter Anvin65f116f2009-11-23 14:44:39 -080057
Denys Vlasenko47533962016-09-17 23:39:26 +020058extern void e820_reallocate_tables(void);
59
H. Peter Anvinccef0862009-11-30 21:33:51 -080060/*
61 * Returns true iff the specified range [s,e) is completely contained inside
62 * the ISA region.
63 */
H. Peter Anvin65f116f2009-11-23 14:44:39 -080064static inline bool is_ISA_range(u64 s, u64 e)
65{
H. Peter Anvinccef0862009-11-30 21:33:51 -080066 return s >= ISA_START_ADDRESS && e <= ISA_END_ADDRESS;
H. Peter Anvin65f116f2009-11-23 14:44:39 -080067}
68
Rusty Russellee8e7cf2007-10-22 10:56:19 +100069#endif /* __ASSEMBLY__ */
Yinghai Lu064d25f2008-06-16 19:58:28 -070070#include <linux/ioport.h>
71
Yinghai Lu064d25f2008-06-16 19:58:28 -070072#define HIGH_MEMORY (1024*1024)
H. Peter Anvin1965aae2008-10-22 22:26:29 -070073#endif /* _ASM_X86_E820_H */