From patchwork Wed Oct 18 12:33:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 116288 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp6019947qgn; Wed, 18 Oct 2017 05:42:03 -0700 (PDT) X-Received: by 10.55.130.5 with SMTP id e5mr1973588qkd.155.1508330523431; Wed, 18 Oct 2017 05:42:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508330523; cv=none; d=google.com; s=arc-20160816; b=ToBVQ5qFE0h7buVQHb8pPICmRnUMO1yJnl3oP5NrF8ClG2AiixI8ceoFeLl5mqFOV6 9CzEEDMvYHTUYszOFdRywnaX2CUFG+UMjbcQsqoCJxtb8UNwIhqvarrVVjMMsoy5hExy JMDDUniSA2AXtNdqUrpfIXWx+Yz6rbUi6445es0covM59GCF/S/90hnjj/mAfzCA4t8R Ss7T9X0+hQS6h7ML3fWBDV+/I5owdJEDz36kAZEJDbBeaH/DalV4yTpZVJdXSAY/MVXo 1xeZ7f3UIFoLuR/p3slQcrCNV3WYFPAYEm69nZ+GA+6S6kT2HtGtGTSR4i5oPDXez6nK angQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=NURbWz0h+eczd8WS3aI0rlmYaJfhP0FKvBpT3e8cyoc=; b=akDn5zv5bcToLvS1kMiiSbL8tBQL781BaTEjdwM0iB9UcLoU3dUwc2phcuWLeisueK 39Ws6gPQVrYYhbwShUBReQIaMtn+t1Ll9zUA4EKKsjM6Xr1lIx3Ywyi0Y0F8P1P0cast OY0iDOexZLOuTNt1+YiTLNnnGl4SdC2AKsPptHv1HMStrQYokzMCBTA/Rqv2N4pkRHla 2oLwPkFZZzx0e3XpnZTDOGyKw35oGmbDhxjsg8HqWUa9xfygh17ar+jDFvXKFTuWuPTB 31TO7pAg43puPi6wN/NLbQg/VkV64hL8/BxqQh0KLRewyG7ckU7EG2rwNkm8gAH9C5hC S+eA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=e1qLNGsA; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id x57si41000qtk.42.2017.10.18.05.42.03 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 18 Oct 2017 05:42:03 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=e1qLNGsA; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:44461 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4nfd-0002zS-Cf for patch@linaro.org; Wed, 18 Oct 2017 08:42:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58655) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4nXe-0005HY-0S for qemu-devel@nongnu.org; Wed, 18 Oct 2017 08:33:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e4nXc-00040W-9B for qemu-devel@nongnu.org; Wed, 18 Oct 2017 08:33:46 -0400 Received: from mail-lf0-x243.google.com ([2a00:1450:4010:c07::243]:46831) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e4nXc-00040D-0M for qemu-devel@nongnu.org; Wed, 18 Oct 2017 08:33:44 -0400 Received: by mail-lf0-x243.google.com with SMTP id g70so5628429lfl.3 for ; Wed, 18 Oct 2017 05:33:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=NURbWz0h+eczd8WS3aI0rlmYaJfhP0FKvBpT3e8cyoc=; b=e1qLNGsAOqdWezp8Laz+jozYC1aIMN8BTcr0wklLZKr+0kkX9HlhvUL4Sg7DthPRYs /0JYPyl5GxyCsQhuyBoA367Hou2OdxWU/1Rz8y3LBteU7o7aBJT/8p/gxNqbmfaFmjGx sOMN0H+9i50gjg5hiMkbaI2oJ/9nx8Vas13hI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=NURbWz0h+eczd8WS3aI0rlmYaJfhP0FKvBpT3e8cyoc=; b=VapDRDSiB3JbHU3wpIhI0mXCz/TrV/Pu6QBLspCvgijpfw4+d+Hz9ZbOmqdzADMbuz +7i2iPMYr8sXR1O34eDkd7Afp0R/vF6OuLvBO9/elve6+NU9w2DREkwMLhnFlfE4YWQf nrrFb96mcGtz3oDE33Atq4E9zPAOKIEm2qPKxQocyg4OQ0iJXxuEFPK7uc7nPuYyoq9y YEao8FGDG1X14z3/zRNminWu9JQBVGQ7qN9R9QjWhYm2ct3o5mkbLVRrL/A+lBXlO9eE faJzl26a58JtjgIAaz0SYCMY0dBknEOMrKAbpUKwZvX8e3mFpHCrAXgu3wqNH95jE5sc xfTw== X-Gm-Message-State: AMCzsaVuczFOFUs2jfm/vJQgXzmKtlr4eXYdUm5FK/1FqeWTngZn+xys EZ1qd7AivENQy1k4jQmIilQI7iAd7/I= X-Google-Smtp-Source: ABhQp+T8bqy8p78RW0rvMm+k7LIjY5DJAnHGpEcsDmavMU7rFSX9XcNWNh4b1GedHvDWTGl1BYHCYA== X-Received: by 10.25.168.2 with SMTP id r2mr5247612lfe.103.1508330022553; Wed, 18 Oct 2017 05:33:42 -0700 (PDT) Received: from berserk.kos.to (91-157-170-157.elisa-laajakaista.fi. [91.157.170.157]) by smtp.gmail.com with ESMTPSA id j71sm2590718lfk.6.2017.10.18.05.33.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Oct 2017 05:33:41 -0700 (PDT) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Wed, 18 Oct 2017 15:33:24 +0300 Message-Id: X-Mailer: git-send-email 2.14.2 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4010:c07::243 Subject: [Qemu-devel] [PULL 10/10] linux-user: Fix TARGET_MTIOCTOP/MTIOCGET/MTIOCPOS values X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Peter Maydell The TARGET_MTIOCTOP/TARGET_MTIOCGET/TARGET_MTIOCPOS values were being defined in terms of host struct types, but these structures are such that their size might differ on different hosts. Switch to using a target struct definition instead. Signed-off-by: Peter Maydell Signed-off-by: Riku Voipio --- linux-user/syscall_defs.h | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) -- 2.14.2 diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index 447915cf80..e405d1d31d 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -2712,9 +2712,34 @@ struct target_f_owner_ex { #define TARGET_VFAT_IOCTL_READDIR_BOTH TARGET_IORU('r', 1) #define TARGET_VFAT_IOCTL_READDIR_SHORT TARGET_IORU('r', 2) -#define TARGET_MTIOCTOP TARGET_IOW('m', 1, struct mtop) -#define TARGET_MTIOCGET TARGET_IOR('m', 2, struct mtget) -#define TARGET_MTIOCPOS TARGET_IOR('m', 3, struct mtpos) +struct target_mtop { + abi_short mt_op; + abi_int mt_count; +}; + +#if defined(TARGET_SPARC) || defined(TARGET_MIPS) +typedef abi_long target_kernel_daddr_t; +#else +typedef abi_int target_kernel_daddr_t; +#endif + +struct target_mtget { + abi_long mt_type; + abi_long mt_resid; + abi_long mt_dsreg; + abi_long mt_gstat; + abi_long mt_erreg; + target_kernel_daddr_t mt_fileno; + target_kernel_daddr_t mt_blkno; +}; + +struct target_mtpos { + abi_long mt_blkno; +}; + +#define TARGET_MTIOCTOP TARGET_IOW('m', 1, struct target_mtop) +#define TARGET_MTIOCGET TARGET_IOR('m', 2, struct target_mtget) +#define TARGET_MTIOCPOS TARGET_IOR('m', 3, struct target_mtpos) struct target_sysinfo { abi_long uptime; /* Seconds since boot */