All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ralf Baechle <ralf@linux-mips.org>
To: Kevin Paul Herbert <kph@cisco.com>
Cc: linux-mips@linux-mips.org
Subject: Re: Removal of ____raw_readq() and ____raw_writeq() from asm-mips/io.h
Date: Wed, 28 Jan 2004 16:00:43 +0100	[thread overview]
Message-ID: <20040128150043.GA11872@linux-mips.org> (raw)
In-Reply-To: <20040128143004.GB1717@linux-mips.org>

Below the patch which I've just checked in.

  Ralf

Index: include/asm-mips/io.h
===================================================================
RCS file: /home/cvs/linux/include/asm-mips/io.h,v
retrieving revision 1.68
diff -u -r1.68 io.h
--- include/asm-mips/io.h	19 Jan 2004 21:48:21 -0000	1.68
+++ include/asm-mips/io.h	28 Jan 2004 14:55:57 -0000
@@ -248,12 +248,10 @@
 #define __raw_readw(addr)	(*(volatile unsigned short *)(addr))
 #define __raw_readl(addr)	(*(volatile unsigned int *)(addr))
 #ifdef CONFIG_MIPS32
-#define __raw_readq(addr)						\
+#define ____raw_readq(addr)						\
 ({									\
-	unsigned long __flags;						\
 	u64 __res;							\
 									\
-	local_irq_save(__flags);					\
 	__asm__ __volatile__ (						\
 		"	.set	mips3		# ____raw_readq	\n"	\
 		"	ld	%L0, (%1)			\n"	\
@@ -262,12 +260,22 @@
 		"	.set	mips0				\n"	\
 		: "=r" (__res)						\
 		: "r" (addr));						\
+	__res;								\
+})
+#define __raw_readq(addr)						\
+({									\
+	unsigned long __flags;						\
+	u64 __res;							\
+									\
+	local_irq_save(__flags);					\
+	__res = ____raw_readq(addr);					\
 	local_irq_restore(__flags);					\
 	__res;								\
 })
 #endif
 #ifdef CONFIG_MIPS64
-#define __raw_readq(addr)	(*(volatile unsigned long *)(addr))
+#define ____raw_readq(addr)	(*(volatile unsigned long *)(addr))
+#define __raw_readq(addr)	____raw_readq(addr)
 #endif
 
 #define readb(addr)		__ioswab8(__raw_readb(addr))
@@ -279,12 +287,10 @@
 #define __raw_writew(w,addr)	((*(volatile unsigned short *)(addr)) = (w))
 #define __raw_writel(l,addr)	((*(volatile unsigned int *)(addr)) = (l))
 #ifdef CONFIG_MIPS32
-#define __raw_writeq(val,addr)						\
+#define ____raw_writeq(val,addr)						\
 ({									\
-	unsigned long __flags;						\
 	u64 __tmp;							\
 									\
-	local_irq_save(__flags);					\
 	__asm__ __volatile__ (						\
 		"	.set	mips3				\n"	\
 		"	dsll32	%L0, %L0, 0	# ____raw_writeq\n"	\
@@ -295,11 +301,19 @@
 		"	.set	mips0				\n"	\
 		: "=r" (__tmp)						\
 		: "0" ((unsigned long long)val), "r" (addr));		\
+})
+#define __raw_writeq(val,addr)						\
+({									\
+	unsigned long __flags;						\
+									\
+	local_irq_save(__flags);					\
+	____raw_writeq(val, addr);					\
 	local_irq_restore(__flags);					\
 })
 #endif
 #ifdef CONFIG_MIPS64
-#define __raw_writeq(l,addr)	((*(volatile unsigned long *)(addr)) = (l))
+#define ____raw_writeq(q,addr)	((*(volatile unsigned long *)(addr)) = (q))
+#define __raw_writeq(q,addr)	____raw_writeq(q, addr)
 #endif
 
 #define writeb(b,addr)		__raw_writeb(__ioswab8(b),(addr))

      reply	other threads:[~2004-01-28 15:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-28  1:58 Removal of ____raw_readq() and ____raw_writeq() from asm-mips/io.h Kevin Paul Herbert
2004-01-28  9:40 ` Ladislav Michl
2004-01-28 10:49   ` Jes Sorensen
2004-01-28 15:08     ` Ladislav Michl
2004-01-28 16:01       ` Ralf Baechle
2004-01-29 10:35       ` Jes Sorensen
2004-01-28 14:30 ` Ralf Baechle
2004-01-28 15:00   ` Ralf Baechle [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040128150043.GA11872@linux-mips.org \
    --to=ralf@linux-mips.org \
    --cc=kph@cisco.com \
    --cc=linux-mips@linux-mips.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.