From patchwork Tue Aug 19 08:32:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 35572 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qg0-f70.google.com (mail-qg0-f70.google.com [209.85.192.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 065642136C for ; Tue, 19 Aug 2014 08:46:26 +0000 (UTC) Received: by mail-qg0-f70.google.com with SMTP id i50sf10468721qgf.9 for ; Tue, 19 Aug 2014 01:46:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=wODlaDEPaZHca7Mwf6/Ryfp9UjNtFEVJ9pJ8GjqaDiM=; b=I86VSwr1+QVgXxa8WVakWngBeEr8jWqo/Oqx2eZIs3cF90MP5JUbzIjvDvRBmKKnKi q5hBntUS50f7AY0JCrOGkTkNPjzUJVoT+UcxumoZa/4i829hJPYSMBPMHZcC7bjlU2O1 qcqpsWGjmlETCUoRwDcmWIbz6bFUvZrwDciRxEL6jMvo8SAZ+jcyx5LtxYc96W6Z6FrX t33wAjtBxfGji02ENQA2IzSG0Rvufjcecb8jhStBD6T4P8VOshQDGrGELZ0d5gJ7iANI 4mINLZuPxcE/Ksa7IA/UnfpaDRVOoe6zA75mQc5EmxbjgmsmwjYlj4K2SG5U2X3fkMuF 8NVw== X-Gm-Message-State: ALoCoQl8fGLImIBawiyW6UXIaKMDhLygW+hfbV7MDIysopeiv0MrMdFfcvxrzrRSPeOO1ADcpSdl X-Received: by 10.236.11.80 with SMTP id 56mr3818712yhw.22.1408437985879; Tue, 19 Aug 2014 01:46:25 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.86.176 with SMTP id p45ls2679983qgd.57.gmail; Tue, 19 Aug 2014 01:46:25 -0700 (PDT) X-Received: by 10.52.246.198 with SMTP id xy6mr4728188vdc.7.1408437985787; Tue, 19 Aug 2014 01:46:25 -0700 (PDT) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by mx.google.com with ESMTPS id xk3si4277611vdb.7.2014.08.19.01.46.25 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 19 Aug 2014 01:46:25 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.172 as permitted sender) client-ip=209.85.220.172; Received: by mail-vc0-f172.google.com with SMTP id im17so7051288vcb.17 for ; Tue, 19 Aug 2014 01:46:25 -0700 (PDT) X-Received: by 10.52.148.2 with SMTP id to2mr8448328vdb.38.1408437985704; Tue, 19 Aug 2014 01:46:25 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp220965vcb; Tue, 19 Aug 2014 01:46:25 -0700 (PDT) X-Received: by 10.224.104.1 with SMTP id m1mr65763998qao.81.1408437984902; Tue, 19 Aug 2014 01:46:24 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id b4si28032659qak.69.2014.08.19.01.46.24 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 19 Aug 2014 01:46:24 -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; Received: from localhost ([::1]:49174 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XJf3g-0006BF-Im for patch@linaro.org; Tue, 19 Aug 2014 04:46:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57403) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XJequ-00014G-OW for qemu-devel@nongnu.org; Tue, 19 Aug 2014 04:33:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XJeql-0001aO-R1 for qemu-devel@nongnu.org; Tue, 19 Aug 2014 04:33:12 -0400 Received: from afflict.kos.to ([92.243.29.197]:35158) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XJeql-0001Ym-Kk for qemu-devel@nongnu.org; Tue, 19 Aug 2014 04:33:03 -0400 Received: from afflict.kos.to (afflict [92.243.29.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by afflict.kos.to (Postfix) with ESMTPSA id 50DAB26688; Tue, 19 Aug 2014 10:33:02 +0200 (CEST) From: riku.voipio@linaro.org To: Peter Maydell , qemu-devel@nongnu.org Date: Tue, 19 Aug 2014 11:32:53 +0300 Message-Id: <7ae47eed47f6efd3a9f0838cbd4eaa50dce39bcc.1408436940.git.riku.voipio@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 92.243.29.197 Cc: Tom Musta Subject: [Qemu-devel] [PULL v2 18/23] linux-user: Move get_ppc64_abi 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: riku.voipio@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.172 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Tom Musta The get_ppc64_abi is used to determine the ELF ABI (i.e. V1 or V2). This routine is currently implemented in the linux-user/elfload.c file but is useful in other scenarios. Move the routine to a more generally available location (linux-user/ppc/target_cpu.h). Signed-off-by: Tom Musta Signed-off-by: Riku Voipio --- linux-user/elfload.c | 9 --------- linux-user/ppc/target_cpu.h | 10 ++++++++++ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 60777fe..bea803b 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -824,8 +824,6 @@ static uint32_t get_elf_hwcap2(void) NEW_AUX_ENT(AT_IGNOREPPC, AT_IGNOREPPC); \ } while (0) -static inline uint32_t get_ppc64_abi(struct image_info *infop); - static inline void init_thread(struct target_pt_regs *_regs, struct image_info *infop) { _regs->gpr[1] = infop->start_stack; @@ -1205,13 +1203,6 @@ static inline void init_thread(struct target_pt_regs *regs, struct image_info *i #include "elf.h" -#ifdef TARGET_PPC -static inline uint32_t get_ppc64_abi(struct image_info *infop) -{ - return infop->elf_flags & EF_PPC64_ABI; -} -#endif - struct exec { unsigned int a_info; /* Use macros N_MAGIC, etc for access */ diff --git a/linux-user/ppc/target_cpu.h b/linux-user/ppc/target_cpu.h index 9cc0c3b..26f4ba2 100644 --- a/linux-user/ppc/target_cpu.h +++ b/linux-user/ppc/target_cpu.h @@ -38,4 +38,14 @@ static inline void cpu_set_tls(CPUPPCState *env, target_ulong newtls) #endif } +#ifndef EF_PPC64_ABI +#define EF_PPC64_ABI 0x3 +#endif + +static inline uint32_t get_ppc64_abi(struct image_info *infop) +{ + return infop->elf_flags & EF_PPC64_ABI; +} + + #endif