summaryrefslogtreecommitdiff
path: root/arch/parisc/include
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2016-04-09 09:27:08 +0300
committerHelge Deller <deller@gmx.de>2016-05-22 22:39:04 +0300
commitd2ad824f4bb8d146ea6e5f440dddb30b9ccfd98c (patch)
treebfc218919d3d8a93f46ad29cf2a19a847e8665a2 /arch/parisc/include
parent06bff6b9d7d50566a9320f64b0624957798cb08b (diff)
downloadlinux-d2ad824f4bb8d146ea6e5f440dddb30b9ccfd98c.tar.xz
parisc: Add 64bit get_user() and put_user() for 32bit kernel
Allow accessing 64-bit values in userspace from a 32-bit kernel. The access is not atomic. Signed-off-by: Helge Deller <deller@gmx.de>
Diffstat (limited to 'arch/parisc/include')
-rw-r--r--arch/parisc/include/asm/uaccess.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/arch/parisc/include/asm/uaccess.h b/arch/parisc/include/asm/uaccess.h
index 56b7208da9a4..0f59fd9ca205 100644
--- a/arch/parisc/include/asm/uaccess.h
+++ b/arch/parisc/include/asm/uaccess.h
@@ -40,7 +40,7 @@ static inline long access_ok(int type, const void __user * addr,
#define get_user __get_user
#if !defined(CONFIG_64BIT)
-#define LDD_USER(ptr) BUILD_BUG()
+#define LDD_USER(ptr) __get_user_asm64(ptr)
#define STD_USER(x, ptr) __put_user_asm64(x, ptr)
#else
#define LDD_USER(ptr) __get_user_asm("ldd", ptr)
@@ -114,6 +114,20 @@ struct exception_data {
: "r"(ptr), "1"(__gu_err) \
: "r1");
+#if !defined(CONFIG_64BIT)
+
+#define __get_user_asm64(ptr) \
+ __asm__("\n1:\tldw 0(%%sr2,%2),%0" \
+ "\n2:\tldw 4(%%sr2,%2),%R0\n\t" \
+ ASM_EXCEPTIONTABLE_ENTRY(1b, fixup_get_user_skip_2)\
+ ASM_EXCEPTIONTABLE_ENTRY(2b, fixup_get_user_skip_1)\
+ : "=r"(__gu_val), "=r"(__gu_err) \
+ : "r"(ptr), "1"(__gu_err) \
+ : "r1");
+
+#endif /* !defined(CONFIG_64BIT) */
+
+
#define __put_user(x, ptr) \
({ \
register long __pu_err __asm__ ("r8") = 0; \