From patchwork Fri Aug 22 13:24:35 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 35818 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 345F320540 for ; Fri, 22 Aug 2014 13:39:04 +0000 (UTC) Received: by mail-yh0-f71.google.com with SMTP id 29sf35163412yhl.6 for ; Fri, 22 Aug 2014 06:39:04 -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=keQdoYZSKqsY5kiBLuvAfnBInN2Te9PfqayGkVj1uuY2CUFZ1g1mcDSiapz2JL4iZ5 w5hxq/qMsx6tm6YiSWB4QAQK/gq+sDAdywJK9ijj1p3bJoEeXn92mV2QYiyldQeg93U8 KZ2ctNzlhqig72E04KzQPk110Pvn6SflHMfvx6CiW9EkAGvr51W6Mv0KlkcXz7GMB3y4 HhtqmJyEFt0pZkjaSjs4MWfdBrYTrUz+OtITkZb6svNW0j0t88AkHhn+6gyRpVIDAEoY HEejH2vFEcwE8pEecPJuh7xAD9gIL69H/tWGl1Hkp8462ZBGRLtmpgJPIfMoAytCMcV6 Hy1g== X-Gm-Message-State: ALoCoQkYc0duZ3+Nd2iw0ZtgJlziTIU0odB1sZXNOpiUaHmqIOzsT1Hj+6qwxSA4hs3ihkkbe03v X-Received: by 10.236.15.3 with SMTP id e3mr8562920yhe.50.1408714744025; Fri, 22 Aug 2014 06:39:04 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.49.235 with SMTP id q98ls1190264qga.91.gmail; Fri, 22 Aug 2014 06:39:03 -0700 (PDT) X-Received: by 10.52.51.203 with SMTP id m11mr80870vdo.72.1408714743934; Fri, 22 Aug 2014 06:39:03 -0700 (PDT) Received: from mail-vc0-f171.google.com (mail-vc0-f171.google.com [209.85.220.171]) by mx.google.com with ESMTPS id yv6si13569589vdb.91.2014.08.22.06.39.03 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 22 Aug 2014 06:39:03 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.171 as permitted sender) client-ip=209.85.220.171; Received: by mail-vc0-f171.google.com with SMTP id hq11so12333403vcb.16 for ; Fri, 22 Aug 2014 06:39:03 -0700 (PDT) X-Received: by 10.220.166.68 with SMTP id l4mr4114358vcy.20.1408714743857; Fri, 22 Aug 2014 06:39:03 -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.45.67 with SMTP id uj3csp17674vcb; Fri, 22 Aug 2014 06:39:03 -0700 (PDT) X-Received: by 10.140.48.234 with SMTP id o97mr7834048qga.10.1408714743242; Fri, 22 Aug 2014 06:39:03 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id e108si42314976qga.5.2014.08.22.06.39.03 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 22 Aug 2014 06:39: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; Received: from localhost ([::1]:37205 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XKp3W-0001d6-PR for patch@linaro.org; Fri, 22 Aug 2014 09:39:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55471) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XKops-0006c6-64 for qemu-devel@nongnu.org; Fri, 22 Aug 2014 09:25:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XKoph-0002Cx-8T for qemu-devel@nongnu.org; Fri, 22 Aug 2014 09:24:56 -0400 Received: from [2001:4b98:dc0:45:216:3eff:fe3d:166f] (port=54482 helo=afflict.kos.to) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XKoph-0002Bt-2Q for qemu-devel@nongnu.org; Fri, 22 Aug 2014 09:24:45 -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 41465265A9; Fri, 22 Aug 2014 15:24:43 +0200 (CEST) From: riku.voipio@linaro.org To: Peter Maydell , qemu-devel@nongnu.org Date: Fri, 22 Aug 2014 16:24:35 +0300 Message-Id: <67d6d829cdc4e76f64162e6ba8861ee527987bd5.1408712881.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: 2001:4b98:dc0:45:216:3eff:fe3d:166f Cc: Tom Musta Subject: [Qemu-devel] [PULL v3 17/22] 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.171 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