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

[PATCH] ppc32: make usage of CONFIG_PTE_64BIT & CONFIG_PHYS_64BIT consistent

CONFIG_PTE_64BIT & CONFIG_PHYS_64BIT are not currently consistently used in
the code base. Fixed up the usage such that CONFIG_PTE_64BIT is used when we
have a 64-bit PTE regardless of physical address width. CONFIG_PHYS_64BIT is
used if the physical address width is larger than 32-bits, regardless of PTE
size.

These changes required a few sub-arch specific ifdef's to be fixed and the
introduction of a physical address format string.

Signed-off-by: Kumar Gala <kumar.gala@freescale.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Kumar Gala and committed by
Linus Torvalds
a85f6d4a 7a1e3350

+8 -6
+5 -5
arch/ppc/mm/pgtable.c
··· 74 74 #define p_mapped_by_tlbcam(x) (0UL) 75 75 #endif /* HAVE_TLBCAM */ 76 76 77 - #ifdef CONFIG_44x 77 + #ifdef CONFIG_PTE_64BIT 78 78 /* 44x uses an 8kB pgdir because it has 8-byte Linux PTEs. */ 79 79 #define PGDIR_ORDER 1 80 80 #else ··· 142 142 __free_page(ptepage); 143 143 } 144 144 145 - #ifndef CONFIG_44x 145 + #ifndef CONFIG_PHYS_64BIT 146 146 void __iomem * 147 147 ioremap(phys_addr_t addr, unsigned long size) 148 148 { 149 149 return __ioremap(addr, size, _PAGE_NO_CACHE); 150 150 } 151 - #else /* CONFIG_44x */ 151 + #else /* CONFIG_PHYS_64BIT */ 152 152 void __iomem * 153 153 ioremap64(unsigned long long addr, unsigned long size) 154 154 { ··· 162 162 163 163 return ioremap64(addr64, size); 164 164 } 165 - #endif /* CONFIG_44x */ 165 + #endif /* CONFIG_PHYS_64BIT */ 166 166 167 167 void __iomem * 168 168 __ioremap(phys_addr_t addr, unsigned long size, unsigned long flags) ··· 193 193 */ 194 194 if ( mem_init_done && (p < virt_to_phys(high_memory)) ) 195 195 { 196 - printk("__ioremap(): phys addr "PTE_FMT" is RAM lr %p\n", p, 196 + printk("__ioremap(): phys addr "PHYS_FMT" is RAM lr %p\n", p, 197 197 __builtin_return_address(0)); 198 198 return NULL; 199 199 }
+3 -1
include/asm-ppc/mmu.h
··· 15 15 * virtual/physical addressing like 32-bit virtual / 36-bit 16 16 * physical need a larger than native word size type. -Matt 17 17 */ 18 - #ifndef CONFIG_PTE_64BIT 18 + #ifndef CONFIG_PHYS_64BIT 19 19 typedef unsigned long phys_addr_t; 20 + #define PHYS_FMT "%.8lx" 20 21 #else 21 22 typedef unsigned long long phys_addr_t; 22 23 extern phys_addr_t fixup_bigphys_addr(phys_addr_t, phys_addr_t); 24 + #define PHYS_FMT "%16Lx" 23 25 #endif 24 26 25 27 /* Default "unsigned long" context */