Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 580e0ad2 authored by Yinghai Lu's avatar Yinghai Lu Committed by H. Peter Anvin
Browse files

core: Move early_res from arch/x86 to kernel/



This makes the range reservation feature available to other
architectures.

-v2: add get_max_mapped, max_pfn_mapped only defined in x86...
     to fix PPC compiling
-v3: according to hpa, add CONFIG_HAVE_EARLY_RES
-v4: fix typo about EARLY_RES in config

Signed-off-by: default avatarYinghai Lu <yinghai@kernel.org>
LKML-Reference: <4B7B5723.4070009@kernel.org>
Signed-off-by: default avatarH. Peter Anvin <hpa@zytor.com>
parent dd645cee
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -183,6 +183,9 @@ config ARCH_SUPPORTS_OPTIMIZED_INLINING
config ARCH_SUPPORTS_DEBUG_PAGEALLOC
	def_bool y

config HAVE_EARLY_RES
	def_bool y

config HAVE_INTEL_TXT
	def_bool y
	depends on EXPERIMENTAL && DMAR && ACPI
+1 −1
Original line number Diff line number Diff line
@@ -112,7 +112,7 @@ extern unsigned long end_user_pfn;
extern u64 find_e820_area(u64 start, u64 end, u64 size, u64 align);
extern u64 find_e820_area_size(u64 start, u64 *sizep, u64 align);
extern u64 early_reserve_e820(u64 startt, u64 sizet, u64 align);
#include <asm/early_res.h>
#include <linux/early_res.h>

extern unsigned long e820_end_of_ram_pfn(void);
extern unsigned long e820_end_of_low_ram_pfn(void);
+1 −1
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@ obj-$(CONFIG_X86_32) += probe_roms_32.o
obj-$(CONFIG_X86_32)	+= sys_i386_32.o i386_ksyms_32.o
obj-$(CONFIG_X86_64)	+= sys_x86_64.o x8664_ksyms_64.o
obj-$(CONFIG_X86_64)	+= syscall_64.o vsyscall_64.o
obj-y			+= bootflag.o e820.o early_res.o
obj-y			+= bootflag.o e820.o
obj-y			+= pci-dma.o quirks.o i8237.o topology.o kdebugfs.o
obj-y			+= alternative.o i8253.o pci-nommu.o hw_breakpoint.o
obj-y			+= tsc.o io_delay.o rtc.o
+9 −1
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@
#include <linux/firmware-map.h>

#include <asm/e820.h>
#include <asm/early_res.h>
#include <asm/proto.h>
#include <asm/setup.h>

@@ -752,6 +751,15 @@ u64 __init find_fw_memmap_area(u64 start, u64 end, u64 size, u64 align)
{
	return find_e820_area(start, end, size, align);
}

u64 __init get_max_mapped(void)
{
	u64 end = max_pfn_mapped;

	end <<= PAGE_SHIFT;

	return end;
}
/*
 * Find next free range after *start
 */
+4 −3
Original line number Diff line number Diff line
#ifndef _ASM_X86_EARLY_RES_H
#define _ASM_X86_EARLY_RES_H
#ifndef _LINUX_EARLY_RES_H
#define _LINUX_EARLY_RES_H
#ifdef __KERNEL__

extern void reserve_early(u64 start, u64 end, char *name);
@@ -13,9 +13,10 @@ u64 find_early_area(u64 ei_start, u64 ei_last, u64 start, u64 end,
u64 find_early_area_size(u64 ei_start, u64 ei_last, u64 start,
			 u64 *sizep, u64 align);
u64 find_fw_memmap_area(u64 start, u64 end, u64 size, u64 align);
u64 get_max_mapped(void);
#include <linux/range.h>
int get_free_all_memory_range(struct range **rangep, int nodeid);

#endif /* __KERNEL__ */

#endif /* _ASM_X86_EARLY_RES_H */
#endif /* _LINUX_EARLY_RES_H */
Loading