aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/sparc/kernel/sparc_ksyms.c1
-rw-r--r--arch/sparc/mm/generic.c57
-rw-r--r--arch/sparc64/kernel/pci.c3
-rw-r--r--arch/sparc64/kernel/sparc64_ksyms.c3
-rw-r--r--arch/sparc64/mm/generic.c31
-rw-r--r--include/asm-sparc/pgtable.h3
-rw-r--r--include/asm-sparc64/pgtable.h3
7 files changed, 1 insertions, 100 deletions
diff --git a/arch/sparc/kernel/sparc_ksyms.c b/arch/sparc/kernel/sparc_ksyms.c
index 8faa8dc4de43..5d974a2b735a 100644
--- a/arch/sparc/kernel/sparc_ksyms.c
+++ b/arch/sparc/kernel/sparc_ksyms.c
@@ -175,7 +175,6 @@ EXPORT_SYMBOL(set_auxio);
175EXPORT_SYMBOL(get_auxio); 175EXPORT_SYMBOL(get_auxio);
176#endif 176#endif
177EXPORT_SYMBOL(request_fast_irq); 177EXPORT_SYMBOL(request_fast_irq);
178EXPORT_SYMBOL(io_remap_page_range);
179EXPORT_SYMBOL(io_remap_pfn_range); 178EXPORT_SYMBOL(io_remap_pfn_range);
180 /* P3: iounit_xxx may be needed, sun4d users */ 179 /* P3: iounit_xxx may be needed, sun4d users */
181/* EXPORT_SYMBOL(iounit_map_dma_init); */ 180/* EXPORT_SYMBOL(iounit_map_dma_init); */
diff --git a/arch/sparc/mm/generic.c b/arch/sparc/mm/generic.c
index db27eee3bda1..20ccb957fb77 100644
--- a/arch/sparc/mm/generic.c
+++ b/arch/sparc/mm/generic.c
@@ -16,31 +16,6 @@
16#include <asm/cacheflush.h> 16#include <asm/cacheflush.h>
17#include <asm/tlbflush.h> 17#include <asm/tlbflush.h>
18 18
19static inline void forget_pte(pte_t page)
20{
21#if 0 /* old 2.4 code */
22 if (pte_none(page))
23 return;
24 if (pte_present(page)) {
25 unsigned long pfn = pte_pfn(page);
26 struct page *ptpage;
27 if (!pfn_valid(pfn))
28 return;
29 ptpage = pfn_to_page(pfn);
30 if (PageReserved(ptpage))
31 return;
32 page_cache_release(ptpage);
33 return;
34 }
35 swap_free(pte_to_swp_entry(page));
36#else
37 if (!pte_none(page)) {
38 printk("forget_pte: old mapping existed!\n");
39 BUG();
40 }
41#endif
42}
43
44/* Remap IO memory, the same way as remap_pfn_range(), but use 19/* Remap IO memory, the same way as remap_pfn_range(), but use
45 * the obio memory space. 20 * the obio memory space.
46 * 21 *
@@ -60,7 +35,6 @@ static inline void io_remap_pte_range(struct mm_struct *mm, pte_t * pte, unsigne
60 pte_t oldpage = *pte; 35 pte_t oldpage = *pte;
61 pte_clear(mm, address, pte); 36 pte_clear(mm, address, pte);
62 set_pte(pte, mk_pte_io(offset, prot, space)); 37 set_pte(pte, mk_pte_io(offset, prot, space));
63 forget_pte(oldpage);
64 address += PAGE_SIZE; 38 address += PAGE_SIZE;
65 offset += PAGE_SIZE; 39 offset += PAGE_SIZE;
66 pte++; 40 pte++;
@@ -88,37 +62,6 @@ static inline int io_remap_pmd_range(struct mm_struct *mm, pmd_t * pmd, unsigned
88 return 0; 62 return 0;
89} 63}
90 64
91int io_remap_page_range(struct vm_area_struct *vma, unsigned long from, unsigned long offset, unsigned long size, pgprot_t prot, int space)
92{
93 int error = 0;
94 pgd_t * dir;
95 unsigned long beg = from;
96 unsigned long end = from + size;
97 struct mm_struct *mm = vma->vm_mm;
98
99 prot = __pgprot(pg_iobits);
100 offset -= from;
101 dir = pgd_offset(mm, from);
102 flush_cache_range(vma, beg, end);
103
104 spin_lock(&mm->page_table_lock);
105 while (from < end) {
106 pmd_t *pmd = pmd_alloc(current->mm, dir, from);
107 error = -ENOMEM;
108 if (!pmd)
109 break;
110 error = io_remap_pmd_range(mm, pmd, from, end - from, offset + from, prot, space);
111 if (error)
112 break;
113 from = (from + PGDIR_SIZE) & PGDIR_MASK;
114 dir++;
115 }
116 spin_unlock(&mm->page_table_lock);
117
118 flush_tlb_range(vma, beg, end);
119 return error;
120}
121
122int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from, 65int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from,
123 unsigned long pfn, unsigned long size, pgprot_t prot) 66 unsigned long pfn, unsigned long size, pgprot_t prot)
124{ 67{
diff --git a/arch/sparc64/kernel/pci.c b/arch/sparc64/kernel/pci.c
index f21c993f8856..ec8bf4012c0c 100644
--- a/arch/sparc64/kernel/pci.c
+++ b/arch/sparc64/kernel/pci.c
@@ -736,8 +736,7 @@ static void __pci_mmap_set_flags(struct pci_dev *dev, struct vm_area_struct *vma
736static void __pci_mmap_set_pgprot(struct pci_dev *dev, struct vm_area_struct *vma, 736static void __pci_mmap_set_pgprot(struct pci_dev *dev, struct vm_area_struct *vma,
737 enum pci_mmap_state mmap_state) 737 enum pci_mmap_state mmap_state)
738{ 738{
739 /* Our io_remap_page_range/io_remap_pfn_range takes care of this, 739 /* Our io_remap_pfn_range takes care of this, do nothing. */
740 do nothing. */
741} 740}
742 741
743/* Perform the actual remap of the pages for a PCI device mapping, as appropriate 742/* Perform the actual remap of the pages for a PCI device mapping, as appropriate
diff --git a/arch/sparc64/kernel/sparc64_ksyms.c b/arch/sparc64/kernel/sparc64_ksyms.c
index a3ea697f1adb..d89fc24808d3 100644
--- a/arch/sparc64/kernel/sparc64_ksyms.c
+++ b/arch/sparc64/kernel/sparc64_ksyms.c
@@ -88,8 +88,6 @@ extern int svr4_setcontext(svr4_ucontext_t *uc, struct pt_regs *regs);
88extern int compat_sys_ioctl(unsigned int fd, unsigned int cmd, u32 arg); 88extern int compat_sys_ioctl(unsigned int fd, unsigned int cmd, u32 arg);
89extern int (*handle_mathemu)(struct pt_regs *, struct fpustate *); 89extern int (*handle_mathemu)(struct pt_regs *, struct fpustate *);
90extern long sparc32_open(const char __user * filename, int flags, int mode); 90extern long sparc32_open(const char __user * filename, int flags, int mode);
91extern int io_remap_page_range(struct vm_area_struct *vma, unsigned long from,
92 unsigned long offset, unsigned long size, pgprot_t prot, int space);
93extern int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from, 91extern int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from,
94 unsigned long pfn, unsigned long size, pgprot_t prot); 92 unsigned long pfn, unsigned long size, pgprot_t prot);
95extern void (*prom_palette)(int); 93extern void (*prom_palette)(int);
@@ -245,7 +243,6 @@ EXPORT_SYMBOL(pci_dma_supported);
245#endif 243#endif
246 244
247/* I/O device mmaping on Sparc64. */ 245/* I/O device mmaping on Sparc64. */
248EXPORT_SYMBOL(io_remap_page_range);
249EXPORT_SYMBOL(io_remap_pfn_range); 246EXPORT_SYMBOL(io_remap_pfn_range);
250 247
251/* Solaris/SunOS binary compatibility */ 248/* Solaris/SunOS binary compatibility */
diff --git a/arch/sparc64/mm/generic.c b/arch/sparc64/mm/generic.c
index 6b31f6117a95..c954d91f01d0 100644
--- a/arch/sparc64/mm/generic.c
+++ b/arch/sparc64/mm/generic.c
@@ -116,37 +116,6 @@ static inline int io_remap_pud_range(struct mm_struct *mm, pud_t * pud, unsigned
116 return 0; 116 return 0;
117} 117}
118 118
119int io_remap_page_range(struct vm_area_struct *vma, unsigned long from, unsigned long offset, unsigned long size, pgprot_t prot, int space)
120{
121 int error = 0;
122 pgd_t * dir;
123 unsigned long beg = from;
124 unsigned long end = from + size;
125 struct mm_struct *mm = vma->vm_mm;
126
127 prot = __pgprot(pg_iobits);
128 offset -= from;
129 dir = pgd_offset(mm, from);
130 flush_cache_range(vma, beg, end);
131
132 spin_lock(&mm->page_table_lock);
133 while (from < end) {
134 pud_t *pud = pud_alloc(mm, dir, from);
135 error = -ENOMEM;
136 if (!pud)
137 break;
138 error = io_remap_pud_range(mm, pud, from, end - from, offset + from, prot, space);
139 if (error)
140 break;
141 from = (from + PGDIR_SIZE) & PGDIR_MASK;
142 dir++;
143 }
144 flush_tlb_range(vma, beg, end);
145 spin_unlock(&mm->page_table_lock);
146
147 return error;
148}
149
150int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from, 119int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from,
151 unsigned long pfn, unsigned long size, pgprot_t prot) 120 unsigned long pfn, unsigned long size, pgprot_t prot)
152{ 121{
diff --git a/include/asm-sparc/pgtable.h b/include/asm-sparc/pgtable.h
index 40ed30a2b7c6..8f4f6a959651 100644
--- a/include/asm-sparc/pgtable.h
+++ b/include/asm-sparc/pgtable.h
@@ -435,9 +435,6 @@ extern unsigned long *sparc_valid_addr_bitmap;
435#define kern_addr_valid(addr) \ 435#define kern_addr_valid(addr) \
436 (test_bit(__pa((unsigned long)(addr))>>20, sparc_valid_addr_bitmap)) 436 (test_bit(__pa((unsigned long)(addr))>>20, sparc_valid_addr_bitmap))
437 437
438extern int io_remap_page_range(struct vm_area_struct *vma,
439 unsigned long from, unsigned long to,
440 unsigned long size, pgprot_t prot, int space);
441extern int io_remap_pfn_range(struct vm_area_struct *vma, 438extern int io_remap_pfn_range(struct vm_area_struct *vma,
442 unsigned long from, unsigned long pfn, 439 unsigned long from, unsigned long pfn,
443 unsigned long size, pgprot_t prot); 440 unsigned long size, pgprot_t prot);
diff --git a/include/asm-sparc64/pgtable.h b/include/asm-sparc64/pgtable.h
index 1ae00c5087f1..a2b4f5ed4625 100644
--- a/include/asm-sparc64/pgtable.h
+++ b/include/asm-sparc64/pgtable.h
@@ -410,9 +410,6 @@ extern unsigned long *sparc64_valid_addr_bitmap;
410#define kern_addr_valid(addr) \ 410#define kern_addr_valid(addr) \
411 (test_bit(__pa((unsigned long)(addr))>>22, sparc64_valid_addr_bitmap)) 411 (test_bit(__pa((unsigned long)(addr))>>22, sparc64_valid_addr_bitmap))
412 412
413extern int io_remap_page_range(struct vm_area_struct *vma, unsigned long from,
414 unsigned long offset,
415 unsigned long size, pgprot_t prot, int space);
416extern int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from, 413extern int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from,
417 unsigned long pfn, 414 unsigned long pfn,
418 unsigned long size, pgprot_t prot); 415 unsigned long size, pgprot_t prot);