From patchwork Sat Jan 5 00:39:32 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 209595 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 432F62C008D for ; Sat, 5 Jan 2013 12:35:40 +1100 (EST) Received: from localhost ([::1]:53887 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TrHom-0001fj-Lw for incoming@patchwork.ozlabs.org; Fri, 04 Jan 2013 19:40:56 -0500 Received: from eggs.gnu.org ([208.118.235.92]:60754) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TrHnk-0008O5-9O for qemu-devel@nongnu.org; Fri, 04 Jan 2013 19:39:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TrHnd-0008Mz-N7 for qemu-devel@nongnu.org; Fri, 04 Jan 2013 19:39:52 -0500 Received: from mail-ie0-f173.google.com ([209.85.223.173]:38106) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TrHnd-0008MF-Ic for qemu-devel@nongnu.org; Fri, 04 Jan 2013 19:39:45 -0500 Received: by mail-ie0-f173.google.com with SMTP id e13so20356697iej.4 for ; Fri, 04 Jan 2013 16:39:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=8f7gdSAw9gSEQVNcR5jjyYdF+839Drf5INlbojduhkA=; b=DexPEjhWZXPAb2ycs7sBX/fQcuA7dMsfhE7bRMv5KJVmSYrNk9Fjd8ldWHd6Oqr2of evIueEohsXuPdjYSFGzlLca0F1Z8lXFmddlzVkm6/KpZilyz0f/ajMmj/DfXaNjTCpsq 0xbU/UJSH9UZUjIJyq38vXIxaZWJPQYYFuuIG4WX4PeFHqnirVEPyDmYSaNljQtr5KLZ rB8nt1Ii1RosgFVhz7SPeyo4IOL0rNkHU8o8LcEmIngsWV6PfMzcjf38/HupktgsAqRL P1FEk9LCYg01As+rXxF0I1Qn+eOtiijL0N+PLYdOsHvgDWpjpMGt6bsYIfRuzfwyA2LG AmFA== X-Received: by 10.50.236.68 with SMTP id us4mr192270igc.85.1357346385119; Fri, 04 Jan 2013 16:39:45 -0800 (PST) Received: from anchor.twiddle.home.com (50-194-63-110-static.hfc.comcastbusiness.net. [50.194.63.110]) by mx.google.com with ESMTPS id as6sm940417igc.8.2013.01.04.16.39.44 (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 04 Jan 2013 16:39:44 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Fri, 4 Jan 2013 16:39:32 -0800 Message-Id: <1357346373-13898-8-git-send-email-rth@twiddle.net> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1357346373-13898-1-git-send-email-rth@twiddle.net> References: <1357346373-13898-1-git-send-email-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.223.173 Cc: Blue Swirl , Riku Voipio Subject: [Qemu-devel] [PATCH 7/8] alpha-linux-user: Fix sigaction X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Unconditional bswap replaced by __get_user/__put_user. Signed-off-by: Richard Henderson --- linux-user/signal.c | 22 ++++++++-------------- linux-user/syscall_defs.h | 2 +- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/linux-user/signal.c b/linux-user/signal.c index 95e2ffa..407619a 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -607,28 +607,22 @@ int do_sigaction(int sig, const struct target_sigaction *act, sig, act, oact); #endif if (oact) { - oact->_sa_handler = tswapal(k->_sa_handler); -#if defined(TARGET_MIPS) || defined (TARGET_ALPHA) - oact->sa_flags = bswap32(k->sa_flags); -#else - oact->sa_flags = 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 = tswapal(k->sa_restorer); + __put_user(k->sa_restorer, &oact->sa_restorer); #endif + /* Not swapped. */ oact->sa_mask = k->sa_mask; } if (act) { /* FIXME: This is not threadsafe. */ - k->_sa_handler = tswapal(act->_sa_handler); -#if defined(TARGET_MIPS) || defined (TARGET_ALPHA) - k->sa_flags = bswap32(act->sa_flags); -#else - k->sa_flags = 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 = tswapal(act->sa_restorer); + __get_user(k->sa_restorer, &act->sa_restorer); #endif + /* To be swapped in target_to_host_sigset. */ k->sa_mask = act->sa_mask; /* we update the host linux signal state */ diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index d4589e7..f8f5539 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -544,7 +544,7 @@ int do_sigaction(int sig, const struct target_sigaction *act, struct target_old_sigaction { abi_ulong _sa_handler; abi_ulong sa_mask; - abi_ulong sa_flags; + int32_t sa_flags; }; struct target_rt_sigaction {