]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] A BTFIXUP'd fix for pte_read()
authorTom 'spot' Callaway <tcallawa@redhat.com>
Wed, 2 Feb 2005 09:30:02 +0000 (01:30 -0800)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Wed, 2 Feb 2005 09:30:02 +0000 (01:30 -0800)
This adds BTFIXUPs needed for sparc32.

Signed-off-by: Tom 'spot' Callaway <tcallawa@redhat.com>
Acked-by: William Irwin <wli@holomorphy.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/sparc/mm/srmmu.c
arch/sparc/mm/sun4c.c
include/asm-sparc/pgtable.h
include/asm-sparc/pgtsrmmu.h

index 97e675c0c7f0c4ccd8540519a769e265b6244eb9..71e3f2678e73bd7e73e351ae348846cd7beec0f2 100644 (file)
@@ -2197,6 +2197,7 @@ void __init ld_mmu_srmmu(void)
        BTFIXUPSET_CALL(free_pgd_fast, srmmu_free_pgd_fast, BTFIXUPCALL_NORM);
        BTFIXUPSET_CALL(get_pgd_fast, srmmu_get_pgd_fast, BTFIXUPCALL_NORM);
 
+       BTFIXUPSET_HALF(pte_readi, SRMMU_NOREAD);
        BTFIXUPSET_HALF(pte_writei, SRMMU_WRITE);
        BTFIXUPSET_HALF(pte_dirtyi, SRMMU_DIRTY);
        BTFIXUPSET_HALF(pte_youngi, SRMMU_REF);
index fd85c7b01714cfe75ba21c9dfe4f23749c6f20ad..5f50dabb00d2141eac9b67181a91b8a09008654e 100644 (file)
@@ -2225,6 +2225,7 @@ void __init ld_mmu_sun4c(void)
        BTFIXUPSET_CALL(free_pgd_fast, sun4c_free_pgd_fast, BTFIXUPCALL_NORM);
        BTFIXUPSET_CALL(get_pgd_fast, sun4c_get_pgd_fast, BTFIXUPCALL_NORM);
 
+       BTFIXUPSET_HALF(pte_readi, _SUN4C_PAGE_READ);
        BTFIXUPSET_HALF(pte_writei, _SUN4C_PAGE_WRITE);
        BTFIXUPSET_HALF(pte_dirtyi, _SUN4C_PAGE_MODIFIED);
        BTFIXUPSET_HALF(pte_youngi, _SUN4C_PAGE_ACCESSED);
index 2e9a22d77adf05f230ea0a68e9ef7c1155248bc9..e62df8cbd99d1c7801566562fe2a468943ee3937 100644 (file)
@@ -186,10 +186,31 @@ BTFIXUPDEF_CALL(void, pgd_clear, pgd_t *)
  * The following only work if pte_present() is true.
  * Undefined behaviour if not..
  */
+BTFIXUPDEF_HALF(pte_readi)
 BTFIXUPDEF_HALF(pte_writei)
 BTFIXUPDEF_HALF(pte_dirtyi)
 BTFIXUPDEF_HALF(pte_youngi)
 
+extern int pte_read(pte_t pte) __attribute_const__;
+extern __inline__ int pte_read(pte_t pte)
+{
+       switch (sparc_cpu_model){
+       case sun4:
+       case sun4c:
+               return pte_val(pte) & BTFIXUP_HALF(pte_readi);
+       case sun4d:
+       case sun4e:
+       case sun4m:
+               return !(pte_val(pte) & BTFIXUP_HALF(pte_readi));
+       /* pacify gcc warnings */
+       case sun4u:
+       case sun_unknown:
+       case ap1000:
+       default:
+               return 0;
+       }
+}
+
 extern int pte_write(pte_t pte) __attribute_const__;
 extern __inline__ int pte_write(pte_t pte)
 {
index 7e57043a1ab2285fd80587c2fc78ad01b1b17dd0..ee3b9d93187ce5959b95d709e41048e0218cf823 100644 (file)
@@ -73,6 +73,7 @@
 #define SRMMU_CACHE        0x80
 #define SRMMU_DIRTY        0x40
 #define SRMMU_REF          0x20
+#define SRMMU_NOREAD       0x10
 #define SRMMU_EXEC         0x08
 #define SRMMU_WRITE        0x04
 #define SRMMU_VALID        0x02 /* SRMMU_ET_PTE */