From patchwork Thu Oct 11 19:22:15 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 190987 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 B57922C00A3 for ; Fri, 12 Oct 2012 06:59:13 +1100 (EST) Received: from localhost ([::1]:43637 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TMOLQ-0004HS-PC for incoming@patchwork.ozlabs.org; Thu, 11 Oct 2012 15:22:56 -0400 Received: from eggs.gnu.org ([208.118.235.92]:54802) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TMOL1-0003gi-8E for qemu-devel@nongnu.org; Thu, 11 Oct 2012 15:22:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TMOKz-0001Y4-Hl for qemu-devel@nongnu.org; Thu, 11 Oct 2012 15:22:31 -0400 Received: from mail-pa0-f45.google.com ([209.85.220.45]:63236) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TMOKz-0001XX-59 for qemu-devel@nongnu.org; Thu, 11 Oct 2012 15:22:29 -0400 Received: by mail-pa0-f45.google.com with SMTP id fb10so2060126pad.4 for ; Thu, 11 Oct 2012 12:22:28 -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=6+9ri4ZuKEY8BeRYG1kLGFBKpBwr2EmqtMAiLJzG8pg=; b=QKC40WxAcE/SD4ovPT34DjbkQ/ZYpln3iYiNR9b4PNOMnqeqOsrixlBYUpigDrvP+X 7ovMda3XpTenfr3QwOJL6dF4vsb/n4Ggn9fZDlv5T9U8OUIkMjOoKrR+UpjYg8Qa/08g gDI/WhX5YAnd1cT54ie2TafrsSLHLQizOYFfruBQV+mcqP7cGdpg4u4XlSkT4gX5PSOA 44R/lqbyjQak5LkKN03uPemwxREZIVe89QsOKf5/CSnkWtKX6Yjov68lgWlBPJEbeuhd wGLqZM+T3tz0KyU5lLBfDKZinDK85wS06xtYyF0KofVttEkj2n1NbvE6mPeOooz+zk11 k7cg== Received: by 10.66.89.37 with SMTP id bl5mr4787107pab.55.1349983348850; Thu, 11 Oct 2012 12:22:28 -0700 (PDT) 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 wl4sm3153795pbc.17.2012.10.11.12.22.27 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 11 Oct 2012 12:22:28 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 11 Oct 2012 12:22:15 -0700 Message-Id: <1349983336-9974-6-git-send-email-rth@twiddle.net> X-Mailer: git-send-email 1.7.11.4 In-Reply-To: <1349983336-9974-1-git-send-email-rth@twiddle.net> References: <1349983336-9974-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.220.45 Cc: Riku Voipio Subject: [Qemu-devel] [PATCH 5/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 15bc4e8..1969877 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 {