[parisc-linux-cvs] 2.4.22-pa15 DIFF

Grant Grundler grundler@parisc-linux.org
Mon, 10 Nov 2003 18:12:34 -0700


On Mon, Nov 10, 2003 at 06:09:56PM -0700, Grant Grundler wrote:
> Log message:
> 2.4.22-pa15 revert __put_kernel_asm64 to static inline function
> 
> my bad. I overlooked this when committing the code.
> I prefer inline functions over macros for type checking/covercion.
> I don't like the use of "R2" for upper half of u64 data type
> since it's easy to overlook and not commonly used in parisc port.

diff appended.

grant


Index: Makefile
===================================================================
RCS file: /var/cvs/linux-2.4/Makefile,v
retrieving revision 1.428
diff -u -p -r1.428 Makefile
--- Makefile	7 Nov 2003 11:36:49 -0000	1.428
+++ Makefile	11 Nov 2003 00:00:18 -0000
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 4
 SUBLEVEL = 22
-EXTRAVERSION = -pa14
+EXTRAVERSION = -pa15
 
 KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
 
Index: include/asm-parisc/uaccess.h
===================================================================
RCS file: /var/cvs/linux-2.4/include/asm-parisc/uaccess.h,v
retrieving revision 1.15
diff -u -p -r1.15 uaccess.h
--- include/asm-parisc/uaccess.h	8 Jul 2003 02:22:59 -0000	1.15
+++ include/asm-parisc/uaccess.h	11 Nov 2003 00:00:18 -0000
@@ -220,34 +220,41 @@ extern const struct exception_table_entr
 		: "=r"(__pu_err)                            \
 		: "r"(ptr), "r"(x), "0"(__pu_err))
 
-#define __put_kernel_asm64(x, ptr)		\
-	__asm__ __volatile__ (			\
-		"\n1:\tstw\t%2,0(%1)\n"		\
-		"2:\tstw\t%R2,4(%1)\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"(__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));
 
-#define __put_user_asm64(x, ptr)		\
-	__asm__ __volatile__ (			\
-		"\n1:\tstw\t%2,0(%%sr3,%1)\n"	\
-		"2:\tstw\t%R2,4(%%sr3,%1)\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"(__pu_err)		\
-		: "r"(ptr), "r"(x), "0"(__pu_err))
+}
 
+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
 
 /*