aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc
diff options
context:
space:
mode:
authorSam Ravnborg <sam@ravnborg.org>2012-05-11 07:35:17 -0400
committerDavid S. Miller <davem@davemloft.net>2012-05-11 22:29:10 -0400
commitafaedde7c9bcbae4ea9ece34990da72da9c360af (patch)
tree8619e72c2b9eb081624285e025ac021d9cae140e /arch/sparc
parente7b7e0c356558c4b8aa799a76a88031448ac19c7 (diff)
sparc32: use inline versions of pgprot_noncached, pte_to_pgoff and pgoff_to_pte
We no longer have different versions of these so use a few simple static inline functions. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc')
-rw-r--r--arch/sparc/include/asm/pgtable_32.h20
-rw-r--r--arch/sparc/kernel/sparc_ksyms_32.c1
-rw-r--r--arch/sparc/mm/srmmu.c21
3 files changed, 14 insertions, 28 deletions
diff --git a/arch/sparc/include/asm/pgtable_32.h b/arch/sparc/include/asm/pgtable_32.h
index 225030bbebb7..f451d439bddb 100644
--- a/arch/sparc/include/asm/pgtable_32.h
+++ b/arch/sparc/include/asm/pgtable_32.h
@@ -267,13 +267,17 @@ BTFIXUPDEF_CALL_CONST(pte_t, mk_pte, struct page *, pgprot_t)
267 267
268BTFIXUPDEF_CALL_CONST(pte_t, mk_pte_phys, unsigned long, pgprot_t) 268BTFIXUPDEF_CALL_CONST(pte_t, mk_pte_phys, unsigned long, pgprot_t)
269BTFIXUPDEF_CALL_CONST(pte_t, mk_pte_io, unsigned long, pgprot_t, int) 269BTFIXUPDEF_CALL_CONST(pte_t, mk_pte_io, unsigned long, pgprot_t, int)
270BTFIXUPDEF_CALL_CONST(pgprot_t, pgprot_noncached, pgprot_t)
271 270
272#define mk_pte(page,pgprot) BTFIXUP_CALL(mk_pte)(page,pgprot) 271#define mk_pte(page,pgprot) BTFIXUP_CALL(mk_pte)(page,pgprot)
273#define mk_pte_phys(page,pgprot) BTFIXUP_CALL(mk_pte_phys)(page,pgprot) 272#define mk_pte_phys(page,pgprot) BTFIXUP_CALL(mk_pte_phys)(page,pgprot)
274#define mk_pte_io(page,pgprot,space) BTFIXUP_CALL(mk_pte_io)(page,pgprot,space) 273#define mk_pte_io(page,pgprot,space) BTFIXUP_CALL(mk_pte_io)(page,pgprot,space)
275 274
276#define pgprot_noncached(pgprot) BTFIXUP_CALL(pgprot_noncached)(pgprot) 275#define pgprot_noncached pgprot_noncached
276static inline pgprot_t pgprot_noncached(pgprot_t prot)
277{
278 prot &= ~__pgprot(SRMMU_CACHE);
279 return prot;
280}
277 281
278BTFIXUPDEF_INT(pte_modify_mask) 282BTFIXUPDEF_INT(pte_modify_mask)
279 283
@@ -352,11 +356,15 @@ BTFIXUPDEF_CALL(swp_entry_t, __swp_entry, unsigned long, unsigned long)
352#define __swp_entry_to_pte(x) ((pte_t) { (x).val }) 356#define __swp_entry_to_pte(x) ((pte_t) { (x).val })
353 357
354/* file-offset-in-pte helpers */ 358/* file-offset-in-pte helpers */
355BTFIXUPDEF_CALL(unsigned long, pte_to_pgoff, pte_t pte); 359static inline unsigned long pte_to_pgoff(pte_t pte)
356BTFIXUPDEF_CALL(pte_t, pgoff_to_pte, unsigned long pgoff); 360{
361 return pte_val(pte) >> SRMMU_PTE_FILE_SHIFT;
362}
357 363
358#define pte_to_pgoff(pte) BTFIXUP_CALL(pte_to_pgoff)(pte) 364static inline pte_t pgoff_to_pte(unsigned long pgoff)
359#define pgoff_to_pte(off) BTFIXUP_CALL(pgoff_to_pte)(off) 365{
366 return __pte((pgoff << SRMMU_PTE_FILE_SHIFT) | SRMMU_FILE);
367}
360 368
361/* 369/*
362 * This is made a constant because mm/fremap.c required a constant. 370 * This is made a constant because mm/fremap.c required a constant.
diff --git a/arch/sparc/kernel/sparc_ksyms_32.c b/arch/sparc/kernel/sparc_ksyms_32.c
index baeab8720237..fd38a920992d 100644
--- a/arch/sparc/kernel/sparc_ksyms_32.c
+++ b/arch/sparc/kernel/sparc_ksyms_32.c
@@ -40,7 +40,6 @@ EXPORT_SYMBOL(BTFIXUP_CALL(mmu_get_scsi_sgl));
40EXPORT_SYMBOL(BTFIXUP_CALL(mmu_get_scsi_one)); 40EXPORT_SYMBOL(BTFIXUP_CALL(mmu_get_scsi_one));
41EXPORT_SYMBOL(BTFIXUP_CALL(mmu_release_scsi_sgl)); 41EXPORT_SYMBOL(BTFIXUP_CALL(mmu_release_scsi_sgl));
42EXPORT_SYMBOL(BTFIXUP_CALL(mmu_release_scsi_one)); 42EXPORT_SYMBOL(BTFIXUP_CALL(mmu_release_scsi_one));
43EXPORT_SYMBOL(BTFIXUP_CALL(pgprot_noncached));
44 43
45/* Exporting a symbol from /init/main.c */ 44/* Exporting a symbol from /init/main.c */
46EXPORT_SYMBOL(saved_command_line); 45EXPORT_SYMBOL(saved_command_line);
diff --git a/arch/sparc/mm/srmmu.c b/arch/sparc/mm/srmmu.c
index 2663b92b9ece..d85da15d4183 100644
--- a/arch/sparc/mm/srmmu.c
+++ b/arch/sparc/mm/srmmu.c
@@ -2144,23 +2144,6 @@ static void smp_flush_page_for_dma(unsigned long page)
2144 2144
2145#endif 2145#endif
2146 2146
2147static pte_t srmmu_pgoff_to_pte(unsigned long pgoff)
2148{
2149 return __pte((pgoff << SRMMU_PTE_FILE_SHIFT) | SRMMU_FILE);
2150}
2151
2152static unsigned long srmmu_pte_to_pgoff(pte_t pte)
2153{
2154 return pte_val(pte) >> SRMMU_PTE_FILE_SHIFT;
2155}
2156
2157static pgprot_t srmmu_pgprot_noncached(pgprot_t prot)
2158{
2159 prot &= ~__pgprot(SRMMU_CACHE);
2160
2161 return prot;
2162}
2163
2164/* Load up routines and constants for sun4m and sun4d mmu */ 2147/* Load up routines and constants for sun4m and sun4d mmu */
2165void __init ld_mmu_srmmu(void) 2148void __init ld_mmu_srmmu(void)
2166{ 2149{
@@ -2183,7 +2166,6 @@ void __init ld_mmu_srmmu(void)
2183 page_kernel = pgprot_val(SRMMU_PAGE_KERNEL); 2166 page_kernel = pgprot_val(SRMMU_PAGE_KERNEL);
2184 2167
2185 /* Functions */ 2168 /* Functions */
2186 BTFIXUPSET_CALL(pgprot_noncached, srmmu_pgprot_noncached, BTFIXUPCALL_NORM);
2187#ifndef CONFIG_SMP 2169#ifndef CONFIG_SMP
2188 BTFIXUPSET_CALL(___xchg32, ___xchg32_sun4md, BTFIXUPCALL_SWAPG1G2); 2170 BTFIXUPSET_CALL(___xchg32, ___xchg32_sun4md, BTFIXUPCALL_SWAPG1G2);
2189#endif 2171#endif
@@ -2250,9 +2232,6 @@ void __init ld_mmu_srmmu(void)
2250 2232
2251 BTFIXUPSET_CALL(mmu_info, srmmu_mmu_info, BTFIXUPCALL_NORM); 2233 BTFIXUPSET_CALL(mmu_info, srmmu_mmu_info, BTFIXUPCALL_NORM);
2252 2234
2253 BTFIXUPSET_CALL(pte_to_pgoff, srmmu_pte_to_pgoff, BTFIXUPCALL_NORM);
2254 BTFIXUPSET_CALL(pgoff_to_pte, srmmu_pgoff_to_pte, BTFIXUPCALL_NORM);
2255
2256 get_srmmu_type(); 2235 get_srmmu_type();
2257 2236
2258#ifdef CONFIG_SMP 2237#ifdef CONFIG_SMP