aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/mm/srmmu.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-05-12 16:39:23 -0400
committerDavid S. Miller <davem@davemloft.net>2012-05-12 16:39:23 -0400
commit62875cff73fbb7c22bdb96e42d2e78cfe8464e06 (patch)
treed79aafc5acd64ce2a3020ce8dbc6533655783405 /arch/sparc/mm/srmmu.c
parenta3c5c6637bd7ddae34aa0cd8b6baf7cc33a8b163 (diff)
sparc32: Un-btfixup set_pte, pte_present, mk_pte{_phys,_io}().
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/mm/srmmu.c')
-rw-r--r--arch/sparc/mm/srmmu.c35
1 files changed, 6 insertions, 29 deletions
diff --git a/arch/sparc/mm/srmmu.c b/arch/sparc/mm/srmmu.c
index 71abcc5d82b6..224db00447c7 100644
--- a/arch/sparc/mm/srmmu.c
+++ b/arch/sparc/mm/srmmu.c
@@ -116,9 +116,6 @@ static inline unsigned long srmmu_pgd_page(pgd_t pgd)
116static inline int srmmu_pte_none(pte_t pte) 116static inline int srmmu_pte_none(pte_t pte)
117{ return !(pte_val(pte) & 0xFFFFFFF); } 117{ return !(pte_val(pte) & 0xFFFFFFF); }
118 118
119static inline int srmmu_pte_present(pte_t pte)
120{ return ((pte_val(pte) & SRMMU_ET_MASK) == SRMMU_ET_PTE); }
121
122static inline int srmmu_pmd_none(pmd_t pmd) 119static inline int srmmu_pmd_none(pmd_t pmd)
123{ return !(pmd_val(pmd) & 0xFFFFFFF); } 120{ return !(pmd_val(pmd) & 0xFFFFFFF); }
124 121
@@ -140,25 +137,12 @@ static inline pte_t srmmu_pte_mkdirty(pte_t pte)
140static inline pte_t srmmu_pte_mkyoung(pte_t pte) 137static inline pte_t srmmu_pte_mkyoung(pte_t pte)
141{ return __pte(pte_val(pte) | SRMMU_REF);} 138{ return __pte(pte_val(pte) | SRMMU_REF);}
142 139
143/*
144 * Conversion functions: convert a page and protection to a page entry,
145 * and a page entry and page directory to the page they refer to.
146 */
147static pte_t srmmu_mk_pte(struct page *page, pgprot_t pgprot)
148{ return __pte((page_to_pfn(page) << (PAGE_SHIFT-4)) | pgprot_val(pgprot)); }
149
150static pte_t srmmu_mk_pte_phys(unsigned long page, pgprot_t pgprot)
151{ return __pte(((page) >> 4) | pgprot_val(pgprot)); }
152
153static pte_t srmmu_mk_pte_io(unsigned long page, pgprot_t pgprot, int space)
154{ return __pte(((page) >> 4) | (space << 28) | pgprot_val(pgprot)); }
155
156/* XXX should we hyper_flush_whole_icache here - Anton */ 140/* XXX should we hyper_flush_whole_icache here - Anton */
157static inline void srmmu_ctxd_set(ctxd_t *ctxp, pgd_t *pgdp) 141static inline void srmmu_ctxd_set(ctxd_t *ctxp, pgd_t *pgdp)
158{ srmmu_set_pte((pte_t *)ctxp, (SRMMU_ET_PTD | (__nocache_pa((unsigned long) pgdp) >> 4))); } 142{ set_pte((pte_t *)ctxp, (SRMMU_ET_PTD | (__nocache_pa((unsigned long) pgdp) >> 4))); }
159 143
160static inline void srmmu_pgd_set(pgd_t * pgdp, pmd_t * pmdp) 144static inline void srmmu_pgd_set(pgd_t * pgdp, pmd_t * pmdp)
161{ srmmu_set_pte((pte_t *)pgdp, (SRMMU_ET_PTD | (__nocache_pa((unsigned long) pmdp) >> 4))); } 145{ set_pte((pte_t *)pgdp, (SRMMU_ET_PTD | (__nocache_pa((unsigned long) pmdp) >> 4))); }
162 146
163static void srmmu_pmd_set(pmd_t *pmdp, pte_t *ptep) 147static void srmmu_pmd_set(pmd_t *pmdp, pte_t *ptep)
164{ 148{
@@ -167,7 +151,7 @@ static void srmmu_pmd_set(pmd_t *pmdp, pte_t *ptep)
167 151
168 ptp = __nocache_pa((unsigned long) ptep) >> 4; 152 ptp = __nocache_pa((unsigned long) ptep) >> 4;
169 for (i = 0; i < PTRS_PER_PTE/SRMMU_REAL_PTRS_PER_PTE; i++) { 153 for (i = 0; i < PTRS_PER_PTE/SRMMU_REAL_PTRS_PER_PTE; i++) {
170 srmmu_set_pte((pte_t *)&pmdp->pmdv[i], SRMMU_ET_PTD | ptp); 154 set_pte((pte_t *)&pmdp->pmdv[i], SRMMU_ET_PTD | ptp);
171 ptp += (SRMMU_REAL_PTRS_PER_PTE*sizeof(pte_t) >> 4); 155 ptp += (SRMMU_REAL_PTRS_PER_PTE*sizeof(pte_t) >> 4);
172 } 156 }
173} 157}
@@ -179,7 +163,7 @@ static void srmmu_pmd_populate(pmd_t *pmdp, struct page *ptep)
179 163
180 ptp = page_to_pfn(ptep) << (PAGE_SHIFT-4); /* watch for overflow */ 164 ptp = page_to_pfn(ptep) << (PAGE_SHIFT-4); /* watch for overflow */
181 for (i = 0; i < PTRS_PER_PTE/SRMMU_REAL_PTRS_PER_PTE; i++) { 165 for (i = 0; i < PTRS_PER_PTE/SRMMU_REAL_PTRS_PER_PTE; i++) {
182 srmmu_set_pte((pte_t *)&pmdp->pmdv[i], SRMMU_ET_PTD | ptp); 166 set_pte((pte_t *)&pmdp->pmdv[i], SRMMU_ET_PTD | ptp);
183 ptp += (SRMMU_REAL_PTRS_PER_PTE*sizeof(pte_t) >> 4); 167 ptp += (SRMMU_REAL_PTRS_PER_PTE*sizeof(pte_t) >> 4);
184 } 168 }
185} 169}
@@ -369,7 +353,7 @@ static void __init srmmu_nocache_init(void)
369 if (srmmu_cache_pagetables) 353 if (srmmu_cache_pagetables)
370 pteval |= SRMMU_CACHE; 354 pteval |= SRMMU_CACHE;
371 355
372 srmmu_set_pte(__nocache_fix(pte), __pte(pteval)); 356 set_pte(__nocache_fix(pte), __pte(pteval));
373 357
374 vaddr += PAGE_SIZE; 358 vaddr += PAGE_SIZE;
375 paddr += PAGE_SIZE; 359 paddr += PAGE_SIZE;
@@ -534,7 +518,7 @@ static inline void srmmu_mapioaddr(unsigned long physaddr,
534 tmp |= (bus_type << 28); 518 tmp |= (bus_type << 28);
535 tmp |= SRMMU_PRIV; 519 tmp |= SRMMU_PRIV;
536 __flush_page_to_ram(virt_addr); 520 __flush_page_to_ram(virt_addr);
537 srmmu_set_pte(ptep, __pte(tmp)); 521 set_pte(ptep, __pte(tmp));
538} 522}
539 523
540static void srmmu_mapiorange(unsigned int bus, unsigned long xpa, 524static void srmmu_mapiorange(unsigned int bus, unsigned long xpa,
@@ -2070,15 +2054,8 @@ void __init load_mmu(void)
2070 BTFIXUPSET_CALL(___xchg32, ___xchg32_sun4md, BTFIXUPCALL_SWAPG1G2); 2054 BTFIXUPSET_CALL(___xchg32, ___xchg32_sun4md, BTFIXUPCALL_SWAPG1G2);
2071#endif 2055#endif
2072 2056
2073 BTFIXUPSET_CALL(set_pte, srmmu_set_pte, BTFIXUPCALL_SWAPO0O1);
2074
2075 BTFIXUPSET_CALL(pgd_page_vaddr, srmmu_pgd_page, BTFIXUPCALL_NORM); 2057 BTFIXUPSET_CALL(pgd_page_vaddr, srmmu_pgd_page, BTFIXUPCALL_NORM);
2076 2058
2077 BTFIXUPSET_CALL(pte_present, srmmu_pte_present, BTFIXUPCALL_NORM);
2078
2079 BTFIXUPSET_CALL(mk_pte, srmmu_mk_pte, BTFIXUPCALL_NORM);
2080 BTFIXUPSET_CALL(mk_pte_phys, srmmu_mk_pte_phys, BTFIXUPCALL_NORM);
2081 BTFIXUPSET_CALL(mk_pte_io, srmmu_mk_pte_io, BTFIXUPCALL_NORM);
2082 BTFIXUPSET_CALL(pgd_set, srmmu_pgd_set, BTFIXUPCALL_NORM); 2059 BTFIXUPSET_CALL(pgd_set, srmmu_pgd_set, BTFIXUPCALL_NORM);
2083 BTFIXUPSET_CALL(pmd_set, srmmu_pmd_set, BTFIXUPCALL_NORM); 2060 BTFIXUPSET_CALL(pmd_set, srmmu_pmd_set, BTFIXUPCALL_NORM);
2084 BTFIXUPSET_CALL(pmd_populate, srmmu_pmd_populate, BTFIXUPCALL_NORM); 2061 BTFIXUPSET_CALL(pmd_populate, srmmu_pmd_populate, BTFIXUPCALL_NORM);