diff options
author | Dave Airlie <airlied@starflyer.(none)> | 2006-01-03 18:18:01 +1100 |
---|---|---|
committer | Dave Airlie <airlied@linux.ie> | 2006-01-03 18:18:01 +1100 |
commit | 97f2aab6698f3ab2552c41c1024a65ffd0763a6d (patch) | |
tree | bb6e3b2949459f54f884c710fc74d40eef00d834 /arch/sparc64/mm/generic.c | |
parent | d985c1088146607532093d9eaaaf99758f6a4d21 (diff) | |
parent | 88026842b0a760145aa71d69e74fbc9ec118ca44 (diff) |
drm: merge in Linus mainline
Diffstat (limited to 'arch/sparc64/mm/generic.c')
-rw-r--r-- | arch/sparc64/mm/generic.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/arch/sparc64/mm/generic.c b/arch/sparc64/mm/generic.c index 112c316e7cd..580b63da836 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. * @@ -68,6 +77,7 @@ static inline void io_remap_pte_range(struct mm_struct *mm, pte_t * pte, BUG_ON(!pte_none(*pte)); set_pte_at(mm, address, pte, entry); address += PAGE_SIZE; + pte_val(entry) += PAGE_SIZE; pte++; } while (address < curend); } while (address < end); @@ -126,9 +136,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; |