Re: 2.6.4-mm1

William Lee Irwin III
2004-03-11T15:54:25Z

On Thu, Mar 11, 2004 at 07:23:46AM -0800, William Lee Irwin III wrote:
> +#define pgoff_prot_to_pte(off, prot) \
> + (__pte(((off) << (PAGE_SHIFT+2)) | _PAGE_FILE | ((prot >> 8) & 0x3UL)))
> +#define PTE_FILE_MAX_BITS (64UL - PAGE_SHIFT - 3UL)

Good thing for me it's rarely exercised. Incremental (one-liner):

--- mm1-2.6.4-3/include/asm-sparc64/pgtable.h 2004-03-11 06:27:40.704004000 -0800
+++ mm1-2.6.4-4/include/asm-sparc64/pgtable.h 2004-03-11 07:35:09.766453000 -0800
@@ -330,7 +330,7 @@
(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) << (PAGE_SHIFT+2)) | _PAGE_FILE | ((prot >> 8) & 0x3UL)))
+ ((__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 *);