From patchwork Wed Apr 3 10:32:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 233352 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 DB22A2C00AB for ; Wed, 3 Apr 2013 21:38:48 +1100 (EST) Received: from localhost ([::1]:41481 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNL5b-0007l5-48 for incoming@patchwork.ozlabs.org; Wed, 03 Apr 2013 06:38:47 -0400 Received: from eggs.gnu.org ([208.118.235.92]:40630) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNKzb-00019F-SO for qemu-devel@nongnu.org; Wed, 03 Apr 2013 06:32:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UNKzS-0004Ia-7R for qemu-devel@nongnu.org; Wed, 03 Apr 2013 06:32:35 -0400 Received: from mail-wg0-f53.google.com ([74.125.82.53]:48755) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNKzR-0004IN-Rr for qemu-devel@nongnu.org; Wed, 03 Apr 2013 06:32:26 -0400 Received: by mail-wg0-f53.google.com with SMTP id c11so1383918wgh.8 for ; Wed, 03 Apr 2013 03:32:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=YAJPHzwiJcJAh2ndJp/zYudIfKf4IJThUOxl+F6aJBg=; b=Md6M6QpEGOonDk/tsEiAua4w0w9b98nXAvat1CJrAzvSdH5o/gC9HegeFN7DWtk4nj ipSeeSJha1vamiFBJzB9XvUSqhgw5OnDOk9TxSlMzpEpqupw6NskGJyLcgoo/IDu7y6Y d9asivwN8hFwph/5S6Tgf/EmHt53J190rQZRfyrGPKS//FjTKl4TZT2AJKxTvanvjj07 5Lzkpje1TCGSO/0sDWL7vlDbK4X/aDriGgHJIrACJ3pjfAH2/IqvdDH1FevU85VEDmXX eoHoGNcRkkGHaqNNM1Z4LG1PmJMEFtF1eTPUyMKOmKc3/NS07iNBcHsiwWmsnuxw1KrZ L5gg== X-Received: by 10.180.37.146 with SMTP id y18mr21854783wij.10.1364985145065; Wed, 03 Apr 2013 03:32:25 -0700 (PDT) Received: from playground.lan (93-34-176-20.ip50.fastwebnet.it. [93.34.176.20]) by mx.google.com with ESMTPS id dm9sm24010369wib.3.2013.04.03.03.32.22 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 03 Apr 2013 03:32:23 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 3 Apr 2013 12:32:03 +0200 Message-Id: <1364985128-23772-6-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1364985128-23772-1-git-send-email-pbonzini@redhat.com> References: <1364985128-23772-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 74.125.82.53 Cc: aurelien@aurel32.net, pmaydell@linaro.org Subject: [Qemu-devel] [PATCH v2 05/10] elfload: use abi_int/uint instead of target_int/uint 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 The alignment is a characteristic of the ABI, not the CPU. Signed-off-by: Paolo Bonzini --- configure | 3 --- include/exec/cpu-defs.h | 2 -- include/exec/user/abitypes.h | 5 +++++ linux-user/elfload.c | 14 +++++++------- target-m68k/cpu.h | 1 + 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/configure b/configure index 68314d1..8276e79 100755 --- a/configure +++ b/configure @@ -4011,7 +4011,6 @@ bflt="no" target_nptl="no" interp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_arch2/g"` gdb_xml_files="" -target_int_alignment=4 target_long_alignment=4 target_llong_alignment=8 target_libs_softmmu= @@ -4047,7 +4046,6 @@ case "$target_arch2" in m68k) bflt="yes" gdb_xml_files="cf-core.xml cf-fp.xml" - target_int_alignment=2 target_long_alignment=2 target_llong_alignment=2 ;; @@ -4153,7 +4151,6 @@ case "$cpu" in ;; esac -echo "TARGET_INT_ALIGNMENT=$target_int_alignment" >> $config_target_mak echo "TARGET_LONG_ALIGNMENT=$target_long_alignment" >> $config_target_mak echo "TARGET_LLONG_ALIGNMENT=$target_llong_alignment" >> $config_target_mak echo "TARGET_ARCH=$TARGET_ARCH" >> $config_target_mak diff --git a/include/exec/cpu-defs.h b/include/exec/cpu-defs.h index d376f0f..2aa9331 100644 --- a/include/exec/cpu-defs.h +++ b/include/exec/cpu-defs.h @@ -36,8 +36,6 @@ #define TARGET_LONG_SIZE (TARGET_LONG_BITS / 8) -typedef int32_t target_int __attribute__((aligned(TARGET_INT_ALIGNMENT))); -typedef uint32_t target_uint __attribute__((aligned(TARGET_INT_ALIGNMENT))); typedef int64_t target_llong __attribute__((aligned(TARGET_LLONG_ALIGNMENT))); typedef uint64_t target_ullong __attribute__((aligned(TARGET_LLONG_ALIGNMENT))); /* target_ulong is the type of a virtual address */ diff --git a/include/exec/user/abitypes.h b/include/exec/user/abitypes.h index abaa028..97a87a6 100644 --- a/include/exec/user/abitypes.h +++ b/include/exec/user/abitypes.h @@ -5,9 +5,14 @@ #ifndef ABI_SHORT_ALIGNMENT #define ABI_SHORT_ALIGNMENT 2 #endif +#ifndef ABI_INT_ALIGNMENT +#define ABI_INT_ALIGNMENT 4 +#endif typedef int16_t abi_short __attribute__ ((aligned(ABI_SHORT_ALIGNMENT))); typedef uint16_t abi_ushort __attribute__((aligned(ABI_SHORT_ALIGNMENT))); +typedef int32_t abi_int __attribute__((aligned(ABI_INT_ALIGNMENT))); +typedef uint32_t abi_uint __attribute__((aligned(ABI_INT_ALIGNMENT))); #ifdef TARGET_ABI32 typedef uint32_t abi_ulong; diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 5eca934..14a8ecf 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -113,10 +113,10 @@ typedef abi_ulong target_elf_greg_t; typedef abi_ushort target_uid_t; typedef abi_ushort target_gid_t; #else -typedef target_uint target_uid_t; -typedef target_uint target_gid_t; +typedef abi_uint target_uid_t; +typedef abi_uint target_gid_t; #endif -typedef target_int target_pid_t; +typedef abi_int target_pid_t; #ifdef TARGET_I386 @@ -2109,9 +2109,9 @@ struct memelfnote { }; struct target_elf_siginfo { - target_int si_signo; /* signal number */ - target_int si_code; /* extra code */ - target_int si_errno; /* errno */ + abi_int si_signo; /* signal number */ + abi_int si_code; /* extra code */ + abi_int si_errno; /* errno */ }; struct target_elf_prstatus { @@ -2128,7 +2128,7 @@ struct target_elf_prstatus { struct target_timeval pr_cutime; /* XXX Cumulative user time */ struct target_timeval pr_cstime; /* XXX Cumulative system time */ target_elf_gregset_t pr_reg; /* GP registers */ - target_int pr_fpvalid; /* XXX */ + abi_int pr_fpvalid; /* XXX */ }; #define ELF_PRARGSZ (80) /* Number of chars for args */ diff --git a/target-m68k/cpu.h b/target-m68k/cpu.h index c90c40c..29cc887 100644 --- a/target-m68k/cpu.h +++ b/target-m68k/cpu.h @@ -21,6 +21,7 @@ #define CPU_M68K_H #define TARGET_LONG_BITS 32 +#define ABI_INT_ALIGNMENT 2 #define CPUArchState struct CPUM68KState