From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:49270) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TDEQK-0004k2-Gy for qemu-devel@nongnu.org; Sun, 16 Sep 2012 08:58:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TDEQJ-0007w9-16 for qemu-devel@nongnu.org; Sun, 16 Sep 2012 08:58:08 -0400 Received: from cantor2.suse.de ([195.135.220.15]:50101 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TDEQI-0007vt-NU for qemu-devel@nongnu.org; Sun, 16 Sep 2012 08:58:06 -0400 Message-ID: <5055CCD8.6040409@suse.de> Date: Sun, 16 Sep 2012 14:58:00 +0200 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1347740649-28646-1-git-send-email-rth@twiddle.net> <1347740649-28646-5-git-send-email-rth@twiddle.net> In-Reply-To: <1347740649-28646-5-git-send-email-rth@twiddle.net> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 4/6] alpha-linux-user: Fix sigaction List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: Riku Voipio , qemu-devel@nongnu.org, Aurelien Jarno Am 15.09.2012 22:24, schrieb Richard Henderson: > Unconditional bswap replaced by __get_user/__put_user. >=20 > Signed-off-by: Richard Henderson Does that still take care of swapping with the correct size? The issue for mips was that some oddballs are 32-bit, others long. Please make sure that mipsn32/mipsn64 (disabled by default due to the unresolved signal warnings) still compile, too. Andreas > --- > linux-user/signal.c | 22 ++++++++-------------- > linux-user/syscall_defs.h | 2 +- > 2 files changed, 9 insertions(+), 15 deletions(-) >=20 > diff --git a/linux-user/signal.c b/linux-user/signal.c > index 7869147..bf2dfb8 100644 > --- a/linux-user/signal.c > +++ b/linux-user/signal.c > @@ -586,28 +586,22 @@ int do_sigaction(int sig, const struct target_sig= action *act, > sig, act, oact); > #endif > if (oact) { > - oact->_sa_handler =3D tswapal(k->_sa_handler); > -#if defined(TARGET_MIPS) || defined (TARGET_ALPHA) > - oact->sa_flags =3D bswap32(k->sa_flags); > -#else > - oact->sa_flags =3D tswapal(k->sa_flags); > -#endif > + __put_user(k->_sa_handler, &oact->_sa_handler); > + __put_user(k->sa_flags, &oact->sa_flags); > #if !defined(TARGET_MIPS) > - oact->sa_restorer =3D tswapal(k->sa_restorer); > + __put_user(k->sa_restorer, &oact->sa_restorer); > #endif > + /* Not swapped. */ > oact->sa_mask =3D k->sa_mask; > } > if (act) { > /* FIXME: This is not threadsafe. */ > - k->_sa_handler =3D tswapal(act->_sa_handler); > -#if defined(TARGET_MIPS) || defined (TARGET_ALPHA) > - k->sa_flags =3D bswap32(act->sa_flags); > -#else > - k->sa_flags =3D tswapal(act->sa_flags); > -#endif > + __get_user(k->_sa_handler, &act->_sa_handler); > + __get_user(k->sa_flags, &act->sa_flags); > #if !defined(TARGET_MIPS) > - k->sa_restorer =3D tswapal(act->sa_restorer); > + __get_user(k->sa_restorer, &act->sa_restorer); > #endif > + /* To be swapped in target_to_host_sigset. */ > k->sa_mask =3D act->sa_mask; > =20 > /* we update the host linux signal state */ > diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h > index a98cbf7..8ca70b9 100644 > --- a/linux-user/syscall_defs.h > +++ b/linux-user/syscall_defs.h > @@ -540,7 +540,7 @@ int do_sigaction(int sig, const struct target_sigac= tion *act, > struct target_old_sigaction { > abi_ulong _sa_handler; > abi_ulong sa_mask; > - abi_ulong sa_flags; > + int32_t sa_flags; > }; > =20 > struct target_rt_sigaction { >=20 --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg