From 7d1a0d87497c63a0e3c672154d4b36fde6651fea Mon Sep 17 00:00:00 2001 From: Pete Zaitcev Date: Sun, 13 Apr 2003 08:32:35 -0700 Subject: [PATCH] [sparc]: pte_file with constant number of bits. --- arch/sparc/mm/srmmu.c | 2 -- arch/sparc/mm/sun4c.c | 4 +--- include/asm-sparc/pgtable.h | 10 ++++++++-- include/asm-sparc/pgtsrmmu.h | 3 +-- include/asm-sparc/pgtsun4c.h | 6 ------ 5 files changed, 10 insertions(+), 15 deletions(-) diff --git a/arch/sparc/mm/srmmu.c b/arch/sparc/mm/srmmu.c index a6ddaa35264b5..ee0ae591e311b 100644 --- a/arch/sparc/mm/srmmu.c +++ b/arch/sparc/mm/srmmu.c @@ -2199,8 +2199,6 @@ void __init ld_mmu_srmmu(void) page_kernel = pgprot_val(SRMMU_PAGE_KERNEL); pg_iobits = SRMMU_VALID | SRMMU_WRITE | SRMMU_REF; - BTFIXUPSET_SIMM13(pte_file_max_bits, SRMMU_PTE_FILE_MAX_BITS); - /* Functions */ #ifndef CONFIG_SMP BTFIXUPSET_CALL(___xchg32, ___xchg32_sun4md, BTFIXUPCALL_SWAPG1G2); diff --git a/arch/sparc/mm/sun4c.c b/arch/sparc/mm/sun4c.c index caef830d43889..9cda5ee63d989 100644 --- a/arch/sparc/mm/sun4c.c +++ b/arch/sparc/mm/sun4c.c @@ -1808,7 +1808,7 @@ static pte_t sun4c_pgoff_to_pte(unsigned long pgoff) static unsigned long sun4c_pte_to_pgoff(pte_t pte) { - return pte_val(pte) & ((1UL << SUN4C_PTE_FILE_MAX_BITS) - 1); + return pte_val(pte) & ((1UL << PTE_FILE_MAX_BITS) - 1); } @@ -2127,8 +2127,6 @@ void __init ld_mmu_sun4c(void) pg_iobits = _SUN4C_PAGE_PRESENT | _SUN4C_READABLE | _SUN4C_WRITEABLE | _SUN4C_PAGE_IO | _SUN4C_PAGE_NOCACHE; - BTFIXUPSET_SIMM13(pte_file_max_bits, SUN4C_PTE_FILE_MAX_BITS); - /* Functions */ BTFIXUPSET_CALL(___xchg32, ___xchg32_sun4c, BTFIXUPCALL_NORM); BTFIXUPSET_CALL(do_check_pgt_cache, sun4c_check_pgt_cache, BTFIXUPCALL_NORM); diff --git a/include/asm-sparc/pgtable.h b/include/asm-sparc/pgtable.h index 65fd1f63d1527..c25c0d4f74610 100644 --- a/include/asm-sparc/pgtable.h +++ b/include/asm-sparc/pgtable.h @@ -263,6 +263,8 @@ extern __inline__ int pte_file(pte_t pte) return pte_val(pte) & BTFIXUP_HALF(pte_filei); } +/* + */ BTFIXUPDEF_HALF(pte_wrprotecti) BTFIXUPDEF_HALF(pte_mkcleani) BTFIXUPDEF_HALF(pte_mkoldi) @@ -387,11 +389,15 @@ extern int invalid_segment; /* file-offset-in-pte helpers */ BTFIXUPDEF_CALL(unsigned long, pte_to_pgoff, pte_t pte); BTFIXUPDEF_CALL(pte_t, pgoff_to_pte, unsigned long pgoff); -BTFIXUPDEF_SIMM13(pte_file_max_bits); #define pte_to_pgoff(pte) BTFIXUP_CALL(pte_to_pgoff)(pte) #define pgoff_to_pte(off) BTFIXUP_CALL(pgoff_to_pte)(off) -#define PTE_FILE_MAX_BITS BTFIXUP_SIMM13(pte_file_max_bits) + +/* + * This is made a constant because mm/fremap.c required a constant. + * Note that layout of these bits is different between sun4c.c and srmmu.c. + */ +#define PTE_FILE_MAX_BITS 24 /* */ diff --git a/include/asm-sparc/pgtsrmmu.h b/include/asm-sparc/pgtsrmmu.h index 424ee0dc35224..0d90d4c018844 100644 --- a/include/asm-sparc/pgtsrmmu.h +++ b/include/asm-sparc/pgtsrmmu.h @@ -64,8 +64,7 @@ #define SRMMU_FILE 0x40 /* Implemented in software */ -#define SRMMU_PTE_FILE_MAX_BITS 24 -#define SRMMU_PTE_FILE_SHIFT 8 +#define SRMMU_PTE_FILE_SHIFT 8 /* == 32-PTE_FILE_MAX_BITS */ #define SRMMU_CHG_MASK (0xffffff00 | SRMMU_REF | SRMMU_DIRTY) diff --git a/include/asm-sparc/pgtsun4c.h b/include/asm-sparc/pgtsun4c.h index 3c70fc60a9e4d..efc081004262b 100644 --- a/include/asm-sparc/pgtsun4c.h +++ b/include/asm-sparc/pgtsun4c.h @@ -74,12 +74,6 @@ #define SUN4C_PAGE_KERNEL __pgprot(_SUN4C_READABLE|_SUN4C_WRITEABLE|\ _SUN4C_PAGE_DIRTY|_SUN4C_PAGE_PRIV) -/* - * We have a couple of free bits left, but it's probably not a big - * deal, considering sizes of RAM and swap on sun4c. - */ -#define SUN4C_PTE_FILE_MAX_BITS 20 - #ifndef __ASSEMBLY__ extern __inline__ unsigned long sun4c_get_synchronous_error(void) -- 2.53.0