From patchwork Mon Jul 1 17:35:11 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 18225 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f71.google.com (mail-yh0-f71.google.com [209.85.213.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1C04625E04 for ; Mon, 1 Jul 2013 17:54:18 +0000 (UTC) Received: by mail-yh0-f71.google.com with SMTP id f73sf7576693yha.6 for ; Mon, 01 Jul 2013 10:54:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-beenthere:x-forwarded-to:x-forwarded-for :delivered-to:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=Y6uzrK2Ak30qIzV80ib5vmFkcDKHbQZUxOOaYclQFXA=; b=fRZClCqvm4+zOohnD0CHab+kogDFU05JMMr65mZJPNGUre/QvxIJm5PfwMVlJB6g8a xsy5mWNPV9nM8PbGCkRgh/L8+fwzkkL0AMVJ4GvERbh1Y+Pe6jSGUJr8oP68uJu+qmh0 ar4nfR5Ih3ZkCQJT7sxdOc/zKfuEKXjfitazMWKKefKMxaQEiFednnL9AreKHUpwmM1F GJMOtcIULCn94rMKYeWWE85BBqbqkbTGHovHTYhMpv5+Lw8bGznhGbC63aq+Q+vn66J8 LwzjWOU2udramx+SHJojIQJyvdDrKwMpEGk18uekN5PJoF0/4/gIWtKclfYQzFxxCZMq rVhw== X-Received: by 10.236.125.200 with SMTP id z48mr15506542yhh.55.1372701257573; Mon, 01 Jul 2013 10:54:17 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.63.1 with SMTP id c1ls2341205qes.32.gmail; Mon, 01 Jul 2013 10:54:17 -0700 (PDT) X-Received: by 10.52.164.16 with SMTP id ym16mr8187424vdb.32.1372701257427; Mon, 01 Jul 2013 10:54:17 -0700 (PDT) Received: from mail-vc0-f180.google.com (mail-vc0-f180.google.com [209.85.220.180]) by mx.google.com with ESMTPS id w1si5010948vei.34.2013.07.01.10.54.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 01 Jul 2013 10:54:17 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.180 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.180; Received: by mail-vc0-f180.google.com with SMTP id gf11so2146951vcb.25 for ; Mon, 01 Jul 2013 10:54:17 -0700 (PDT) X-Received: by 10.52.27.172 with SMTP id u12mr8297899vdg.64.1372701257292; Mon, 01 Jul 2013 10:54:17 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.165.8 with SMTP id yu8csp290342veb; Mon, 1 Jul 2013 10:54:16 -0700 (PDT) X-Received: by 10.194.75.201 with SMTP id e9mr20478132wjw.20.1372701256027; Mon, 01 Jul 2013 10:54:16 -0700 (PDT) Received: from mnementh.archaic.org.uk (1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.d.1.0.0.b.8.0.1.0.0.2.ip6.arpa. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id l1si6860947wjz.60.2013.07.01.10.54.15 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 01 Jul 2013 10:54:16 -0700 (PDT) Received-SPF: neutral (google.com: 2001:8b0:1d0::1 is neither permitted nor denied by best guess record for domain of pm215@archaic.org.uk) client-ip=2001:8b0:1d0::1; Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1Uti0Y-0002LG-UA; Mon, 01 Jul 2013 18:35:23 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Alexander Graf , Andreas Schwab , "Mian M. Hamayun" Subject: [PATCH v5 12/21] linux-user: Fix up AArch64 syscall handlers Date: Mon, 1 Jul 2013 18:35:11 +0100 Message-Id: <1372700120-8896-13-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1372700120-8896-1-git-send-email-peter.maydell@linaro.org> References: <1372700120-8896-1-git-send-email-peter.maydell@linaro.org> X-Gm-Message-State: ALoCoQnqt2UEHXuFpYeH/8LL3eTtjIcRHIMcHK587hq/IZqN1amo5DRRBLfBG35M6RNFZhoEFlit X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.180 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Alexander Graf Some syscall handlers have special code for ARM enabled that we don't need on AArch64. Exclude AArch64 in those cases. In other places we can share struct definitions with other targets or have to provide our own. With this patch applied, most syscall definitions in linux-user should be sound for AArch64. Signed-off-by: Alexander Graf Signed-off-by: John Rigby Message-id: 1368505980-17151-9-git-send-email-john.rigby@linaro.org Signed-off-by: Peter Maydell --- linux-user/syscall.c | 5 +++-- linux-user/syscall_defs.h | 28 ++++++++++++++++++++++++++-- 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index cdd0c28..802ec95 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -4695,7 +4695,7 @@ static inline abi_long host_to_target_stat64(void *cpu_env, abi_ulong target_addr, struct stat *host_st) { -#ifdef TARGET_ARM +#if defined(TARGET_ARM) && defined(TARGET_ABI32) if (((CPUARMState *)cpu_env)->eabi) { struct target_eabi_stat64 *target_st; @@ -6327,7 +6327,8 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, #endif #ifdef TARGET_NR_mmap case TARGET_NR_mmap: -#if (defined(TARGET_I386) && defined(TARGET_ABI32)) || defined(TARGET_ARM) || \ +#if (defined(TARGET_I386) && defined(TARGET_ABI32)) || \ + (defined(TARGET_ARM) && defined(TARGET_ABI32)) || \ defined(TARGET_M68K) || defined(TARGET_CRIS) || defined(TARGET_MICROBLAZE) \ || defined(TARGET_S390X) { diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index 92c01a9..08f7559 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -1137,7 +1137,8 @@ struct target_winsize { #define TARGET_MAP_UNINITIALIZED 0x4000000 /* for anonymous mmap, memory could be uninitialized */ #endif -#if (defined(TARGET_I386) && defined(TARGET_ABI32)) || defined(TARGET_ARM) \ +#if (defined(TARGET_I386) && defined(TARGET_ABI32)) \ + || (defined(TARGET_ARM) && defined(TARGET_ABI32)) \ || defined(TARGET_CRIS) || defined(TARGET_UNICORE32) \ || defined(TARGET_OPENRISC) struct target_stat { @@ -1836,6 +1837,28 @@ struct target_stat { abi_long st_blocks; abi_ulong __unused[3]; }; +#elif defined(TARGET_AARCH64) +struct target_stat { + abi_ulong st_dev; + abi_ulong st_ino; + unsigned int st_mode; + unsigned int st_nlink; + unsigned int st_uid; + unsigned int st_gid; + abi_ulong st_rdev; + abi_ulong _pad1; + abi_long st_size; + int st_blksize; + int __pad2; + abi_long st_blocks; + abi_long target_st_atime; + abi_ulong target_st_atime_nsec; + abi_long target_st_mtime; + abi_ulong target_st_mtime_nsec; + abi_long target_st_ctime; + abi_ulong target_st_ctime_nsec; + unsigned int __unused[2]; +}; #elif defined(TARGET_OPENRISC) struct target_stat { abi_ulong st_dev; @@ -1918,7 +1941,8 @@ struct target_statfs64 { uint32_t f_spare[6]; }; #elif (defined(TARGET_PPC64) || defined(TARGET_X86_64) || \ - defined(TARGET_SPARC64)) && !defined(TARGET_ABI32) + defined(TARGET_SPARC64) || defined(TARGET_AARCH64)) && \ + !defined(TARGET_ABI32) struct target_statfs { abi_long f_type; abi_long f_bsize;