Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Alexander Duyck and committed by
H. Peter Anvin
fb50b020 77b67063

+25 -22
+19
arch/x86/include/asm/page_64.h
··· 3 3 4 4 #include <asm/page_64_types.h> 5 5 6 + #ifndef __ASSEMBLY__ 7 + 8 + /* duplicated to the one in bootmem.h */ 9 + extern unsigned long max_pfn; 10 + extern unsigned long phys_base; 11 + 12 + extern 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 + 20 + void clear_page(void *page); 21 + void copy_page(void *to, void *from); 22 + 23 + #endif /* !__ASSEMBLY__ */ 24 + 6 25 #endif /* _ASM_X86_PAGE_64_H */
-22
arch/x86/include/asm/page_64_types.h
··· 50 50 #define KERNEL_IMAGE_SIZE (512 * 1024 * 1024) 51 51 #define KERNEL_IMAGE_START _AC(0xffffffff80000000, UL) 52 52 53 - #ifndef __ASSEMBLY__ 54 - void clear_page(void *page); 55 - void copy_page(void *to, void *from); 56 - 57 - /* duplicated to the one in bootmem.h */ 58 - extern unsigned long max_pfn; 59 - extern unsigned long phys_base; 60 - 61 - extern unsigned long __phys_addr(unsigned long); 62 - #define __phys_reloc_hide(x) (x) 63 - 64 - #define vmemmap ((struct page *)VMEMMAP_START) 65 - 66 - extern void init_extra_mapping_uc(unsigned long phys, unsigned long size); 67 - extern 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 53 #endif /* _ASM_X86_PAGE_64_DEFS_H */
+5
arch/x86/include/asm/pgtable_64.h
··· 183 183 184 184 #define __HAVE_ARCH_PTE_SAME 185 185 186 + #define vmemmap ((struct page *)VMEMMAP_START) 187 + 188 + extern void init_extra_mapping_uc(unsigned long phys, unsigned long size); 189 + extern void init_extra_mapping_wb(unsigned long phys, unsigned long size); 190 + 186 191 #endif /* !__ASSEMBLY__ */ 187 192 188 193 #endif /* _ASM_X86_PGTABLE_64_H */
+1
arch/x86/kernel/apic/apic_numachip.c
··· 27 27 #include <asm/apic.h> 28 28 #include <asm/ipi.h> 29 29 #include <asm/apic_flat_64.h> 30 + #include <asm/pgtable.h> 30 31 31 32 static int numachip_system __read_mostly; 32 33