sh: wire up vmallocinfo support in ioremap() implementations.
authorPaul Mundt <lethal@linux-sh.org>
Mon, 14 Dec 2009 05:23:41 +0000 (14:23 +0900)
committerPaul Mundt <lethal@linux-sh.org>
Mon, 14 Dec 2009 05:23:41 +0000 (14:23 +0900)
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>
arch/sh/include/asm/io.h
arch/sh/mm/ioremap_32.c
arch/sh/mm/ioremap_64.c

index 512cd3e9d0ca1c92c6153e1cf5a1cc7e460cb644..988c1be58e5157dc764489dbb454cf52ac9589f8 100644 (file)
@@ -233,10 +233,16 @@ unsigned long long poke_real_address_q(unsigned long long addr,
  * doesn't exist, so everything must go through page tables.
  */
 #ifdef CONFIG_MMU
-void __iomem *__ioremap(unsigned long offset, unsigned long size,
-                       unsigned long flags);
+void __iomem *__ioremap_caller(unsigned long offset, unsigned long size,
+                              unsigned long flags, void *caller);
 void __iounmap(void __iomem *addr);
 
+static inline void __iomem *
+__ioremap(unsigned long offset, unsigned long size, unsigned long flags)
+{
+       return __ioremap_caller(offset, size, flags, __builtin_return_address(0));
+}
+
 static inline void __iomem *
 __ioremap_mode(unsigned long offset, unsigned long size, unsigned long flags)
 {
index a86eaa9d75a5a6e4d776820dbde9b6e5542de0e9..2141befb4f918c3ab98b020d8cd8e9598cccaefa 100644 (file)
  * have to convert them into an offset in a page-aligned mapping, but the
  * caller shouldn't need to know that small detail.
  */
-void __iomem *__ioremap(unsigned long phys_addr, unsigned long size,
-                       unsigned long flags)
+void __iomem *__ioremap_caller(unsigned long phys_addr, unsigned long size,
+                              unsigned long flags, void *caller)
 {
-       struct vm_struct * area;
+       struct vm_struct *area;
        unsigned long offset, last_addr, addr, orig_addr;
        pgprot_t pgprot;
 
@@ -67,7 +67,7 @@ void __iomem *__ioremap(unsigned long phys_addr, unsigned long size,
        /*
         * Ok, go for it..
         */
-       area = get_vm_area(size, VM_IOREMAP);
+       area = get_vm_area_caller(size, VM_IOREMAP, caller);
        if (!area)
                return NULL;
        area->phys_addr = phys_addr;
@@ -103,7 +103,7 @@ void __iomem *__ioremap(unsigned long phys_addr, unsigned long size,
 
        return (void __iomem *)(offset + (char *)orig_addr);
 }
-EXPORT_SYMBOL(__ioremap);
+EXPORT_SYMBOL(__ioremap_caller);
 
 void __iounmap(void __iomem *addr)
 {
index b16843d02b76f424051988266c58488d8c93951f..ef434657d4284d5de6fda890f7a75bf32d99993c 100644 (file)
@@ -258,15 +258,15 @@ static void shmedia_unmapioaddr(unsigned long vaddr)
        pte_clear(&init_mm, vaddr, ptep);
 }
 
-void __iomem *__ioremap(unsigned long offset, unsigned long size,
-                       unsigned long flags)
+void __iomem *__ioremap_caller(unsigned long offset, unsigned long size,
+                              unsigned long flags, void *caller)
 {
        char name[14];
 
        sprintf(name, "phys_%08x", (u32)offset);
        return shmedia_alloc_io(offset, size, name, flags);
 }
-EXPORT_SYMBOL(__ioremap);
+EXPORT_SYMBOL(__ioremap_caller);
 
 void __iounmap(void __iomem *virtual)
 {