X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=arch%2Fm68k%2Fmm%2Fsun3kmap.c;h=1af24cb5bfe136b4f8e18337ad72d8609bc4e755;hb=97bf2856c6014879bd04983a3e9dfcdac1e7fe85;hp=e8498b209597332ec57ceaebc2680da16d9e3d42;hpb=5273a3df6485dc2ad6aa7ddd441b9a21970f003b;p=linux-2.6.git diff --git a/arch/m68k/mm/sun3kmap.c b/arch/m68k/mm/sun3kmap.c index e8498b209..1af24cb5b 100644 --- a/arch/m68k/mm/sun3kmap.c +++ b/arch/m68k/mm/sun3kmap.c @@ -8,6 +8,7 @@ * for more details. */ +#include #include #include #include @@ -26,7 +27,7 @@ extern void print_pte_vaddr(unsigned long vaddr); extern void mmu_emu_map_pmeg (int context, int vaddr); -static inline void do_page_mapin(unsigned long phys, unsigned long virt, +static inline void do_page_mapin(unsigned long phys, unsigned long virt, unsigned long type) { unsigned long pte; @@ -44,11 +45,11 @@ static inline void do_page_mapin(unsigned long phys, unsigned long virt, } -static inline void do_pmeg_mapin(unsigned long phys, unsigned long virt, +static inline void do_pmeg_mapin(unsigned long phys, unsigned long virt, unsigned long type, int pages) { - if(sun3_get_segmap(virt & ~SUN3_PMEG_MASK) == SUN3_INVALID_PMEG) + if(sun3_get_segmap(virt & ~SUN3_PMEG_MASK) == SUN3_INVALID_PMEG) mmu_emu_map_pmeg(sun3_get_context(), virt); while(pages) { @@ -59,7 +60,7 @@ static inline void do_pmeg_mapin(unsigned long phys, unsigned long virt, } } -void *sun3_ioremap(unsigned long phys, unsigned long size, +void __iomem *sun3_ioremap(unsigned long phys, unsigned long size, unsigned long type) { struct vm_struct *area; @@ -79,7 +80,7 @@ void *sun3_ioremap(unsigned long phys, unsigned long size, return NULL; #ifdef SUN3_KMAP_DEBUG - printk("ioremap: got virt %p size %lx(%lx)\n", + printk("ioremap: got virt %p size %lx(%lx)\n", area->addr, size, area->size); #endif @@ -93,39 +94,41 @@ void *sun3_ioremap(unsigned long phys, unsigned long size, seg_pages = (SUN3_PMEG_SIZE - (virt & SUN3_PMEG_MASK)) / PAGE_SIZE; if(seg_pages > pages) seg_pages = pages; - + do_pmeg_mapin(phys, virt, type, seg_pages); pages -= seg_pages; phys += seg_pages * PAGE_SIZE; virt += seg_pages * PAGE_SIZE; } - - return (void *)ret; + + return (void __iomem *)ret; } - - -void *__ioremap(unsigned long phys, unsigned long size, int cache) + + +void __iomem *__ioremap(unsigned long phys, unsigned long size, int cache) { - + return sun3_ioremap(phys, size, SUN3_PAGE_TYPE_IO); - + } +EXPORT_SYMBOL(__ioremap); -void iounmap(void *addr) +void iounmap(void __iomem *addr) { - vfree((void *)(PAGE_MASK & (unsigned long)addr)); + vfree((void *)(PAGE_MASK & (unsigned long)addr)); } +EXPORT_SYMBOL(iounmap); /* sun3_map_test(addr, val) -- Reads a byte from addr, storing to val, * trapping the potential read fault. Returns 0 if the access faulted, * 1 on success. - * + * * This function is primarily used to check addresses on the VME bus. * * Mucking with the page fault handler seems a little hackish to me, but - * SunOS, NetBSD, and Mach all implemented this check in such a manner, + * SunOS, NetBSD, and Mach all implemented this check in such a manner, * so I figure we're allowed. */ int sun3_map_test(unsigned long addr, char *val) @@ -151,6 +154,6 @@ int sun3_map_test(unsigned long addr, char *val) "_sun3_map_test_end:\n" : "=a"(val), "=r"(ret) : "a"(addr)); - + return ret; }