From: <bla...@ya...> - 2005-08-12 18:49:18
|
From: William Lee Irwin III <wl...@ho...> Implement remap_file_pages-with-per-page-protections for sparc64. See ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.4/2.6.4-mm1/broken-out/remap-file-pages-prot-2.6.4-rc1-mm1-A1.patch and ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.4/2.6.4-mm1/broken-out/remap-file-pages-prot-ia64-2.6.4-rc2-mm1-A0.patch Signed-off-by: Paolo 'Blaisorblade' Giarrusso <bla...@ya...> --- linux-2.6.git-paolo/include/asm-sparc64/pgtable.h | 13 ++++++++++--- 1 files changed, 10 insertions(+), 3 deletions(-) diff -puN include/asm-sparc64/pgtable.h~rfp-arch-sparc64 include/asm-sparc64/pgtable.h --- linux-2.6.git/include/asm-sparc64/pgtable.h~rfp-arch-sparc64 2005-08-12 18:41:31.000000000 +0200 +++ linux-2.6.git-paolo/include/asm-sparc64/pgtable.h 2005-08-12 18:41:31.000000000 +0200 @@ -367,9 +367,16 @@ static inline pte_t mk_pte_io(unsigned l /* File offset in PTE support. */ #define pte_file(pte) (pte_val(pte) & _PAGE_FILE) -#define pte_to_pgoff(pte) (pte_val(pte) >> PAGE_SHIFT) -#define pgoff_to_pte(off) (__pte(((off) << PAGE_SHIFT) | _PAGE_FILE)) -#define PTE_FILE_MAX_BITS (64UL - PAGE_SHIFT - 1UL) +#define __pte_to_pgprot(pte) \ + __pgprot(pte_val(pte) & (_PAGE_READ|_PAGE_WRITE)) +#define __file_pte_to_pgprot(pte) \ + __pgprot(((pte_val(pte) >> PAGE_SHIFT) & 0x3UL) << 8) +#define pte_to_pgprot(pte) \ + (pte_file(pte) ? __file_pte_to_pgprot(pte) : __pte_to_pgprot(pte)) +#define pte_to_pgoff(pte) (pte_val(pte) >> (PAGE_SHIFT+2)) +#define pgoff_prot_to_pte(off, prot) \ + ((__pte(((off) | ((pgprot_val(prot) >> 8) & 0x3UL)))) << (PAGE_SHIFT+2) | _PAGE_FILE) +#define PTE_FILE_MAX_BITS (64UL - PAGE_SHIFT - 3UL) extern unsigned long prom_virt_to_phys(unsigned long, int *); _ |