diff options
author | Philip Guenthe <guenther@cvs.openbsd.org> | 2011-03-12 04:03:05 +0000 |
---|---|---|
committer | Philip Guenthe <guenther@cvs.openbsd.org> | 2011-03-12 04:03:05 +0000 |
commit | e653d46f7cc8cd50c5bd94bceb522aa78157c818 (patch) | |
tree | 8396582989829bd281333f7f102dd0ce609e5d61 | |
parent | c62a833c3eed0faa13ce022b6d4eee3119bffd85 (diff) |
Add missing __statement modifiers in various endian.h files and correct
%1 to %0 in the i386 asm.
asm correction ok drahn@
-rw-r--r-- | sys/arch/i386/include/endian.h | 12 | ||||
-rw-r--r-- | sys/arch/m68k/include/endian.h | 6 | ||||
-rw-r--r-- | sys/arch/sh/include/endian.h | 6 | ||||
-rw-r--r-- | sys/arch/vax/include/endian.h | 6 |
4 files changed, 15 insertions, 15 deletions
diff --git a/sys/arch/i386/include/endian.h b/sys/arch/i386/include/endian.h index 34a3ae7ba0e..817d6c6abb4 100644 --- a/sys/arch/i386/include/endian.h +++ b/sys/arch/i386/include/endian.h @@ -1,4 +1,4 @@ -/* $OpenBSD: endian.h,v 1.16 2011/03/11 15:17:08 pirofti Exp $ */ +/* $OpenBSD: endian.h,v 1.17 2011/03/12 04:03:04 guenther Exp $ */ /*- * Copyright (c) 1997 Niklas Hallqvist. All rights reserved. @@ -29,23 +29,23 @@ #ifdef __GNUC__ -#define __swap32md(x) ({ \ +#define __swap32md(x) __statement({ \ u_int32_t __swap32md_x = (x); \ \ - __asm ("bswap %1" : "+r" (__swap32md_x)); \ + __asm ("bswap %0" : "+r" (__swap32md_x)); \ __swap32md_x; \ }) -#define __swap64md(x) ({ \ +#define __swap64md(x) __statement({ \ u_int64_t __swap64md_x = (x); \ \ (u_int64_t)__swap32md(__swap64md_x >> 32) | \ (u_int64_t)__swap32md(__swap64md_x & 0xffffffff) << 32; \ }) -#define __swap16md(x) ({ \ +#define __swap16md(x) __statement({ \ u_int16_t __swap16md_x = (x); \ \ - __asm ("rorw $8, %w1" : "+r" (__swap16md_x)); \ + __asm ("rorw $8, %w0" : "+r" (__swap16md_x)); \ __swap16md_x; \ }) diff --git a/sys/arch/m68k/include/endian.h b/sys/arch/m68k/include/endian.h index 990cf74cb7a..ca2e6ab46c6 100644 --- a/sys/arch/m68k/include/endian.h +++ b/sys/arch/m68k/include/endian.h @@ -1,4 +1,4 @@ -/* $OpenBSD: endian.h,v 1.16 2011/03/11 15:17:08 pirofti Exp $ */ +/* $OpenBSD: endian.h,v 1.17 2011/03/12 04:03:04 guenther Exp $ */ /*- * Copyright (c) 1997 Niklas Hallqvist. All rights reserved. @@ -31,7 +31,7 @@ #define __swap64md __swap64gen -#define __swap32md(x) ({ \ +#define __swap32md(x) __statement({ \ u_int32_t __swap32md_x = (x); \ \ __asm ("rorw #8, %0; swap %0; rorw #8, %0" : \ @@ -39,7 +39,7 @@ __swap32md_x; \ }) -#define __swap16md(x) ({ \ +#define __swap16md(x) __statement({ \ u_int16_t __swap16md_x = (x); \ \ __asm ("rorw #8, %0" : "=d" (__swap16md_x) : \ diff --git a/sys/arch/sh/include/endian.h b/sys/arch/sh/include/endian.h index 58c69dae57a..9efcde9d80b 100644 --- a/sys/arch/sh/include/endian.h +++ b/sys/arch/sh/include/endian.h @@ -1,4 +1,4 @@ -/* $OpenBSD: endian.h,v 1.2 2011/03/11 15:17:08 pirofti Exp $ */ +/* $OpenBSD: endian.h,v 1.3 2011/03/12 04:03:04 guenther Exp $ */ /* $NetBSD: endian.h,v 1.4 2000/03/17 00:09:25 mycroft Exp $ */ /* Written by Manuel Bouyer. Public domain */ @@ -10,7 +10,7 @@ #define __swap64md __swap64gen -#define __swap16md(x) ({ \ +#define __swap16md(x) __statement({ \ uint16_t rval; \ \ __asm volatile ("swap.b %1,%0" : "=r"(rval) : "r"(x)); \ @@ -18,7 +18,7 @@ rval; \ }) -#define __swap32md(x) ({ \ +#define __swap32md(x) __statement({ \ uint32_t rval; \ \ __asm volatile ("swap.b %1,%0; swap.w %0,%0; swap.b %0,%0" \ diff --git a/sys/arch/vax/include/endian.h b/sys/arch/vax/include/endian.h index f81c35714b0..cb190339d94 100644 --- a/sys/arch/vax/include/endian.h +++ b/sys/arch/vax/include/endian.h @@ -1,4 +1,4 @@ -/* $OpenBSD: endian.h,v 1.14 2011/03/11 15:17:08 pirofti Exp $ */ +/* $OpenBSD: endian.h,v 1.15 2011/03/12 04:03:04 guenther Exp $ */ /*- * Copyright (c) 1997 Niklas Hallqvist. All rights reserved. @@ -31,7 +31,7 @@ #define __swap64md __swap64gen -#define __swap32md(x) ({ \ +#define __swap32md(x) __statement({ \ u_int32_t __swap32md_y, __swap32md_x = (x); \ \ __asm ("rotl $-8, %1, %0; insv %0, $16, $8, %0; " \ @@ -40,7 +40,7 @@ __swap32md_y; \ }) -#define __swap16md(x) ({ \ +#define __swap16md(x) __statement({ \ u_int16_t __swap16md_y, __swap16md_x = (x); \ \ __asm ("rotl $8, %1, %0; rotl $-8, %1, r1; movb r1, %0; " \ |