2017-01-27 09:27:10 +00:00
|
|
|
#ifndef _ASM_E820_API_H
|
|
|
|
#define _ASM_E820_API_H
|
2008-05-14 15:15:40 +00:00
|
|
|
|
2017-01-27 08:58:02 +00:00
|
|
|
#include <asm/e820/types.h>
|
2016-12-05 17:49:13 +00:00
|
|
|
|
2017-01-27 12:54:38 +00:00
|
|
|
extern struct e820_table *e820_table;
|
2017-01-28 09:07:49 +00:00
|
|
|
extern struct e820_table *e820_table_firmware;
|
2008-05-11 07:30:15 +00:00
|
|
|
|
2008-07-21 16:49:29 +00:00
|
|
|
extern unsigned long pci_mem_start;
|
2017-01-27 11:43:49 +00:00
|
|
|
|
|
|
|
extern int e820_any_mapped(u64 start, u64 end, unsigned type);
|
|
|
|
extern int e820_all_mapped(u64 start, u64 end, unsigned type);
|
2008-06-16 01:58:51 +00:00
|
|
|
extern void e820_add_region(u64 start, u64 size, int type);
|
2008-05-11 07:30:15 +00:00
|
|
|
extern void e820_print_map(char *who);
|
2017-01-27 12:54:38 +00:00
|
|
|
extern int sanitize_e820_table(struct e820_entry *biosmap, int max_nr_map, u32 *pnr_map);
|
2017-01-27 11:43:49 +00:00
|
|
|
extern u64 e820_update_range(u64 start, u64 size, unsigned old_type, unsigned new_type);
|
|
|
|
extern u64 e820_remove_range(u64 start, u64 size, unsigned old_type, int checktype);
|
2008-05-11 07:30:15 +00:00
|
|
|
extern void update_e820(void);
|
|
|
|
extern void e820_setup_gap(void);
|
2017-01-28 12:18:40 +00:00
|
|
|
extern void e820__memory_setup_extended(u64 phys_addr, u32 data_len);
|
2008-07-11 03:38:26 +00:00
|
|
|
extern unsigned long e820_end_of_ram_pfn(void);
|
|
|
|
extern unsigned long e820_end_of_low_ram_pfn(void);
|
2017-01-27 11:43:49 +00:00
|
|
|
extern u64 early_reserve_e820(u64 sizet, u64 align);
|
x86/boot/e820: Rename memblock_x86_fill() to e820__memblock_setup() and improve the explanations
So memblock_x86_fill() is another E820 code misnomer:
- nothing in its name tells us that it's part of the E820 subsystem ...
- The 'fill' wording is ambiguous and doesn't tell us whether it's a single
entry or some process - while the _real_ purpose of the function is hidden,
which is to do a complete setup of the (platform independent) memblock regions.
So rename it accordingly, to e820__memblock_setup().
Also translate this incomprehensible and misleading comment:
/*
* EFI may have more than 128 entries
* We are safe to enable resizing, beause memblock_x86_fill()
* is rather later for x86
*/
memblock_allow_resize();
The worst aspect of this comment isn't even the sloppy typos, but that it
casually mentions a '128' number with no explanation, which makes one lead
to the assumption that this is related to the well-known limit of a maximum
of 128 E820 entries passed via legacy bootloaders.
But no, the _real_ meaning of 128 here is that of the memblock subsystem,
which too happens to have a 128 entries limit for very early memblock
regions (which is unrelated to E820), via INIT_MEMBLOCK_REGIONS ...
So change the comment to a more comprehensible version:
/*
* The bootstrap memblock region count maximum is 128 entries
* (INIT_MEMBLOCK_REGIONS), but EFI might pass us more E820 entries
* than that - so allow memblock resizing.
*
* This is safe, because this call happens pretty late during x86 setup,
* so we know about reserved memory regions already. (This is important
* so that memblock resizing does no stomp over reserved areas.)
*/
memblock_allow_resize();
No change in functionality.
Cc: Alex Thorlton <athorlton@sgi.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Huang, Ying <ying.huang@intel.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Juergen Gross <jgross@suse.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Paul Jackson <pj@sgi.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rafael J. Wysocki <rjw@sisk.pl>
Cc: Tejun Heo <tj@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Wei Yang <richard.weiyang@gmail.com>
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2017-01-28 10:37:42 +00:00
|
|
|
extern void e820__memblock_setup(void);
|
2017-01-28 12:25:45 +00:00
|
|
|
extern void e820_reserve_setup_data(void);
|
2008-06-10 19:55:54 +00:00
|
|
|
extern void finish_e820_parsing(void);
|
2008-06-16 20:03:31 +00:00
|
|
|
extern void e820_reserve_resources(void);
|
2008-08-28 20:52:25 +00:00
|
|
|
extern void e820_reserve_resources_late(void);
|
2017-01-28 08:58:49 +00:00
|
|
|
extern void e820__memory_setup(void);
|
|
|
|
extern char *e820__memory_setup_default(void);
|
2016-09-17 21:39:26 +00:00
|
|
|
extern void e820_reallocate_tables(void);
|
2017-01-27 11:43:49 +00:00
|
|
|
extern void e820_mark_nosave_regions(unsigned long limit_pfn);
|
|
|
|
|
2009-12-01 05:33:51 +00:00
|
|
|
/*
|
2017-01-27 11:43:49 +00:00
|
|
|
* Returns true iff the specified range [start,end) is completely contained inside
|
2009-12-01 05:33:51 +00:00
|
|
|
* the ISA region.
|
|
|
|
*/
|
2017-01-27 11:43:49 +00:00
|
|
|
static inline bool is_ISA_range(u64 start, u64 end)
|
2009-11-23 22:44:39 +00:00
|
|
|
{
|
2017-01-27 11:43:49 +00:00
|
|
|
return start >= ISA_START_ADDRESS && end <= ISA_END_ADDRESS;
|
2009-11-23 22:44:39 +00:00
|
|
|
}
|
2008-01-30 12:33:08 +00:00
|
|
|
|
2017-01-27 09:27:10 +00:00
|
|
|
#endif /* _ASM_E820_API_H */
|