aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2009-12-14 00:23:41 -0500
committerPaul Mundt <lethal@linux-sh.org>2009-12-14 00:23:41 -0500
commitbf3cdeda901c7f42de3cddc8c5aa19f6b8d8f9df (patch)
tree4f0ebc608a8ea53d723be1695fbc9606a255ae85 /arch/sh
parent1232d88a47626cad13ba82f3a9ea814820bc1c65 (diff)
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>
Diffstat (limited to 'arch/sh')
-rw-r--r--arch/sh/include/asm/io.h10
-rw-r--r--arch/sh/mm/ioremap_32.c10
-rw-r--r--arch/sh/mm/ioremap_64.c6
3 files changed, 16 insertions, 10 deletions
diff --git a/arch/sh/include/asm/io.h b/arch/sh/include/asm/io.h
index 512cd3e9d0ca..988c1be58e51 100644
--- a/arch/sh/include/asm/io.h
+++ b/arch/sh/include/asm/io.h
@@ -233,11 +233,17 @@ unsigned long long poke_real_address_q(unsigned long long addr,
233 * doesn't exist, so everything must go through page tables. 233 * doesn't exist, so everything must go through page tables.
234 */ 234 */
235#ifdef CONFIG_MMU 235#ifdef CONFIG_MMU
236void __iomem *__ioremap(unsigned long offset, unsigned long size, 236void __iomem *__ioremap_caller(unsigned long offset, unsigned long size,
237 unsigned long flags); 237 unsigned long flags, void *caller);
238void __iounmap(void __iomem *addr); 238void __iounmap(void __iomem *addr);
239 239
240static inline void __iomem * 240static 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}
245
246static inline void __iomem *
241__ioremap_mode(unsigned long offset, unsigned long size, unsigned long flags) 247__ioremap_mode(unsigned long offset, unsigned long size, unsigned long flags)
242{ 248{
243#if defined(CONFIG_SUPERH32) && !defined(CONFIG_PMB_FIXED) && !defined(CONFIG_PMB) 249#if defined(CONFIG_SUPERH32) && !defined(CONFIG_PMB_FIXED) && !defined(CONFIG_PMB)
diff --git a/arch/sh/mm/ioremap_32.c b/arch/sh/mm/ioremap_32.c
index a86eaa9d75a5..2141befb4f91 100644
--- a/arch/sh/mm/ioremap_32.c
+++ b/arch/sh/mm/ioremap_32.c
@@ -33,10 +33,10 @@
33 * have to convert them into an offset in a page-aligned mapping, but the 33 * have to convert them into an offset in a page-aligned mapping, but the
34 * caller shouldn't need to know that small detail. 34 * caller shouldn't need to know that small detail.
35 */ 35 */
36void __iomem *__ioremap(unsigned long phys_addr, unsigned long size, 36void __iomem *__ioremap_caller(unsigned long phys_addr, unsigned long size,
37 unsigned long flags) 37 unsigned long flags, void *caller)
38{ 38{
39 struct vm_struct * area; 39 struct vm_struct *area;
40 unsigned long offset, last_addr, addr, orig_addr; 40 unsigned long offset, last_addr, addr, orig_addr;
41 pgprot_t pgprot; 41 pgprot_t pgprot;
42 42
@@ -67,7 +67,7 @@ void __iomem *__ioremap(unsigned long phys_addr, unsigned long size,
67 /* 67 /*
68 * Ok, go for it.. 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 if (!area) 71 if (!area)
72 return NULL; 72 return NULL;
73 area->phys_addr = phys_addr; 73 area->phys_addr = phys_addr;
@@ -103,7 +103,7 @@ void __iomem *__ioremap(unsigned long phys_addr, unsigned long size,
103 103
104 return (void __iomem *)(offset + (char *)orig_addr); 104 return (void __iomem *)(offset + (char *)orig_addr);
105} 105}
106EXPORT_SYMBOL(__ioremap); 106EXPORT_SYMBOL(__ioremap_caller);
107 107
108void __iounmap(void __iomem *addr) 108void __iounmap(void __iomem *addr)
109{ 109{
diff --git a/arch/sh/mm/ioremap_64.c b/arch/sh/mm/ioremap_64.c
index b16843d02b76..ef434657d428 100644
--- a/arch/sh/mm/ioremap_64.c
+++ b/arch/sh/mm/ioremap_64.c
@@ -258,15 +258,15 @@ static void shmedia_unmapioaddr(unsigned long vaddr)
258 pte_clear(&init_mm, vaddr, ptep); 258 pte_clear(&init_mm, vaddr, ptep);
259} 259}
260 260
261void __iomem *__ioremap(unsigned long offset, unsigned long size, 261void __iomem *__ioremap_caller(unsigned long offset, unsigned long size,
262 unsigned long flags) 262 unsigned long flags, void *caller)
263{ 263{
264 char name[14]; 264 char name[14];
265 265
266 sprintf(name, "phys_%08x", (u32)offset); 266 sprintf(name, "phys_%08x", (u32)offset);
267 return shmedia_alloc_io(offset, size, name, flags); 267 return shmedia_alloc_io(offset, size, name, flags);
268} 268}
269EXPORT_SYMBOL(__ioremap); 269EXPORT_SYMBOL(__ioremap_caller);
270 270
271void __iounmap(void __iomem *virtual) 271void __iounmap(void __iomem *virtual)
272{ 272{