Re: [PATCH] parisc: fix out-of-register compiler error in ldcw inline assembler function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/21/2014 3:46 PM, Helge Deller wrote:
  /* LDCW, the only atomic read-write operation PA-RISC has. *sigh*.  */
-#define __ldcw(a) ({						\
-	unsigned __ret;						\
-	__asm__ __volatile__(__LDCW " 0(%2),%0"			\
-		: "=r" (__ret), "+m" (*(a)) : "r" (a));		\
-	__ret;							\
-})
+static inline unsigned int __ldcw(volatile unsigned int *address)
+{
+	unsigned int ret;
+	register volatile unsigned int *a = address;
+	__asm__ __volatile__(__LDCW " 0(%2),%0"
+		: "=r" (ret), "+m" (*(a)) : "r" (a));
+	return ret;
+}
You could keep the old macro version for 32-bit builds as the problem shouldn't occur there.

Dave

--
John David Anglin    dave.anglin@xxxxxxxx

--
To unsubscribe from this list: send the line "unsubscribe linux-parisc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux SoC]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux