aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Duyck <alexander.h.duyck@intel.com>2012-11-16 16:53:09 -0500
committerH. Peter Anvin <hpa@linux.intel.com>2012-11-16 19:40:34 -0500
commitfb50b020c5331c8c4bee0eb875865f5f8be6c03a (patch)
treef3f4e092938cd49c65a1ed894b665a692c44ced3
parent77b67063bb6bce6d475e910d3b886a606d0d91f7 (diff)
x86: Move some contents of page_64_types.h into pgtable_64.h and page_64.h
This patch is meant to clean-up the fact that we have several functions in page_64_types.h which really don't belong there. I found this issue when I had tried to replace __phys_addr with an inline function. It resulted in the realmode bits generating compile warnings about types. In order to resolve that I am relocating the address translation to page_64.h since this is in keeping with where these functions are located in 32 bit. In addtion I have relocated several functions defined in init_64.c to pgtable_64.h as this seems to be where most of the functions related to memory initialization were already located. [ hpa: added missing #include <asm/pgtable.h> to apic_numachip.c, as reported by Yinghai Lu. ] Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Link: http://lkml.kernel.org/r/20121116215244.8521.31505.stgit@ahduyck-cp1.jf.intel.com Signed-off-by: H. Peter Anvin <hpa@linux.intel.com> Cc: Yinghai Lu <yinghai@kernel.org> Cc: Daniel J Blueman <daniel@numascale-asia.com>
-rw-r--r--arch/x86/include/asm/page_64.h19
-rw-r--r--arch/x86/include/asm/page_64_types.h22
-rw-r--r--arch/x86/include/asm/pgtable_64.h5
-rw-r--r--arch/x86/kernel/apic/apic_numachip.c1
4 files changed, 25 insertions, 22 deletions
diff --git a/arch/x86/include/asm/page_64.h b/arch/x86/include/asm/page_64.h
index 072694ed81a5..4150999fc20e 100644
--- a/arch/x86/include/asm/page_64.h
+++ b/arch/x86/include/asm/page_64.h
@@ -3,4 +3,23 @@
3 3
4#include <asm/page_64_types.h> 4#include <asm/page_64_types.h>
5 5
6#ifndef __ASSEMBLY__
7
8/* duplicated to the one in bootmem.h */
9extern unsigned long max_pfn;
10extern unsigned long phys_base;
11
12extern unsigned long __phys_addr(unsigned long);
13
14#define __phys_reloc_hide(x) (x)
15
16#ifdef CONFIG_FLATMEM
17#define pfn_valid(pfn) ((pfn) < max_pfn)
18#endif
19
20void clear_page(void *page);
21void copy_page(void *to, void *from);
22
23#endif /* !__ASSEMBLY__ */
24
6#endif /* _ASM_X86_PAGE_64_H */ 25#endif /* _ASM_X86_PAGE_64_H */
diff --git a/arch/x86/include/asm/page_64_types.h b/arch/x86/include/asm/page_64_types.h
index 320f7bb95f76..8b491e66eaa8 100644
--- a/arch/x86/include/asm/page_64_types.h
+++ b/arch/x86/include/asm/page_64_types.h
@@ -50,26 +50,4 @@
50#define KERNEL_IMAGE_SIZE (512 * 1024 * 1024) 50#define KERNEL_IMAGE_SIZE (512 * 1024 * 1024)
51#define KERNEL_IMAGE_START _AC(0xffffffff80000000, UL) 51#define KERNEL_IMAGE_START _AC(0xffffffff80000000, UL)
52 52
53#ifndef __ASSEMBLY__
54void clear_page(void *page);
55void copy_page(void *to, void *from);
56
57/* duplicated to the one in bootmem.h */
58extern unsigned long max_pfn;
59extern unsigned long phys_base;
60
61extern unsigned long __phys_addr(unsigned long);
62#define __phys_reloc_hide(x) (x)
63
64#define vmemmap ((struct page *)VMEMMAP_START)
65
66extern void init_extra_mapping_uc(unsigned long phys, unsigned long size);
67extern void init_extra_mapping_wb(unsigned long phys, unsigned long size);
68
69#endif /* !__ASSEMBLY__ */
70
71#ifdef CONFIG_FLATMEM
72#define pfn_valid(pfn) ((pfn) < max_pfn)
73#endif
74
75#endif /* _ASM_X86_PAGE_64_DEFS_H */ 53#endif /* _ASM_X86_PAGE_64_DEFS_H */
diff --git a/arch/x86/include/asm/pgtable_64.h b/arch/x86/include/asm/pgtable_64.h
index 47356f9df82e..b5d30ad39022 100644
--- a/arch/x86/include/asm/pgtable_64.h
+++ b/arch/x86/include/asm/pgtable_64.h
@@ -183,6 +183,11 @@ extern void cleanup_highmap(void);
183 183
184#define __HAVE_ARCH_PTE_SAME 184#define __HAVE_ARCH_PTE_SAME
185 185
186#define vmemmap ((struct page *)VMEMMAP_START)
187
188extern void init_extra_mapping_uc(unsigned long phys, unsigned long size);
189extern void init_extra_mapping_wb(unsigned long phys, unsigned long size);
190
186#endif /* !__ASSEMBLY__ */ 191#endif /* !__ASSEMBLY__ */
187 192
188#endif /* _ASM_X86_PGTABLE_64_H */ 193#endif /* _ASM_X86_PGTABLE_64_H */
diff --git a/arch/x86/kernel/apic/apic_numachip.c b/arch/x86/kernel/apic/apic_numachip.c
index a65829ac2b9a..ae9196f31261 100644
--- a/arch/x86/kernel/apic/apic_numachip.c
+++ b/arch/x86/kernel/apic/apic_numachip.c
@@ -27,6 +27,7 @@
27#include <asm/apic.h> 27#include <asm/apic.h>
28#include <asm/ipi.h> 28#include <asm/ipi.h>
29#include <asm/apic_flat_64.h> 29#include <asm/apic_flat_64.h>
30#include <asm/pgtable.h>
30 31
31static int numachip_system __read_mostly; 32static int numachip_system __read_mostly;
32 33