Messages in this thread Patch in this message | | | Subject | [patch 30/39] remap_file_pages protection support: ia64 bits | From | blaisorblade@yahoo ... | Date | Fri, 12 Aug 2005 20:36:13 +0200 |
| |
From: Ingo Molnar <mingo@elte.hu>
I've attached a 'blind' port of the prot bits of fremap to ia64. I've compiled it with a cross-compiler but otherwise it's untested. (and it's very likely i got the pte bits wrong - but it's roughly OK.)
This should at least make ia64 compile.
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> ---
linux-2.6.git-paolo/include/asm-ia64/pgtable.h | 17 +++++++++++++---- 1 files changed, 13 insertions(+), 4 deletions(-)
diff -puN include/asm-ia64/pgtable.h~rfp-arch-ia64 include/asm-ia64/pgtable.h --- linux-2.6.git/include/asm-ia64/pgtable.h~rfp-arch-ia64 2005-08-12 19:27:03.000000000 +0200 +++ linux-2.6.git-paolo/include/asm-ia64/pgtable.h 2005-08-12 19:27:03.000000000 +0200 @@ -433,7 +433,8 @@ extern void paging_init (void); * Format of file pte: * bit 0 : present bit (must be zero) * bit 1 : _PAGE_FILE (must be one) - * bits 2-62: file_offset/PAGE_SIZE + * bit 2 : _PAGE_AR_RW + * bits 3-62: file_offset/PAGE_SIZE * bit 63 : _PAGE_PROTNONE bit */ #define __swp_type(entry) (((entry).val >> 2) & 0x7f) @@ -442,9 +443,17 @@ extern void paging_init (void); #define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) #define __swp_entry_to_pte(x) ((pte_t) { (x).val }) -#define PTE_FILE_MAX_BITS 61 -#define pte_to_pgoff(pte) ((pte_val(pte) << 1) >> 3) -#define pgoff_to_pte(off) ((pte_t) { ((off) << 2) | _PAGE_FILE }) +#define PTE_FILE_MAX_BITS 59 +#define pte_to_pgoff(pte) ((pte_val(pte) << 1) >> 4) + +#define pte_to_pgprot(pte) \ + __pgprot((pte_val(pte) & (_PAGE_AR_RW | _PAGE_PROTNONE)) \ + | ((pte_val(pte) & _PAGE_PROTNONE) ? 0 : \ + (__ACCESS_BITS | _PAGE_PL_3))) + +#define pgoff_prot_to_pte(off, prot) \ + ((pte_t) { _PAGE_FILE + \ + (pgprot_val(prot) & (_PAGE_AR_RW | _PAGE_PROTNONE)) + (off) }) /* XXX is this right? */ #define io_remap_page_range(vma, vaddr, paddr, size, prot) \ _ - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |