From: miles@mcspd15.ucom.lsi.nec.co.jp (Miles Bader)
To: Linus Torvalds <torvalds@osdl.org>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH][v850] Use volatile qualifier on v850 test-n-bitop asm statements
Date: Wed, 7 Apr 2004 18:09:46 +0900 (JST) [thread overview]
Message-ID: <20040407090946.E99CD131D9@mcspd15> (raw)
Linus, please apply.
Otherwise the compiler can delete them (this is one of those "how on
earth did it ever work before" moments).
diff -ruN -X../cludes linux-2.6.5-uc0/include/asm-v850/bitops.h linux-2.6.5-uc0-v850-20040407/include/asm-v850/bitops.h
--- linux-2.6.5-uc0/include/asm-v850/bitops.h 2003-06-16 14:53:02.000000000 +0900
+++ linux-2.6.5-uc0-v850-20040407/include/asm-v850/bitops.h 2004-04-07 18:01:49.000000000 +0900
@@ -1,8 +1,8 @@
/*
* include/asm-v850/bitops.h -- Bit operations
*
- * Copyright (C) 2001,02,03 NEC Electronics Corporation
- * Copyright (C) 2001,02,03 Miles Bader <miles@gnu.org>
+ * Copyright (C) 2001,02,03,04 NEC Electronics Corporation
+ * Copyright (C) 2001,02,03,04 Miles Bader <miles@gnu.org>
* Copyright (C) 1992 Linus Torvalds.
*
* This file is subject to the terms and conditions of the GNU General
@@ -84,24 +84,26 @@
#define change_bit __change_bit
-#define __const_tns_bit_op(op, nr, addr) \
- ({ int __tns_res; \
- __asm__ ("tst1 (%1 - 0x123), %2; setf nz, %0; " op " (%1 - 0x123), %2" \
- : "=&r" (__tns_res) \
- : "g" (((nr) & 0x7) + 0x123), \
- "m" (*((char *)(addr) + ((nr) >> 3))) \
- : "memory"); \
- __tns_res; \
+#define __const_tns_bit_op(op, nr, addr) \
+ ({ int __tns_res; \
+ __asm__ __volatile__ ( \
+ "tst1 (%1 - 0x123), %2; setf nz, %0; " op " (%1 - 0x123), %2" \
+ : "=&r" (__tns_res) \
+ : "g" (((nr) & 0x7) + 0x123), \
+ "m" (*((char *)(addr) + ((nr) >> 3))) \
+ : "memory"); \
+ __tns_res; \
})
-#define __var_tns_bit_op(op, nr, addr) \
- ({ int __nr = (nr); \
- int __tns_res; \
- __asm__ ("tst1 %1, [%2]; setf nz, %0; " op " %1, [%2]" \
- : "=&r" (__tns_res) \
- : "r" (__nr & 0x7), \
- "r" ((char *)(addr) + (__nr >> 3)) \
- : "memory"); \
- __tns_res; \
+#define __var_tns_bit_op(op, nr, addr) \
+ ({ int __nr = (nr); \
+ int __tns_res; \
+ __asm__ __volatile__ ( \
+ "tst1 %1, [%2]; setf nz, %0; " op " %1, [%2]" \
+ : "=&r" (__tns_res) \
+ : "r" (__nr & 0x7), \
+ "r" ((char *)(addr) + (__nr >> 3)) \
+ : "memory"); \
+ __tns_res; \
})
#define __tns_bit_op(op, nr, addr) \
((__builtin_constant_p (nr) && (unsigned)(nr) <= 0x7FFFF) \
reply other threads:[~2004-04-07 9:09 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20040407090946.E99CD131D9@mcspd15 \
--to=miles@mcspd15.ucom.lsi.nec.co.jp \
--cc=linux-kernel@vger.kernel.org \
--cc=miles@gnu.org \
--cc=torvalds@osdl.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
all inboxes | Powered by JetHome®