linux-cvs-patches
[Top] [All Lists]

CVS Update@linux-mips.org: linux

To: linux-cvs-patches@linux-mips.org
Subject: CVS Update@linux-mips.org: linux
From: ralf@linux-mips.org
Date: Wed, 17 Aug 2005 11:11:16 +0100
Reply-to: linux-mips@linux-mips.org
Sender: linux-cvs-patches-bounce@linux-mips.org
CVSROOT:        /home/cvs
Module name:    linux
Changes by:     ralf@ftp.linux-mips.org 05/08/17 11:11:10

Modified files:
        include/asm-mips: pgtable-32.h 

Log message:
        On CONFIG_64BIT_PHYS_ADDR, pfn always fits in 'unsigned long', but
        pfn<<PAGE_SHIFT sometimes extends beyond.  The pte is big enough to hold
        'long long', but the shift in pfn_pte() needs to do its calculation with
        enough bits to hold the result.

diff -urN linux/include/asm-mips/pgtable-32.h 
linux/include/asm-mips/pgtable-32.h
--- linux/include/asm-mips/pgtable-32.h 2005/07/06 12:08:14     1.18
+++ linux/include/asm-mips/pgtable-32.h 2005/08/17 10:11:10     1.19
@@ -137,7 +137,7 @@
 #define pfn_pte(pfn, prot)     __pte(((pfn) << (PAGE_SHIFT + 2)) | 
pgprot_val(prot))
 #else
 #define pte_pfn(x)             ((unsigned long)((x).pte >> PAGE_SHIFT))
-#define pfn_pte(pfn, prot)     __pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
+#define pfn_pte(pfn, prot)     __pte(((unsigned long long)(pfn) << PAGE_SHIFT) 
| pgprot_val(prot))
 #endif
 #endif /* defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32_R1) */
 

<Prev in Thread] Current Thread [Next in Thread>