From patchwork Fri Aug 15 11:01:37 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 35449 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oi0-f70.google.com (mail-oi0-f70.google.com [209.85.218.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7FA01203C5 for ; Fri, 15 Aug 2014 11:14:10 +0000 (UTC) Received: by mail-oi0-f70.google.com with SMTP id u20sf11694753oif.1 for ; Fri, 15 Aug 2014 04:14:10 -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=MYvAbkBb9dLmbRNzSgPWUvJ+5sEdOhjiea7NwnpYbRbzd5CMw2i/PAbGpXkFIprrtG a/zWAxdBEv4KW4hJdj0qsicQ34fn83GfpZVtoaoyE9fkAFrk0UKuZUT27umcF/jj7dAe tRBSwLZm3cgRp8hvRcYRRUntj0rLFCy81QKWr1B1ctBPUR4SRu/Yr3Q5Q7l1pyWmJf8m zu7Kx3vM4T/NyK2UskMuPF0lMuEaf6njMlM5L8uuNww2REJArsXeiF1I8jMTEGGq3uRq 3ZreWrcL7gWLOPKu5gTtjpOoZK/P6fngEgq07IycjJFPYAC26un3KMMMinTdPl2jyEyu 5oHA== X-Gm-Message-State: ALoCoQkEXW5mBLGzrlsmDHbFjl2sDXM9mzHtr7pwiqQQFV9okzrXjp5w9CMcwflAMTUKMLZV4vNu X-Received: by 10.182.142.5 with SMTP id rs5mr8212795obb.15.1408101250157; Fri, 15 Aug 2014 04:14:10 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.101.6 with SMTP id t6ls1370372qge.32.gmail; Fri, 15 Aug 2014 04:14:10 -0700 (PDT) X-Received: by 10.224.166.195 with SMTP id n3mr23906895qay.22.1408101250053; Fri, 15 Aug 2014 04:14:10 -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 o1si6723778qce.33.2014.08.15.04.14.10 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 15 Aug 2014 04:14:10 -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 hq11so2787743vcb.30 for ; Fri, 15 Aug 2014 04:14:09 -0700 (PDT) X-Received: by 10.220.97.5 with SMTP id j5mr9771552vcn.16.1408101249861; Fri, 15 Aug 2014 04:14:09 -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 tc5csp104672vcb; Fri, 15 Aug 2014 04:14:09 -0700 (PDT) X-Received: by 10.140.88.41 with SMTP id s38mr24606856qgd.73.1408101249392; Fri, 15 Aug 2014 04:14:09 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id n12si11373974qae.42.2014.08.15.04.14.09 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 15 Aug 2014 04:14:09 -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]:58685 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XIFSS-0008U2-Ul for patch@linaro.org; Fri, 15 Aug 2014 07:14:08 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39484) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XIFGh-0004xS-72 for qemu-devel@nongnu.org; Fri, 15 Aug 2014 07:02:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XIFGV-000734-1P for qemu-devel@nongnu.org; Fri, 15 Aug 2014 07:01:59 -0400 Received: from [2001:4b98:dc0:45:216:3eff:fe3d:166f] (port=44501 helo=afflict.kos.to) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XIFGU-00071W-Sd for qemu-devel@nongnu.org; Fri, 15 Aug 2014 07:01:46 -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 49C322668B; Fri, 15 Aug 2014 13:01:45 +0200 (CEST) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Fri, 15 Aug 2014 14:01:37 +0300 Message-Id: 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: Peter Maydell , Tom Musta Subject: [Qemu-devel] [PULL 19/24] 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