summaryrefslogtreecommitdiffstats
path: root/include/asm-mips/page.h
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2006-08-31 19:39:09 +0100
committerRalf Baechle <ralf@linux-mips.org>2006-09-27 13:37:39 +0100
commitd34555fb20e7abf33f86d7aa3ec0826343f38256 (patch)
tree975a282d62f8e23648cfd23f5fa8ac7f8893b5d1 /include/asm-mips/page.h
parent65316fd13ad9d82560edbad0a940d684380f7461 (diff)
downloadop-kernel-dev-d34555fb20e7abf33f86d7aa3ec0826343f38256.zip
op-kernel-dev-d34555fb20e7abf33f86d7aa3ec0826343f38256.tar.gz
[MIPS] Do not lose upper 32-bit on MIPS32 with 64-bit addresses in __pte().
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'include/asm-mips/page.h')
-rw-r--r--include/asm-mips/page.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/asm-mips/page.h b/include/asm-mips/page.h
index c3b872b..85b258e 100644
--- a/include/asm-mips/page.h
+++ b/include/asm-mips/page.h
@@ -77,15 +77,17 @@ static inline void copy_user_page(void *vto, void *vfrom, unsigned long vaddr,
#ifdef CONFIG_CPU_MIPS32
typedef struct { unsigned long pte_low, pte_high; } pte_t;
#define pte_val(x) ((x).pte_low | ((unsigned long long)(x).pte_high << 32))
+ #define __pte(x) ({ pte_t __pte = {(x), ((unsigned long long)(x)) >> 32}; __pte; })
#else
typedef struct { unsigned long long pte; } pte_t;
#define pte_val(x) ((x).pte)
+ #define __pte(x) ((pte_t) { (x) } )
#endif
#else
typedef struct { unsigned long pte; } pte_t;
#define pte_val(x) ((x).pte)
-#endif
#define __pte(x) ((pte_t) { (x) } )
+#endif
/*
* For 3-level pagetables we defines these ourselves, for 2-level the
OpenPOWER on IntegriCloud