diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2005-02-10 07:19:59 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2005-10-29 14:30:31 -0400 |
commit | c6e8b587718c486b55c2ebecc6de231a30beba35 (patch) | |
tree | 7c6162d449c69fb6425bd27ba341e2d874fb0a1b /arch/mips/mm/ioremap.c | |
parent | 57f0060b8a2bb2a70a4cce1a37d5e0158cea92a6 (diff) |
Update MIPS to use the 4-level pagetable code thereby getting rid of
the compacrapability headers.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/mm/ioremap.c')
-rw-r--r-- | arch/mips/mm/ioremap.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/arch/mips/mm/ioremap.c b/arch/mips/mm/ioremap.c index adf352273f63..d06107360db4 100644 --- a/arch/mips/mm/ioremap.c +++ b/arch/mips/mm/ioremap.c | |||
@@ -79,9 +79,14 @@ static int remap_area_pages(unsigned long address, phys_t phys_addr, | |||
79 | BUG(); | 79 | BUG(); |
80 | spin_lock(&init_mm.page_table_lock); | 80 | spin_lock(&init_mm.page_table_lock); |
81 | do { | 81 | do { |
82 | pud_t *pud; | ||
82 | pmd_t *pmd; | 83 | pmd_t *pmd; |
83 | pmd = pmd_alloc(&init_mm, dir, address); | 84 | |
84 | error = -ENOMEM; | 85 | error = -ENOMEM; |
86 | pud = pud_alloc(&init_mm, dir, address); | ||
87 | if (!pud) | ||
88 | break; | ||
89 | pmd = pmd_alloc(&init_mm, pud, address); | ||
85 | if (!pmd) | 90 | if (!pmd) |
86 | break; | 91 | break; |
87 | if (remap_area_pmd(pmd, address, end - address, | 92 | if (remap_area_pmd(pmd, address, end - address, |
@@ -141,7 +146,7 @@ void * __ioremap(phys_t phys_addr, phys_t size, unsigned long flags) | |||
141 | */ | 146 | */ |
142 | if (IS_LOW512(phys_addr) && IS_LOW512(last_addr) && | 147 | if (IS_LOW512(phys_addr) && IS_LOW512(last_addr) && |
143 | flags == _CACHE_UNCACHED) | 148 | flags == _CACHE_UNCACHED) |
144 | return (void *) KSEG1ADDR(phys_addr); | 149 | return (void *) CKSEG1ADDR(phys_addr); |
145 | 150 | ||
146 | /* | 151 | /* |
147 | * Don't allow anybody to remap normal RAM that we're using.. | 152 | * Don't allow anybody to remap normal RAM that we're using.. |
@@ -180,7 +185,7 @@ void * __ioremap(phys_t phys_addr, phys_t size, unsigned long flags) | |||
180 | return (void *) (offset + (char *)addr); | 185 | return (void *) (offset + (char *)addr); |
181 | } | 186 | } |
182 | 187 | ||
183 | #define IS_KSEG1(addr) (((unsigned long)(addr) & ~0x1fffffffUL) == KSEG1) | 188 | #define IS_KSEG1(addr) (((unsigned long)(addr) & ~0x1fffffffUL) == CKSEG1) |
184 | 189 | ||
185 | void __iounmap(volatile void __iomem *addr) | 190 | void __iounmap(volatile void __iomem *addr) |
186 | { | 191 | { |
@@ -190,10 +195,8 @@ void __iounmap(volatile void __iomem *addr) | |||
190 | return; | 195 | return; |
191 | 196 | ||
192 | p = remove_vm_area((void *) (PAGE_MASK & (unsigned long __force) addr)); | 197 | p = remove_vm_area((void *) (PAGE_MASK & (unsigned long __force) addr)); |
193 | if (!p) { | 198 | if (!p) |
194 | printk(KERN_ERR "iounmap: bad address %p\n", addr); | 199 | printk(KERN_ERR "iounmap: bad address %p\n", addr); |
195 | return; | ||
196 | } | ||
197 | 200 | ||
198 | kfree(p); | 201 | kfree(p); |
199 | } | 202 | } |