summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert@linux-m68k.org>2003-07-25 19:26:04 -0700
committerJens Axboe <axboe@suse.de>2003-07-25 19:26:04 -0700
commit5dd971667ba010e05a315fb0d9b231f79825452a (patch)
treec02483787a44ca67ca73cf7041c10302fdff7887 /include
parent8121975bcf163425f92f34e16b61ccace1266672 (diff)
[PATCH] m68k page
m68k page updates (from Roman Zippel): - Set _PAGE_RONLY bit and clear _PAGE_PRESENT to mark PAGE_NONE pte entries (this also makes PAGE_NONE fixup unnecessary) - Move _PAGE_FILE to a lower, so pte_to_pgoff/pgoff_to_pte becomes simpler
Diffstat (limited to 'include')
-rw-r--r--include/asm-m68k/motorola_pgtable.h21
1 files changed, 11 insertions, 10 deletions
diff --git a/include/asm-m68k/motorola_pgtable.h b/include/asm-m68k/motorola_pgtable.h
index a92d63841e2a..3c84aef1eaec 100644
--- a/include/asm-m68k/motorola_pgtable.h
+++ b/include/asm-m68k/motorola_pgtable.h
@@ -12,9 +12,7 @@
#define _PAGE_ACCESSED 0x008
#define _PAGE_DIRTY 0x010
#define _PAGE_SUPER 0x080 /* 68040 supervisor only */
-#define _PAGE_FAKE_SUPER 0x200 /* fake supervisor only on 680[23]0 */
#define _PAGE_GLOBAL040 0x400 /* 68040 global bit, used for kva descs */
-#define _PAGE_FILE 0x800 /* pagecache or swap? */
#define _PAGE_NOCACHE030 0x040 /* 68030 no-cache mode */
#define _PAGE_NOCACHE 0x060 /* 68040 cache mode, non-serialized */
#define _PAGE_NOCACHE_S 0x040 /* 68040 no-cache mode, serialized */
@@ -29,6 +27,9 @@
#define _PAGE_TABLE (_PAGE_SHORT)
#define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY | _PAGE_NOCACHE)
+#define _PAGE_PROTNONE 0x004
+#define _PAGE_FILE 0x008 /* pagecache or swap? */
+
#ifndef __ASSEMBLY__
/* This is the cache mode to be used for pages containing page descriptors for
@@ -54,7 +55,7 @@ extern int m68k_supervisor_cachemode;
extern unsigned long mm_cachebits;
#endif
-#define PAGE_NONE __pgprot(_PAGE_PRESENT | _PAGE_RONLY | _PAGE_ACCESSED | mm_cachebits)
+#define PAGE_NONE __pgprot(_PAGE_PROTNONE | _PAGE_ACCESSED | mm_cachebits)
#define PAGE_SHARED __pgprot(_PAGE_PRESENT | _PAGE_ACCESSED | mm_cachebits)
#define PAGE_COPY __pgprot(_PAGE_PRESENT | _PAGE_RONLY | _PAGE_ACCESSED | mm_cachebits)
#define PAGE_READONLY __pgprot(_PAGE_PRESENT | _PAGE_RONLY | _PAGE_ACCESSED | mm_cachebits)
@@ -62,7 +63,7 @@ extern unsigned long mm_cachebits;
/* Alternate definitions that are compile time constants, for
initializing protection_map. The cachebits are fixed later. */
-#define PAGE_NONE_C __pgprot(_PAGE_PRESENT | _PAGE_RONLY | _PAGE_ACCESSED)
+#define PAGE_NONE_C __pgprot(_PAGE_PROTNONE | _PAGE_ACCESSED)
#define PAGE_SHARED_C __pgprot(_PAGE_PRESENT | _PAGE_ACCESSED)
#define PAGE_COPY_C __pgprot(_PAGE_PRESENT | _PAGE_RONLY | _PAGE_ACCESSED)
#define PAGE_READONLY_C __pgprot(_PAGE_PRESENT | _PAGE_RONLY | _PAGE_ACCESSED)
@@ -118,7 +119,7 @@ extern inline void pgd_set(pgd_t * pgdp, pmd_t * pmdp)
#define pte_none(pte) (!pte_val(pte))
-#define pte_present(pte) (pte_val(pte) & (_PAGE_PRESENT | _PAGE_FAKE_SUPER))
+#define pte_present(pte) (pte_val(pte) & (_PAGE_PRESENT | _PAGE_PROTNONE))
#define pte_clear(ptep) ({ pte_val(*(ptep)) = 0; })
#define pte_page(pte) (mem_map + ((unsigned long)(__va(pte_val(pte)) - PAGE_OFFSET) >> PAGE_SHIFT))
@@ -256,23 +257,23 @@ static inline void cache_page(void *vaddr)
}
}
-#define PTE_FILE_MAX_BITS 29
+#define PTE_FILE_MAX_BITS 28
static inline unsigned long pte_to_pgoff(pte_t pte)
{
- return ((pte.pte >> 12) << 7) + ((pte.pte >> 2) & 0x1ff);
+ return pte.pte >> 4;
}
static inline pte_t pgoff_to_pte(unsigned off)
{
- pte_t pte = { ((off >> 7) << 12) + ((off & 0x1ff) << 2) + _PAGE_FILE };
+ pte_t pte = { (off << 4) + _PAGE_FILE };
return pte;
}
/* Encode and de-code a swap entry (must be !pte_none(e) && !pte_present(e)) */
-#define __swp_type(x) (((x).val >> 2) & 0x1ff)
+#define __swp_type(x) (((x).val >> 4) & 0xff)
#define __swp_offset(x) ((x).val >> 12)
-#define __swp_entry(type, offset) ((swp_entry_t) { ((type) << 2) | ((offset) << 12) })
+#define __swp_entry(type, offset) ((swp_entry_t) { ((type) << 4) | ((offset) << 12) })
#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
#define __swp_entry_to_pte(x) ((pte_t) { (x).val })