Commit 12fb5de4 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Jens Axboe

[PATCH] Sun-3 pte_file

Sun-3: pte_file fixes for sun-3 MMUs (from Sam Creasey)
parent a2f51824
...@@ -38,6 +38,8 @@ ...@@ -38,6 +38,8 @@
#define _PAGE_PRESENT (SUN3_PAGE_VALID) #define _PAGE_PRESENT (SUN3_PAGE_VALID)
#define _PAGE_ACCESSED (SUN3_PAGE_ACCESSED) #define _PAGE_ACCESSED (SUN3_PAGE_ACCESSED)
#define PTE_FILE_MAX_BITS 28
/* Compound page protection values. */ /* Compound page protection values. */
//todo: work out which ones *should* have SUN3_PAGE_NOCACHE and fix... //todo: work out which ones *should* have SUN3_PAGE_NOCACHE and fix...
// is it just PAGE_KERNEL and PAGE_SHARED? // is it just PAGE_KERNEL and PAGE_SHARED?
...@@ -160,6 +162,7 @@ extern inline int pte_write(pte_t pte) { return pte_val(pte) & SUN3_PAGE_WRITEA ...@@ -160,6 +162,7 @@ extern inline int pte_write(pte_t pte) { return pte_val(pte) & SUN3_PAGE_WRITEA
extern inline int pte_exec(pte_t pte) { return 1; } extern inline int pte_exec(pte_t pte) { return 1; }
extern inline int pte_dirty(pte_t pte) { return pte_val(pte) & SUN3_PAGE_MODIFIED; } extern inline int pte_dirty(pte_t pte) { return pte_val(pte) & SUN3_PAGE_MODIFIED; }
extern inline int pte_young(pte_t pte) { return pte_val(pte) & SUN3_PAGE_ACCESSED; } extern inline int pte_young(pte_t pte) { return pte_val(pte) & SUN3_PAGE_ACCESSED; }
extern inline int pte_file(pte_t pte) { return pte_val(pte) & SUN3_PAGE_ACCESSED; }
extern inline pte_t pte_wrprotect(pte_t pte) { pte_val(pte) &= ~SUN3_PAGE_WRITEABLE; return pte; } extern inline pte_t pte_wrprotect(pte_t pte) { pte_val(pte) &= ~SUN3_PAGE_WRITEABLE; return pte; }
extern inline pte_t pte_rdprotect(pte_t pte) { return pte; } extern inline pte_t pte_rdprotect(pte_t pte) { return pte; }
...@@ -195,6 +198,18 @@ extern inline pmd_t *pmd_offset (pgd_t *pgd, unsigned long address) ...@@ -195,6 +198,18 @@ extern inline pmd_t *pmd_offset (pgd_t *pgd, unsigned long address)
return (pmd_t *) pgd; return (pmd_t *) pgd;
} }
static inline unsigned long pte_to_pgoff(pte_t pte)
{
return pte.pte & SUN3_PAGE_PGNUM_MASK;
}
static inline pte_t pgoff_to_pte(inline unsigned off)
{
pte_t pte = { off + SUN3_PAGE_ACCESSED };
return pte;
}
/* Find an entry in the third-level pagetable. */ /* Find an entry in the third-level pagetable. */
#define pte_index(address) ((address >> PAGE_SHIFT) & (PTRS_PER_PTE-1)) #define pte_index(address) ((address >> PAGE_SHIFT) & (PTRS_PER_PTE-1))
#define pte_offset_kernel(pmd, address) ((pte_t *) __pmd_page(*pmd) + pte_index(address)) #define pte_offset_kernel(pmd, address) ((pte_t *) __pmd_page(*pmd) + pte_index(address))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment