diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-11-29 03:55:47 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-11-29 03:55:47 -0500 |
commit | b71d4da092801634d04190693a38ca03bdbe2505 (patch) | |
tree | e4adc88ade5832b844768c114b15d4d97253c4d0 /arch/sparc64/mm/generic.c | |
parent | 656563e32c3f1dfdc35b3944305ece1c5dfeade5 (diff) | |
parent | 624f54be206adf970cd8eece16446b027913e533 (diff) |
Merge branch 'master'
Diffstat (limited to 'arch/sparc64/mm/generic.c')
-rw-r--r-- | arch/sparc64/mm/generic.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/arch/sparc64/mm/generic.c b/arch/sparc64/mm/generic.c index 112c316e7cd..d9396c1721c 100644 --- a/arch/sparc64/mm/generic.c +++ b/arch/sparc64/mm/generic.c @@ -15,6 +15,15 @@ #include <asm/page.h> #include <asm/tlbflush.h> +static inline pte_t mk_pte_io(unsigned long page, pgprot_t prot, int space) +{ + pte_t pte; + pte_val(pte) = (((page) | pgprot_val(prot) | _PAGE_E) & + ~(unsigned long)_PAGE_CACHE); + pte_val(pte) |= (((unsigned long)space) << 32); + return pte; +} + /* Remap IO memory, the same way as remap_pfn_range(), but use * the obio memory space. * @@ -126,9 +135,13 @@ int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from, struct mm_struct *mm = vma->vm_mm; int space = GET_IOSPACE(pfn); unsigned long offset = GET_PFN(pfn) << PAGE_SHIFT; + unsigned long phys_base; + + phys_base = offset | (((unsigned long) space) << 32UL); /* See comment in mm/memory.c remap_pfn_range */ - vma->vm_flags |= VM_IO | VM_RESERVED; + vma->vm_flags |= VM_IO | VM_RESERVED | VM_PFNMAP; + vma->vm_pgoff = phys_base >> PAGE_SHIFT; prot = __pgprot(pg_iobits); offset -= from; |