From patchwork Fri Sep 21 14:17:12 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 185744 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 37FC02C0085 for ; Sat, 22 Sep 2012 00:18:08 +1000 (EST) Received: from localhost ([::1]:47082 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TF43O-0000pw-Uj for incoming@patchwork.ozlabs.org; Fri, 21 Sep 2012 10:18:02 -0400 Received: from eggs.gnu.org ([208.118.235.92]:54812) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TF42u-0000El-Oi for qemu-devel@nongnu.org; Fri, 21 Sep 2012 10:17:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TF42o-0002hg-79 for qemu-devel@nongnu.org; Fri, 21 Sep 2012 10:17:32 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:57956) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TF42n-0002gX-Vz for qemu-devel@nongnu.org; Fri, 21 Sep 2012 10:17:26 -0400 Received: by mail-pb0-f45.google.com with SMTP id rp12so7780255pbb.4 for ; Fri, 21 Sep 2012 07:17:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=6fkxtRUyTXH/UIG93Yi6ia5Ymdctv9oaWtj1SUoCvuk=; b=siVJjjSq61dx1pOcQiArHQEa9AgTmZwF5qJhMB3FtDeSGNWBPP9IgsLVDsM5hxxh/F lSI66dxve3hHu1ya1xsGLtgoY/0R2lej8JI7eDL4zKToFpCNFwP9/AjhdkfnTYjKW5R6 WqsawMjE2Xi412MX/16MyvWcu+lTVf+VkZ9ISkMhya5KE+JzGPwyVvtAVNG8DamTQmx2 kUx1Q2cD76z+/W2/9CzntGVUB5bjRmLSl5BXnPmJbs53RL18lDn5TWD5vtDBFbLTimES vbbeJf3SePHLQvXDfRU/ug4hW1pIJe6KTr3zWJEW8HTNOcT7UmxeRnNFg32JYNFUTb1t O4Sw== Received: by 10.66.88.3 with SMTP id bc3mr13604666pab.51.1348237045647; Fri, 21 Sep 2012 07:17:25 -0700 (PDT) Received: from anchor.twiddle.home.com ([173.160.232.49]) by mx.google.com with ESMTPS id vf8sm5204020pbc.27.2012.09.21.07.17.24 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 21 Sep 2012 07:17:25 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Fri, 21 Sep 2012 07:17:12 -0700 Message-Id: <1348237034-15851-5-git-send-email-rth@twiddle.net> X-Mailer: git-send-email 1.7.11.4 In-Reply-To: <1348237034-15851-1-git-send-email-rth@twiddle.net> References: <1348237034-15851-1-git-send-email-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.160.45 Cc: Riku Voipio Subject: [Qemu-devel] [PATCH 4/6] 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 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_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 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_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 {