Skip to content

Commit

Permalink
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Linus Torvalds committed Sep 5, 2005
2 parents 4846764 + ebede60 commit e766f1c
Show file tree
Hide file tree
Showing 20 changed files with 362 additions and 641 deletions.
1 change: 0 additions & 1 deletion arch/sparc/kernel/sparc_ksyms.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ EXPORT_SYMBOL(set_auxio);
EXPORT_SYMBOL(get_auxio);
#endif
EXPORT_SYMBOL(request_fast_irq);
EXPORT_SYMBOL(io_remap_page_range);
EXPORT_SYMBOL(io_remap_pfn_range);
/* P3: iounit_xxx may be needed, sun4d users */
/* EXPORT_SYMBOL(iounit_map_dma_init); */
Expand Down
57 changes: 0 additions & 57 deletions arch/sparc/mm/generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,6 @@
#include <asm/cacheflush.h>
#include <asm/tlbflush.h>

static inline void forget_pte(pte_t page)
{
#if 0 /* old 2.4 code */
if (pte_none(page))
return;
if (pte_present(page)) {
unsigned long pfn = pte_pfn(page);
struct page *ptpage;
if (!pfn_valid(pfn))
return;
ptpage = pfn_to_page(pfn);
if (PageReserved(ptpage))
return;
page_cache_release(ptpage);
return;
}
swap_free(pte_to_swp_entry(page));
#else
if (!pte_none(page)) {
printk("forget_pte: old mapping existed!\n");
BUG();
}
#endif
}

/* Remap IO memory, the same way as remap_pfn_range(), but use
* the obio memory space.
*
Expand All @@ -60,7 +35,6 @@ static inline void io_remap_pte_range(struct mm_struct *mm, pte_t * pte, unsigne
pte_t oldpage = *pte;
pte_clear(mm, address, pte);
set_pte(pte, mk_pte_io(offset, prot, space));
forget_pte(oldpage);
address += PAGE_SIZE;
offset += PAGE_SIZE;
pte++;
Expand Down Expand Up @@ -88,37 +62,6 @@ static inline int io_remap_pmd_range(struct mm_struct *mm, pmd_t * pmd, unsigned
return 0;
}

int io_remap_page_range(struct vm_area_struct *vma, unsigned long from, unsigned long offset, unsigned long size, pgprot_t prot, int space)
{
int error = 0;
pgd_t * dir;
unsigned long beg = from;
unsigned long end = from + size;
struct mm_struct *mm = vma->vm_mm;

prot = __pgprot(pg_iobits);
offset -= from;
dir = pgd_offset(mm, from);
flush_cache_range(vma, beg, end);

spin_lock(&mm->page_table_lock);
while (from < end) {
pmd_t *pmd = pmd_alloc(current->mm, dir, from);
error = -ENOMEM;
if (!pmd)
break;
error = io_remap_pmd_range(mm, pmd, from, end - from, offset + from, prot, space);
if (error)
break;
from = (from + PGDIR_SIZE) & PGDIR_MASK;
dir++;
}
spin_unlock(&mm->page_table_lock);

flush_tlb_range(vma, beg, end);
return error;
}

int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from,
unsigned long pfn, unsigned long size, pgprot_t prot)
{
Expand Down
Loading

0 comments on commit e766f1c

Please sign in to comment.