From: Mike Frysinger <vapier@gentoo.org>
To: akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
linux-s390@vger.kernel.org, rmk@arm.linux.org.uk
Subject: [patch] use __asm__ and __volatile__ in i386/arm/s390 byteorder.h
Date: Sun, 17 Jun 2007 18:33:28 -0400 [thread overview]
Message-ID: <200706171833.29046.vapier@gentoo.org> (raw)
This changes asm() to __asm__() and volatile to __volatile__ so that these
headers can be used with gcc's -std=c99.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
diff --git a/include/asm-arm/byteorder.h b/include/asm-arm/byteorder.h
index e6f7fcd..39105dc 100644
--- a/include/asm-arm/byteorder.h
+++ b/include/asm-arm/byteorder.h
@@ -29,7 +29,7 @@ static inline __attribute_const__ __u32 ___arch__swab32(__u32 x)
* right thing and not screw it up to different degrees
* depending on the gcc version.
*/
- asm ("eor\t%0, %1, %1, ror #16" : "=r" (t) : "r" (x));
+ __asm__ ("eor\t%0, %1, %1, ror #16" : "=r" (t) : "r" (x));
} else
#endif
t = x ^ ((x << 16) | (x >> 16)); /* eor r1,r0,r0,ror #16 */
diff --git a/include/asm-i386/byteorder.h b/include/asm-i386/byteorder.h
index a45470a..4ead40b 100644
--- a/include/asm-i386/byteorder.h
+++ b/include/asm-i386/byteorder.h
@@ -32,13 +32,13 @@ static __inline__ __attribute_const__ __u64 ___arch__swab64(__u64 val)
} v;
v.u = val;
#ifdef CONFIG_X86_BSWAP
- asm("bswapl %0 ; bswapl %1 ; xchgl %0,%1"
- : "=r" (v.s.a), "=r" (v.s.b)
- : "0" (v.s.a), "1" (v.s.b));
+ __asm__("bswapl %0 ; bswapl %1 ; xchgl %0,%1"
+ : "=r" (v.s.a), "=r" (v.s.b)
+ : "0" (v.s.a), "1" (v.s.b));
#else
v.s.a = ___arch__swab32(v.s.a);
v.s.b = ___arch__swab32(v.s.b);
- asm("xchgl %0,%1" : "=r" (v.s.a), "=r" (v.s.b) : "0" (v.s.a), "1" (v.s.b));
+ __asm__("xchgl %0,%1" : "=r" (v.s.a), "=r" (v.s.b) : "0" (v.s.a), "1" (v.s.b));
#endif
return v.u;
}
diff --git a/include/asm-s390/byteorder.h b/include/asm-s390/byteorder.h
index 1fe2492..07230f6 100644
--- a/include/asm-s390/byteorder.h
+++ b/include/asm-s390/byteorder.h
@@ -18,7 +18,7 @@ static inline __u64 ___arch__swab64p(const __u64 *x)
{
__u64 result;
- asm volatile("lrvg %0,%1" : "=d" (result) : "m" (*x));
+ __asm__ __volatile__("lrvg %0,%1" : "=d" (result) : "m" (*x));
return result;
}
@@ -26,7 +26,7 @@ static inline __u64 ___arch__swab64(__u64 x)
{
__u64 result;
- asm volatile("lrvgr %0,%1" : "=d" (result) : "d" (x));
+ __asm__ __volatile__("lrvgr %0,%1" : "=d" (result) : "d" (x));
return result;
}
@@ -40,7 +40,7 @@ static inline __u32 ___arch__swab32p(const __u32 *x)
{
__u32 result;
- asm volatile(
+ __asm__ __volatile__(
#ifndef __s390x__
" icm %0,8,3(%1)\n"
" icm %0,4,2(%1)\n"
@@ -61,7 +61,7 @@ static inline __u32 ___arch__swab32(__u32 x)
#else /* __s390x__ */
__u32 result;
- asm volatile("lrvr %0,%1" : "=d" (result) : "d" (x));
+ __asm__ __volatile__("lrvr %0,%1" : "=d" (result) : "d" (x));
return result;
#endif /* __s390x__ */
}
@@ -75,7 +75,7 @@ static __inline__ __u16 ___arch__swab16p(const __u16 *x)
{
__u16 result;
- asm volatile(
+ __asm__ __volatile__(
#ifndef __s390x__
" icm %0,2,1(%1)\n"
" ic %0,0(%1)\n"
next reply other threads:[~2007-06-17 22:33 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-17 22:33 Mike Frysinger [this message]
2007-06-17 22:51 ` [patch] use __asm__ and __volatile__ in i386/arm/s390 byteorder.h Arjan van de Ven
2007-06-17 23:24 ` Arnd Bergmann
2007-06-17 23:55 ` Mike Frysinger
2007-06-18 8:51 ` David Woodhouse
2007-06-18 18:11 ` Christoph Hellwig
2007-06-18 18:21 ` Mike Frysinger
2007-06-18 18:34 ` Christoph Hellwig
2007-06-18 18:39 ` Christoph Hellwig
2007-06-18 19:00 ` Sam Ravnborg
2007-06-19 4:15 ` Christoph Hellwig
[not found] <fa.Xa4Tv0RVV3kUIdHC69Jp/LpQPcg@ifi.uio.no>
[not found] ` <fa.D5W5QzyAnzzOD5Ln35+YDQKzWsE@ifi.uio.no>
[not found] ` <fa.XhJVn2uLXM0A6yjcYTr2E44DELQ@ifi.uio.no>
[not found] ` <fa.tGqwq8EAmSwz5rSn2D2AkvD+yt0@ifi.uio.no>
2007-06-18 14:27 ` Robert Hancock
2007-06-18 17:57 ` H. Peter Anvin
2007-06-18 18:12 ` Christoph Hellwig
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=200706171833.29046.vapier@gentoo.org \
--to=vapier@gentoo.org \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=rmk@arm.linux.org.uk \
/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