blob: ec23d8e1297cc1a622818e834295783e95791822 [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.
8 * Also note that E820_X_MAX *must* be defined before we include uapi/asm/e820.h.
9 */
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
David Howellsaf170c52012-12-14 22:37:13 +000013#include <uapi/asm/e820.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);
Alok Kataria33819592008-06-24 11:48:30 -070033extern int e820_search_gap(unsigned long *gapstart, unsigned long *gapsize,
Alok Katariafd6493e2008-06-25 11:02:42 -070034 unsigned long start_addr, unsigned long long end_addr);
Huang, Ying8c5beb52008-06-11 11:33:39 +080035struct setup_data;
Linn Crosetto30e46b52013-08-13 15:46:41 -060036extern void parse_e820_ext(u64 phys_addr, u32 data_len);
Yinghai Lub79cd8f2008-05-11 00:30:15 -070037
Yinghai Lubf62f392008-05-20 20:10:58 -070038#if defined(CONFIG_X86_64) || \
39 (defined(CONFIG_X86_32) && defined(CONFIG_HIBERNATION))
40extern void e820_mark_nosave_regions(unsigned long limit_pfn);
41#else
42static inline void e820_mark_nosave_regions(unsigned long limit_pfn)
43{
44}
45#endif
46
Yinghai Luf361a452008-07-10 20:38:26 -070047extern unsigned long e820_end_of_ram_pfn(void);
48extern unsigned long e820_end_of_low_ram_pfn(void);
Tejun Heoab5d1402011-07-12 11:15:58 +020049extern u64 early_reserve_e820(u64 sizet, u64 align);
Yinghai Lu72d7c3b2010-08-25 13:39:17 -070050
51void memblock_x86_fill(void);
Yinghai Lu6f2a7532010-08-25 13:39:18 -070052void memblock_find_dma_reserve(void);
53
Yinghai Luab4a4652008-06-10 12:55:54 -070054extern void finish_e820_parsing(void);
Yinghai Lu41c094f2008-06-16 13:03:31 -070055extern void e820_reserve_resources(void);
Yinghai Lu58f7c982008-08-28 13:52:25 -070056extern void e820_reserve_resources_late(void);
Yinghai Lu064d25f2008-06-16 19:58:28 -070057extern void setup_memory_map(void);
Yinghai Lu95a71a42008-06-18 17:27:08 -070058extern char *default_machine_specific_memory_setup(void);
H. Peter Anvin65f116f2009-11-23 14:44:39 -080059
Denys Vlasenko47533962016-09-17 23:39:26 +020060extern void e820_reallocate_tables(void);
61
H. Peter Anvinccef0862009-11-30 21:33:51 -080062/*
63 * Returns true iff the specified range [s,e) is completely contained inside
64 * the ISA region.
65 */
H. Peter Anvin65f116f2009-11-23 14:44:39 -080066static inline bool is_ISA_range(u64 s, u64 e)
67{
H. Peter Anvinccef0862009-11-30 21:33:51 -080068 return s >= ISA_START_ADDRESS && e <= ISA_END_ADDRESS;
H. Peter Anvin65f116f2009-11-23 14:44:39 -080069}
70
Rusty Russellee8e7cf2007-10-22 10:56:19 +100071#endif /* __ASSEMBLY__ */
Yinghai Lu064d25f2008-06-16 19:58:28 -070072#include <linux/ioport.h>
73
Yinghai Lu064d25f2008-06-16 19:58:28 -070074#define HIGH_MEMORY (1024*1024)
H. Peter Anvin1965aae2008-10-22 22:26:29 -070075#endif /* _ASM_X86_E820_H */