Commit b79cd8f1 authored by Yinghai Lu's avatar Yinghai Lu Committed by Thomas Gleixner

x86: make e820.c to have common functions

remove the duplicated copy of these functions.
Signed-off-by: default avatarYinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 833e78bf
...@@ -22,7 +22,7 @@ obj-y += setup_$(BITS).o i8259_$(BITS).o setup.o ...@@ -22,7 +22,7 @@ obj-y += setup_$(BITS).o i8259_$(BITS).o setup.o
obj-$(CONFIG_X86_32) += sys_i386_32.o i386_ksyms_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) += sys_x86_64.o x8664_ksyms_64.o
obj-$(CONFIG_X86_64) += syscall_64.o vsyscall_64.o setup64.o obj-$(CONFIG_X86_64) += syscall_64.o vsyscall_64.o setup64.o
obj-y += bootflag.o e820_$(BITS).o obj-y += bootflag.o e820_$(BITS).o e820.o
obj-y += pci-dma.o quirks.o i8237.o topology.o kdebugfs.o obj-y += pci-dma.o quirks.o i8237.o topology.o kdebugfs.o
obj-y += alternative.o i8253.o pci-nommu.o obj-y += alternative.o i8253.o pci-nommu.o
obj-$(CONFIG_X86_64) += bugs_64.o obj-$(CONFIG_X86_64) += bugs_64.o
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -875,7 +875,7 @@ void __init setup_arch(char **cmdline_p) ...@@ -875,7 +875,7 @@ void __init setup_arch(char **cmdline_p)
get_smp_config(); get_smp_config();
#endif #endif
e820_register_memory(); e820_setup_gap();
e820_mark_nosave_regions(); e820_mark_nosave_regions();
#ifdef CONFIG_VT #ifdef CONFIG_VT
......
...@@ -20,6 +20,20 @@ struct e820map { ...@@ -20,6 +20,20 @@ struct e820map {
__u32 nr_map; __u32 nr_map;
struct e820entry map[E820MAX]; struct e820entry map[E820MAX];
}; };
extern struct e820map e820;
extern int e820_any_mapped(u64 start, u64 end, unsigned type);
extern int e820_all_mapped(u64 start, u64 end, unsigned type);
extern void add_memory_region(u64 start, u64 size, int type);
extern void e820_print_map(char *who);
extern int sanitize_e820_map(struct e820entry *biosmap, char *pnr_map);
extern int copy_e820_map(struct e820entry *biosmap, int nr_map);
extern u64 update_memory_range(u64 start, u64 size, unsigned old_type,
unsigned new_type);
extern void update_e820(void);
extern void e820_setup_gap(void);
#endif /* __ASSEMBLY__ */ #endif /* __ASSEMBLY__ */
#define ISA_START_ADDRESS 0xa0000 #define ISA_START_ADDRESS 0xa0000
......
...@@ -21,19 +21,8 @@ ...@@ -21,19 +21,8 @@
extern void setup_memory_map(void); extern void setup_memory_map(void);
extern void finish_e820_parsing(void); extern void finish_e820_parsing(void);
extern struct e820map e820;
extern void update_e820(void);
extern int e820_all_mapped(unsigned long start, unsigned long end,
unsigned type);
extern int e820_any_mapped(u64 start, u64 end, unsigned type);
extern void propagate_e820_map(void); extern void propagate_e820_map(void);
extern void register_bootmem_low_pages(unsigned long max_low_pfn); extern void register_bootmem_low_pages(unsigned long max_low_pfn);
extern void add_memory_region(unsigned long long start,
unsigned long long size, int type);
extern u64 update_memory_range(u64 start, u64 size, unsigned old_type,
unsigned new_type);
extern void e820_register_memory(void);
extern void limit_regions(unsigned long long size); extern void limit_regions(unsigned long long size);
extern void init_iomem_resources(struct resource *code_resource, extern void init_iomem_resources(struct resource *code_resource,
struct resource *data_resource, struct resource *data_resource,
...@@ -47,6 +36,5 @@ static inline void e820_mark_nosave_regions(void) ...@@ -47,6 +36,5 @@ static inline void e820_mark_nosave_regions(void)
} }
#endif #endif
#endif/*!__ASSEMBLY__*/ #endif/*!__ASSEMBLY__*/
#endif/*__E820_HEADER*/ #endif/*__E820_HEADER*/
...@@ -19,34 +19,22 @@ extern unsigned long find_e820_area(unsigned long start, unsigned long end, ...@@ -19,34 +19,22 @@ extern unsigned long find_e820_area(unsigned long start, unsigned long end,
extern unsigned long find_e820_area_size(unsigned long start, extern unsigned long find_e820_area_size(unsigned long start,
unsigned long *sizep, unsigned long *sizep,
unsigned long align); unsigned long align);
extern void add_memory_region(unsigned long start, unsigned long size,
int type);
extern u64 update_memory_range(u64 start, u64 size, unsigned old_type,
unsigned new_type);
extern void setup_memory_region(void); extern void setup_memory_region(void);
extern void contig_e820_setup(void); extern void contig_e820_setup(void);
extern unsigned long e820_end_of_ram(void); extern unsigned long e820_end_of_ram(void);
extern void e820_reserve_resources(void); extern void e820_reserve_resources(void);
extern void e820_mark_nosave_regions(void); extern void e820_mark_nosave_regions(void);
extern int e820_any_mapped(unsigned long start, unsigned long end,
unsigned type);
extern int e820_all_mapped(unsigned long start, unsigned long end,
unsigned type);
extern int e820_any_non_reserved(unsigned long start, unsigned long end); extern int e820_any_non_reserved(unsigned long start, unsigned long end);
extern int is_memory_any_valid(unsigned long start, unsigned long end); extern int is_memory_any_valid(unsigned long start, unsigned long end);
extern int e820_all_non_reserved(unsigned long start, unsigned long end); extern int e820_all_non_reserved(unsigned long start, unsigned long end);
extern int is_memory_all_valid(unsigned long start, unsigned long end); extern int is_memory_all_valid(unsigned long start, unsigned long end);
extern unsigned long e820_hole_size(unsigned long start, unsigned long end); extern unsigned long e820_hole_size(unsigned long start, unsigned long end);
extern void e820_setup_gap(void);
extern void e820_register_active_regions(int nid, unsigned long start_pfn, extern void e820_register_active_regions(int nid, unsigned long start_pfn,
unsigned long end_pfn); unsigned long end_pfn);
extern void finish_e820_parsing(void); extern void finish_e820_parsing(void);
extern struct e820map e820;
extern void update_e820(void);
extern void reserve_early(unsigned long start, unsigned long end, char *name); extern void reserve_early(unsigned long start, unsigned long end, char *name);
extern void free_early(unsigned long start, unsigned long end); extern void free_early(unsigned long start, unsigned long end);
extern void early_res_to_bootmem(unsigned long start, unsigned long end); extern void early_res_to_bootmem(unsigned long start, unsigned long end);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment