aboutsummaryrefslogtreecommitdiffstats
path: root/arch/parisc/mm/ioremap.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/parisc/mm/ioremap.c')
-rw-r--r--arch/parisc/mm/ioremap.c54
1 files changed, 9 insertions, 45 deletions
diff --git a/arch/parisc/mm/ioremap.c b/arch/parisc/mm/ioremap.c
index edd9a9559cba..0db12818d7bc 100644
--- a/arch/parisc/mm/ioremap.c
+++ b/arch/parisc/mm/ioremap.c
@@ -72,7 +72,6 @@ remap_area_pmd(pmd_t *pmd, unsigned long address, unsigned long size,
72 return 0; 72 return 0;
73} 73}
74 74
75#if USE_HPPA_IOREMAP
76static int 75static int
77remap_area_pages(unsigned long address, unsigned long phys_addr, 76remap_area_pages(unsigned long address, unsigned long phys_addr,
78 unsigned long size, unsigned long flags) 77 unsigned long size, unsigned long flags)
@@ -114,31 +113,6 @@ remap_area_pages(unsigned long address, unsigned long phys_addr,
114 113
115 return error; 114 return error;
116} 115}
117#endif /* USE_HPPA_IOREMAP */
118
119#ifdef CONFIG_DEBUG_IOREMAP
120static unsigned long last = 0;
121
122void gsc_bad_addr(unsigned long addr)
123{
124 if (time_after(jiffies, last + HZ*10)) {
125 printk("gsc_foo() called with bad address 0x%lx\n", addr);
126 dump_stack();
127 last = jiffies;
128 }
129}
130EXPORT_SYMBOL(gsc_bad_addr);
131
132void __raw_bad_addr(const volatile void __iomem *addr)
133{
134 if (time_after(jiffies, last + HZ*10)) {
135 printk("__raw_foo() called with bad address 0x%p\n", addr);
136 dump_stack();
137 last = jiffies;
138 }
139}
140EXPORT_SYMBOL(__raw_bad_addr);
141#endif
142 116
143/* 117/*
144 * Generic mapping function (not visible outside): 118 * Generic mapping function (not visible outside):
@@ -154,26 +128,19 @@ EXPORT_SYMBOL(__raw_bad_addr);
154 */ 128 */
155void __iomem * __ioremap(unsigned long phys_addr, unsigned long size, unsigned long flags) 129void __iomem * __ioremap(unsigned long phys_addr, unsigned long size, unsigned long flags)
156{ 130{
157#if !(USE_HPPA_IOREMAP) 131 void *addr;
132 struct vm_struct *area;
133 unsigned long offset, last_addr;
158 134
135#ifdef CONFIG_EISA
159 unsigned long end = phys_addr + size - 1; 136 unsigned long end = phys_addr + size - 1;
160 /* Support EISA addresses */ 137 /* Support EISA addresses */
161 if ((phys_addr >= 0x00080000 && end < 0x000fffff) 138 if ((phys_addr >= 0x00080000 && end < 0x000fffff) ||
162 || (phys_addr >= 0x00500000 && end < 0x03bfffff)) { 139 (phys_addr >= 0x00500000 && end < 0x03bfffff)) {
163 phys_addr |= 0xfc000000; 140 phys_addr |= F_EXTEND(0xfc000000);
164 } 141 }
165
166#ifdef CONFIG_DEBUG_IOREMAP
167 return (void __iomem *)(phys_addr - (0x1UL << NYBBLE_SHIFT));
168#else
169 return (void __iomem *)phys_addr;
170#endif 142#endif
171 143
172#else
173 void *addr;
174 struct vm_struct *area;
175 unsigned long offset, last_addr;
176
177 /* Don't allow wraparound or zero size */ 144 /* Don't allow wraparound or zero size */
178 last_addr = phys_addr + size - 1; 145 last_addr = phys_addr + size - 1;
179 if (!size || last_addr < phys_addr) 146 if (!size || last_addr < phys_addr)
@@ -217,15 +184,12 @@ void __iomem * __ioremap(unsigned long phys_addr, unsigned long size, unsigned l
217 } 184 }
218 185
219 return (void __iomem *) (offset + (char *)addr); 186 return (void __iomem *) (offset + (char *)addr);
220#endif
221} 187}
188EXPORT_SYMBOL(__ioremap);
222 189
223void iounmap(void __iomem *addr) 190void iounmap(void __iomem *addr)
224{ 191{
225#if !(USE_HPPA_IOREMAP)
226 return;
227#else
228 if (addr > high_memory) 192 if (addr > high_memory)
229 return vfree((void *) (PAGE_MASK & (unsigned long __force) addr)); 193 return vfree((void *) (PAGE_MASK & (unsigned long __force) addr));
230#endif
231} 194}
195EXPORT_SYMBOL(iounmap);