diff options
| author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-03-21 12:08:21 -0500 |
|---|---|---|
| committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-03-21 12:08:21 -0500 |
| commit | ac58c9059da8886b5e8cde012a80266b18ca146e (patch) | |
| tree | 40bf486843a2cace6c3a959d73423e50e6aa0c00 /arch/sparc64/mm/generic.c | |
| parent | df6db302cb236ac3a683d535a3e2073d9f4b2833 (diff) | |
| parent | c4a1745aa09fc110afdefea0e5d025043e348bae (diff) | |
Merge branch 'linus'
Diffstat (limited to 'arch/sparc64/mm/generic.c')
| -rw-r--r-- | arch/sparc64/mm/generic.c | 40 |
1 files changed, 18 insertions, 22 deletions
diff --git a/arch/sparc64/mm/generic.c b/arch/sparc64/mm/generic.c index 580b63da836b..5fc5c579e35e 100644 --- a/arch/sparc64/mm/generic.c +++ b/arch/sparc64/mm/generic.c | |||
| @@ -15,15 +15,6 @@ | |||
| 15 | #include <asm/page.h> | 15 | #include <asm/page.h> |
| 16 | #include <asm/tlbflush.h> | 16 | #include <asm/tlbflush.h> |
| 17 | 17 | ||
| 18 | static inline pte_t mk_pte_io(unsigned long page, pgprot_t prot, int space) | ||
| 19 | { | ||
| 20 | pte_t pte; | ||
| 21 | pte_val(pte) = (((page) | pgprot_val(prot) | _PAGE_E) & | ||
| 22 | ~(unsigned long)_PAGE_CACHE); | ||
| 23 | pte_val(pte) |= (((unsigned long)space) << 32); | ||
| 24 | return pte; | ||
| 25 | } | ||
| 26 | |||
| 27 | /* Remap IO memory, the same way as remap_pfn_range(), but use | 18 | /* Remap IO memory, the same way as remap_pfn_range(), but use |
| 28 | * the obio memory space. | 19 | * the obio memory space. |
| 29 | * | 20 | * |
| @@ -48,24 +39,29 @@ static inline void io_remap_pte_range(struct mm_struct *mm, pte_t * pte, | |||
| 48 | pte_t entry; | 39 | pte_t entry; |
| 49 | unsigned long curend = address + PAGE_SIZE; | 40 | unsigned long curend = address + PAGE_SIZE; |
| 50 | 41 | ||
| 51 | entry = mk_pte_io(offset, prot, space); | 42 | entry = mk_pte_io(offset, prot, space, PAGE_SIZE); |
| 52 | if (!(address & 0xffff)) { | 43 | if (!(address & 0xffff)) { |
| 53 | if (!(address & 0x3fffff) && !(offset & 0x3ffffe) && end >= address + 0x400000) { | 44 | if (PAGE_SIZE < (4 * 1024 * 1024) && |
| 54 | entry = mk_pte_io(offset, | 45 | !(address & 0x3fffff) && |
| 55 | __pgprot(pgprot_val (prot) | _PAGE_SZ4MB), | 46 | !(offset & 0x3ffffe) && |
| 56 | space); | 47 | end >= address + 0x400000) { |
| 48 | entry = mk_pte_io(offset, prot, space, | ||
| 49 | 4 * 1024 * 1024); | ||
| 57 | curend = address + 0x400000; | 50 | curend = address + 0x400000; |
| 58 | offset += 0x400000; | 51 | offset += 0x400000; |
| 59 | } else if (!(address & 0x7ffff) && !(offset & 0x7fffe) && end >= address + 0x80000) { | 52 | } else if (PAGE_SIZE < (512 * 1024) && |
| 60 | entry = mk_pte_io(offset, | 53 | !(address & 0x7ffff) && |
| 61 | __pgprot(pgprot_val (prot) | _PAGE_SZ512K), | 54 | !(offset & 0x7fffe) && |
| 62 | space); | 55 | end >= address + 0x80000) { |
| 56 | entry = mk_pte_io(offset, prot, space, | ||
| 57 | 512 * 1024 * 1024); | ||
| 63 | curend = address + 0x80000; | 58 | curend = address + 0x80000; |
| 64 | offset += 0x80000; | 59 | offset += 0x80000; |
| 65 | } else if (!(offset & 0xfffe) && end >= address + 0x10000) { | 60 | } else if (PAGE_SIZE < (64 * 1024) && |
| 66 | entry = mk_pte_io(offset, | 61 | !(offset & 0xfffe) && |
| 67 | __pgprot(pgprot_val (prot) | _PAGE_SZ64K), | 62 | end >= address + 0x10000) { |
| 68 | space); | 63 | entry = mk_pte_io(offset, prot, space, |
| 64 | 64 * 1024); | ||
| 69 | curend = address + 0x10000; | 65 | curend = address + 0x10000; |
| 70 | offset += 0x10000; | 66 | offset += 0x10000; |
| 71 | } else | 67 | } else |
