remap_file_pages protection support: ia64 bits
PATCH 30/39 remap_file_pages protection support: ia64 bits
From: Ingo Molnar <[email protected]>
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.
---
linux-2.6.git-paolo/include/asm-ia64/pgtable.h | 17 +++++++++++++---- 1 files changed, 13 insertions(+), 4 deletions(-)
include/asm-ia64/pgtable.h renamed from include/asm-ia64/pgtable.h~rfp-arch-ia64 +13 -4
@@ -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) \
_
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel