blob: 8e0f8b85b2099c180c25f41b7b079f148f86bf97 [file] [log] [blame]
Ingo Molnar66441bd2017-01-27 10:27:10 +01001#ifndef _ASM_E820_API_H
2#define _ASM_E820_API_H
Paul Jackson028b7852008-05-14 08:15:40 -07003
Ingo Molnar70a9d812017-01-27 09:58:02 +01004#include <asm/e820/types.h>
Alex Thorlton9d2f86c2016-12-05 11:49:13 -06005
Ingo Molnar61a50102017-01-27 13:54:38 +01006extern struct e820_table *e820_table;
Ingo Molnar544a0f42017-01-28 10:07:49 +01007extern struct e820_table *e820_table_firmware;
Yinghai Lub79cd8f2008-05-11 00:30:15 -07008
Jaswinder Singha7b75112008-07-21 22:19:29 +05309extern unsigned long pci_mem_start;
Ingo Molnar0f856502017-01-27 12:43:49 +010010
Ingo Molnar81b3e092017-01-28 22:34:55 +010011extern bool e820__mapped_any(u64 start, u64 end, enum e820_type type);
12extern bool e820__mapped_all(u64 start, u64 end, enum e820_type type);
Ingo Molnarab6bc042017-01-28 14:19:36 +010013
Ingo Molnar6afc03b2017-01-28 16:52:34 +010014extern void e820__range_add (u64 start, u64 size, enum e820_type type);
15extern u64 e820__range_update(u64 start, u64 size, enum e820_type old_type, enum e820_type new_type);
Ingo Molnar81b3e092017-01-28 22:34:55 +010016extern u64 e820__range_remove(u64 start, u64 size, enum e820_type old_type, bool check_type);
Ingo Molnarab6bc042017-01-28 14:19:36 +010017
Ingo Molnarbe0c3f02017-01-28 14:24:02 +010018extern void e820__print_table(char *who);
Ingo Molnarf9748fa2017-01-28 18:00:35 +010019extern int e820__update_table(struct e820_table *table);
Ingo Molnar6464d292017-01-28 14:03:04 +010020extern void e820__update_table_print(void);
Ingo Molnar2504be72017-01-28 14:28:09 +010021
Ingo Molnar0c6fc112017-01-28 22:52:16 +010022extern unsigned long e820__end_of_ram_pfn(void);
23extern unsigned long e820__end_of_low_ram_pfn(void);
Ingo Molnar2504be72017-01-28 14:28:09 +010024
Ingo Molnar1a127032017-01-28 22:27:28 +010025extern u64 e820__memblock_alloc_reserved(u64 size, u64 align);
Ingo Molnar4918e222017-01-28 11:37:42 +010026extern void e820__memblock_setup(void);
Ingo Molnar2504be72017-01-28 14:28:09 +010027
Ingo Molnar1a127032017-01-28 22:27:28 +010028extern void e820__reserve_setup_data(void);
Ingo Molnar9641bda2017-01-28 13:37:17 +010029extern void e820__finish_early_params(void);
Ingo Molnar1506c8d2017-01-28 22:41:14 +010030extern void e820__reserve_resources(void);
31extern void e820__reserve_resources_late(void);
Ingo Molnar2504be72017-01-28 14:28:09 +010032
Ingo Molnar103e2062017-01-28 09:58:49 +010033extern void e820__memory_setup(void);
Ingo Molnar2504be72017-01-28 14:28:09 +010034extern void e820__memory_setup_extended(u64 phys_addr, u32 data_len);
Ingo Molnar103e2062017-01-28 09:58:49 +010035extern char *e820__memory_setup_default(void);
Ingo Molnar2504be72017-01-28 14:28:09 +010036extern void e820__setup_pci_gap(void);
37
Ingo Molnar0c6fc112017-01-28 22:52:16 +010038extern void e820__reallocate_tables(void);
Ingo Molnar090d7172017-01-28 22:44:12 +010039extern void e820__register_nosave_regions(unsigned long limit_pfn);
Ingo Molnar0f856502017-01-27 12:43:49 +010040
H. Peter Anvinccef0862009-11-30 21:33:51 -080041/*
Ingo Molnar0f856502017-01-27 12:43:49 +010042 * Returns true iff the specified range [start,end) is completely contained inside
H. Peter Anvinccef0862009-11-30 21:33:51 -080043 * the ISA region.
44 */
Ingo Molnar0f856502017-01-27 12:43:49 +010045static inline bool is_ISA_range(u64 start, u64 end)
H. Peter Anvin65f116f2009-11-23 14:44:39 -080046{
Ingo Molnar0f856502017-01-27 12:43:49 +010047 return start >= ISA_START_ADDRESS && end <= ISA_END_ADDRESS;
H. Peter Anvin65f116f2009-11-23 14:44:39 -080048}
49
Ingo Molnar66441bd2017-01-27 10:27:10 +010050#endif /* _ASM_E820_API_H */