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

sh: wire up vmallocinfo support in ioremap() implementations.

This wires up the caller information for the ioremap VMA, which allows
for more helpful caller tracking via /proc/vmallocinfo. Follows the x86
and powerpc changes of the same nature.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>

+16 -10
+8 -2
arch/sh/include/asm/io.h
··· 233 233 * doesn't exist, so everything must go through page tables. 234 234 */ 235 235 #ifdef CONFIG_MMU 236 - void __iomem *__ioremap(unsigned long offset, unsigned long size, 237 - unsigned long flags); 236 + void __iomem *__ioremap_caller(unsigned long offset, unsigned long size, 237 + unsigned long flags, void *caller); 238 238 void __iounmap(void __iomem *addr); 239 + 240 + static inline void __iomem * 241 + __ioremap(unsigned long offset, unsigned long size, unsigned long flags) 242 + { 243 + return __ioremap_caller(offset, size, flags, __builtin_return_address(0)); 244 + } 239 245 240 246 static inline void __iomem * 241 247 __ioremap_mode(unsigned long offset, unsigned long size, unsigned long flags)
+5 -5
arch/sh/mm/ioremap_32.c
··· 33 33 * have to convert them into an offset in a page-aligned mapping, but the 34 34 * caller shouldn't need to know that small detail. 35 35 */ 36 - void __iomem *__ioremap(unsigned long phys_addr, unsigned long size, 37 - unsigned long flags) 36 + void __iomem *__ioremap_caller(unsigned long phys_addr, unsigned long size, 37 + unsigned long flags, void *caller) 38 38 { 39 - struct vm_struct * area; 39 + struct vm_struct *area; 40 40 unsigned long offset, last_addr, addr, orig_addr; 41 41 pgprot_t pgprot; 42 42 ··· 67 67 /* 68 68 * Ok, go for it.. 69 69 */ 70 - area = get_vm_area(size, VM_IOREMAP); 70 + area = get_vm_area_caller(size, VM_IOREMAP, caller); 71 71 if (!area) 72 72 return NULL; 73 73 area->phys_addr = phys_addr; ··· 103 103 104 104 return (void __iomem *)(offset + (char *)orig_addr); 105 105 } 106 - EXPORT_SYMBOL(__ioremap); 106 + EXPORT_SYMBOL(__ioremap_caller); 107 107 108 108 void __iounmap(void __iomem *addr) 109 109 {
+3 -3
arch/sh/mm/ioremap_64.c
··· 258 258 pte_clear(&init_mm, vaddr, ptep); 259 259 } 260 260 261 - void __iomem *__ioremap(unsigned long offset, unsigned long size, 262 - unsigned long flags) 261 + void __iomem *__ioremap_caller(unsigned long offset, unsigned long size, 262 + unsigned long flags, void *caller) 263 263 { 264 264 char name[14]; 265 265 266 266 sprintf(name, "phys_%08x", (u32)offset); 267 267 return shmedia_alloc_io(offset, size, name, flags); 268 268 } 269 - EXPORT_SYMBOL(__ioremap); 269 + EXPORT_SYMBOL(__ioremap_caller); 270 270 271 271 void __iounmap(void __iomem *virtual) 272 272 {