From patchwork Wed Oct 17 04:17:17 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 191953 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 EB7102C009A for ; Wed, 17 Oct 2012 15:19:02 +1100 (EST) Received: from localhost ([::1]:53731 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOL5w-0004dN-Ts for incoming@patchwork.ozlabs.org; Wed, 17 Oct 2012 00:19:00 -0400 Received: from eggs.gnu.org ([208.118.235.92]:55944) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOL5a-0004UY-DM for qemu-devel@nongnu.org; Wed, 17 Oct 2012 00:18:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TOL5Z-00017k-BO for qemu-devel@nongnu.org; Wed, 17 Oct 2012 00:18:38 -0400 Received: from mail-pa0-f45.google.com ([209.85.220.45]:58808) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOL5Z-00016W-5Y for qemu-devel@nongnu.org; Wed, 17 Oct 2012 00:18:37 -0400 Received: by mail-pa0-f45.google.com with SMTP id fb10so6633126pad.4 for ; Tue, 16 Oct 2012 21:18:36 -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=mfw1cTGMIr3G9Ec8eoT1PAqh8AM+LmT6GFLmoOaBBv4=; b=J1AoFtYUc7bGjy5BUNG/H8ovqrHlh5Gr3Ix6hFj2BN9pJu6SgIajTRo+b2WZrOAGiT lFScm3LW+IZeqtqU15z7gCbtprn88zTUjQ8BOL98/1U75XCJisEOW3ctyX5NQDyTr7X0 SYx+rfT7ycoJr4TNJmuAVO7EDhK1Z38FAFtK8ebQXUUVkTAb17jw8a2iVQcBbrr8tgeR VrPddm84YFYawuxSK4+HHXmfSgMl+C6aYhuAygKqdpilbwTbUTjSrORcAfxts2lkpVrp YfBVftaC341kiox9iRwwF/Nv7jxOTPhrHub1YFeDEd0iwNrQd+LP6KI9RJ3PnH8MHUiC dgng== Received: by 10.68.129.72 with SMTP id nu8mr52793393pbb.29.1350447516837; Tue, 16 Oct 2012 21:18:36 -0700 (PDT) Received: from pebble.twiddle.home ([101.168.58.73]) by mx.google.com with ESMTPS id iu8sm11824224pbc.71.2012.10.16.21.18.34 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 16 Oct 2012 21:18:36 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 17 Oct 2012 14:17:17 +1000 Message-Id: <1350447438-8603-4-git-send-email-rth@twiddle.net> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1350447438-8603-1-git-send-email-rth@twiddle.net> References: <1350447438-8603-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 3/4] 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 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 {