patch-2.4.21 linux-2.4.21/include/asm-parisc/uaccess.h
Next file: linux-2.4.21/include/asm-parisc/unistd.h
Previous file: linux-2.4.21/include/asm-parisc/system_irqsave.h
Back to the patch index
Back to the overall index
- Lines: 55
- Date:
2003-06-13 07:51:38.000000000 -0700
- Orig file:
linux-2.4.20/include/asm-parisc/uaccess.h
- Orig date:
2002-11-28 15:53:15.000000000 -0800
diff -urN linux-2.4.20/include/asm-parisc/uaccess.h linux-2.4.21/include/asm-parisc/uaccess.h
@@ -37,8 +37,8 @@
#if BITS_PER_LONG == 32
#define LDD_KERNEL(ptr) BUG()
#define LDD_USER(ptr) BUG()
-#define STD_KERNEL(x, ptr) BUG()
-#define STD_USER(x, ptr) BUG()
+#define STD_KERNEL(x, ptr) __put_kernel_asm64(x,ptr)
+#define STD_USER(x, ptr) __put_user_asm64(x,ptr)
#else
#define LDD_KERNEL(ptr) __get_kernel_asm("ldd",ptr)
#define LDD_USER(ptr) __get_user_asm("ldd",ptr)
@@ -210,6 +210,43 @@
"\t.previous" \
: "=r"(__pu_err) \
: "r"(ptr), "r"(x), "0"(__pu_err))
+
+static inline void __put_kernel_asm64(u64 x, void *ptr)
+{
+ u32 hi = x>>32;
+ u32 lo = x&0xffffffff;
+ __asm__ __volatile__ (
+ "\n1:\tstw %1,0(%0)\n"
+ "\n2:\tstw %2,4(%0)\n"
+ "3:\n"
+ "\t.section __ex_table,\"a\"\n"
+ "\t.word\t1b\n"
+ "\t.word\t(3b-1b)+1\n"
+ "\t.word\t2b\n"
+ "\t.word\t(3b-2b)+1\n"
+ "\t.previous"
+ : : "r"(ptr), "r"(hi), "r"(lo));
+
+}
+
+static inline void __put_user_asm64(u64 x, void *ptr)
+{
+ u32 hi = x>>32;
+ u32 lo = x&0xffffffff;
+ __asm__ __volatile__ (
+ "\n1:\tstw %1,0(%%sr3,%0)\n"
+ "\n2:\tstw %2,4(%%sr3,%0)\n"
+ "3:\n"
+ "\t.section __ex_table,\"a\"\n"
+ "\t.word\t1b\n"
+ "\t.word\t(3b-1b)+1\n"
+ "\t.word\t2b\n"
+ "\t.word\t(3b-2b)+1\n"
+ "\t.previous"
+ : : "r"(ptr), "r"(hi), "r"(lo));
+
+}
+
#endif
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)