From: Helge Deller <deller@gmx.de>
To: linux-parisc <linux-parisc@vger.kernel.org>,
Kyle McMartin <kyle@mcmartin.ca>
Cc: John David Anglin <dave@hiauly1.hia.nrc.ca>
Subject: [PATCH] ldcw inline assembler patch
Date: Sun, 24 Aug 2008 21:04:26 +0200 [thread overview]
Message-ID: <200808242104.27135.deller@gmx.de> (raw)
In-Reply-To: <200808242026.06295.deller@gmx.de>
There are two reasons to expose the memory *a in the asm:
1) To prevent the compiler from discarding a preceeding write to *a, and
2) to prevent it from caching *a in a register over the asm.
The change has had a few days testing with a SMP build of 2.6.22.19
running on a rp3440.
This patch is about the correctness of the __ldcw() macro itself.
The use of the macro should be confined to small inline functions
to try to limit the effect of clobbering memory on GCC's optimization
of loads and stores.
Signed-off-by: Dave Anglin <dave.anglin@nrc-cnrc.gc.ca>
Signed-off-by: Helge Deller <deller@gmx.de>
diff --git a/arch/parisc/include/asm/system.h b/arch/parisc/include/asm/system.h
index ee80c92..d91357b 100644
--- a/arch/parisc/include/asm/system.h
+++ b/arch/parisc/include/asm/system.h
@@ -168,8 +168,8 @@ static inline void set_eiem(unsigned long val)
/* LDCW, the only atomic read-write operation PA-RISC has. *sigh*. */
#define __ldcw(a) ({ \
unsigned __ret; \
- __asm__ __volatile__(__LDCW " 0(%1),%0" \
- : "=r" (__ret) : "r" (a)); \
+ __asm__ __volatile__(__LDCW " 0(%2),%0" \
+ : "=r" (__ret), "+m" (*(a)) : "r" (a)); \
__ret; \
})
next prev parent reply other threads:[~2008-08-24 19:04 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-24 18:26 [PATCH] - Patch series for parisc Helge Deller
2008-08-24 18:33 ` [PATCH] compat_sys_ptrace conversions " Helge Deller
2008-08-25 16:52 ` Christoph Hellwig
2008-08-26 21:09 ` Roland McGrath
2008-08-25 17:11 ` Kyle McMartin
2008-08-25 17:49 ` Helge Deller
2008-08-26 20:03 ` Christoph Hellwig
2008-08-24 18:45 ` [PATCH] fix crash when trying to unwind user space Helge Deller
2008-08-24 18:51 ` [PATCH] drop superfluous .align 16 Helge Deller
2008-08-24 18:57 ` James Bottomley
2008-08-25 12:31 ` Helge Deller
2008-08-26 4:26 ` Grant Grundler
2008-08-26 12:42 ` Carlos O'Donell
2008-08-26 14:10 ` James Bottomley
2008-08-26 15:35 ` Carlos O'Donell
2008-08-24 19:04 ` Helge Deller [this message]
2008-08-24 19:21 ` [PATCH] Change cpu_data[] and cpu_devices[] from array sized by NR_CPUS to per_cpu variables Helge Deller
2008-08-24 21:24 ` Helge Deller
2008-08-27 4:51 ` Grant Grundler
2008-08-27 20:42 ` Helge Deller
2008-08-24 19:49 ` [PATCH] - Patch series for parisc Helge Deller
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=200808242104.27135.deller@gmx.de \
--to=deller@gmx.de \
--cc=dave@hiauly1.hia.nrc.ca \
--cc=kyle@mcmartin.ca \
--cc=linux-parisc@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox