blob: 3ab0537872fb790e6864674efcf3130324687723 [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
Paul Jackson028b7852008-05-14 08:15:40 -07004#ifdef CONFIG_EFI
5#include <linux/numa.h>
6#define E820_X_MAX (E820MAX + 3 * MAX_NUMNODES)
7#else /* ! CONFIG_EFI */
8#define E820_X_MAX E820MAX
9#endif
David Howellsaf170c52012-12-14 22:37:13 +000010#include <uapi/asm/e820.h>
Rusty Russellee8e7cf2007-10-22 10:56:19 +100011#ifndef __ASSEMBLY__
Bernhard Walle5dfcf142008-06-27 13:12:55 +020012/* see comment in arch/x86/kernel/e820.c */
Yinghai Lub79cd8f2008-05-11 00:30:15 -070013extern struct e820map e820;
Bernhard Walle5dfcf142008-06-27 13:12:55 +020014extern struct e820map e820_saved;
Yinghai Lub79cd8f2008-05-11 00:30:15 -070015
Jaswinder Singha7b75112008-07-21 22:19:29 +053016extern unsigned long pci_mem_start;
Yinghai Lub79cd8f2008-05-11 00:30:15 -070017extern int e820_any_mapped(u64 start, u64 end, unsigned type);
18extern int e820_all_mapped(u64 start, u64 end, unsigned type);
Yinghai Lud0be6bd2008-06-15 18:58:51 -070019extern void e820_add_region(u64 start, u64 size, int type);
Yinghai Lub79cd8f2008-05-11 00:30:15 -070020extern void e820_print_map(char *who);
Paul Jacksonc3965bd2008-05-14 08:15:34 -070021extern int
Jaswinder Singh Rajputba639032009-03-23 02:13:01 +053022sanitize_e820_map(struct e820entry *biosmap, int max_nr_map, u32 *pnr_map);
Yinghai Lud0be6bd2008-06-15 18:58:51 -070023extern u64 e820_update_range(u64 start, u64 size, unsigned old_type,
Yinghai Lub79cd8f2008-05-11 00:30:15 -070024 unsigned new_type);
Yinghai Lu7a1fd982008-06-21 14:48:05 -070025extern u64 e820_remove_range(u64 start, u64 size, unsigned old_type,
26 int checktype);
Yinghai Lub79cd8f2008-05-11 00:30:15 -070027extern void update_e820(void);
28extern void e820_setup_gap(void);
Alok Kataria33819592008-06-24 11:48:30 -070029extern int e820_search_gap(unsigned long *gapstart, unsigned long *gapsize,
Alok Katariafd6493e2008-06-25 11:02:42 -070030 unsigned long start_addr, unsigned long long end_addr);
Huang, Ying8c5beb52008-06-11 11:33:39 +080031struct setup_data;
Linn Crosetto30e46b52013-08-13 15:46:41 -060032extern void parse_e820_ext(u64 phys_addr, u32 data_len);
Yinghai Lub79cd8f2008-05-11 00:30:15 -070033
Yinghai Lubf62f392008-05-20 20:10:58 -070034#if defined(CONFIG_X86_64) || \
35 (defined(CONFIG_X86_32) && defined(CONFIG_HIBERNATION))
36extern void e820_mark_nosave_regions(unsigned long limit_pfn);
37#else
38static inline void e820_mark_nosave_regions(unsigned long limit_pfn)
39{
40}
41#endif
42
Yinghai Luf361a452008-07-10 20:38:26 -070043extern unsigned long e820_end_of_ram_pfn(void);
44extern unsigned long e820_end_of_low_ram_pfn(void);
Tejun Heoab5d1402011-07-12 11:15:58 +020045extern u64 early_reserve_e820(u64 sizet, u64 align);
Yinghai Lu72d7c3b2010-08-25 13:39:17 -070046
47void memblock_x86_fill(void);
Yinghai Lu6f2a7532010-08-25 13:39:18 -070048void memblock_find_dma_reserve(void);
49
Yinghai Luab4a4652008-06-10 12:55:54 -070050extern void finish_e820_parsing(void);
Yinghai Lu41c094f2008-06-16 13:03:31 -070051extern void e820_reserve_resources(void);
Yinghai Lu58f7c982008-08-28 13:52:25 -070052extern void e820_reserve_resources_late(void);
Yinghai Lu064d25f2008-06-16 19:58:28 -070053extern void setup_memory_map(void);
Yinghai Lu95a71a42008-06-18 17:27:08 -070054extern char *default_machine_specific_memory_setup(void);
H. Peter Anvin65f116f2009-11-23 14:44:39 -080055
H. Peter Anvinccef0862009-11-30 21:33:51 -080056/*
57 * Returns true iff the specified range [s,e) is completely contained inside
58 * the ISA region.
59 */
H. Peter Anvin65f116f2009-11-23 14:44:39 -080060static inline bool is_ISA_range(u64 s, u64 e)
61{
H. Peter Anvinccef0862009-11-30 21:33:51 -080062 return s >= ISA_START_ADDRESS && e <= ISA_END_ADDRESS;
H. Peter Anvin65f116f2009-11-23 14:44:39 -080063}
64
Rusty Russellee8e7cf2007-10-22 10:56:19 +100065#endif /* __ASSEMBLY__ */
Yinghai Lu064d25f2008-06-16 19:58:28 -070066#include <linux/ioport.h>
67
Yinghai Lu064d25f2008-06-16 19:58:28 -070068#define HIGH_MEMORY (1024*1024)
H. Peter Anvin1965aae2008-10-22 22:26:29 -070069#endif /* _ASM_X86_E820_H */