From patchwork Wed Aug 13 19:04:44 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Musta X-Patchwork-Id: 379728 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id D2ADE1400B2 for ; Thu, 14 Aug 2014 05:11:59 +1000 (EST) Received: from localhost ([::1]:49721 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XHdxl-0006qp-MW for incoming@patchwork.ozlabs.org; Wed, 13 Aug 2014 15:11:57 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55085) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XHds6-0005gG-29 for qemu-devel@nongnu.org; Wed, 13 Aug 2014 15:06:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XHdrx-0004U2-1O for qemu-devel@nongnu.org; Wed, 13 Aug 2014 15:06:05 -0400 Received: from mail-oa0-x229.google.com ([2607:f8b0:4003:c02::229]:55499) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XHdrw-0004Tr-TW; Wed, 13 Aug 2014 15:05:56 -0400 Received: by mail-oa0-f41.google.com with SMTP id j17so153290oag.14 for ; Wed, 13 Aug 2014 12:05:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=j+1Cf+PEfcW0tA3ysXTK53ScPt68kZBop+9rOrgctBU=; b=JMqdQqvYMpEfmpnrG4tZaQ8UtG2MRKloKLwMyfewvHQZAf2luptNum9ERH6+IXKhEy mR7IhcIIswuv2Ma0eO5PrNTSKDat9/zkLVaX70UzTiesirhdjkFnAk0h7SyWe02+fjgp WXA3Gshq6hX3RBRVlaXJZyBbczPPT7t1dNgfkRGgpd0NnT1QJDJ6P6xJtPV0jN5QA1up tPI2GFUxPiTOuMUyxO2nG6yVnaL3sF82oI9P3gy5OTzL1/Y3X26bEE0neydPKsHYk7sP NnQTkgBvIdcyQCR1hkn52IjWRJh4lWtHddQObAtsiDo1v/JsLir6+1iQQt5lUGLoXfjH s9aw== X-Received: by 10.182.245.135 with SMTP id xo7mr6906685obc.23.1407956756460; Wed, 13 Aug 2014 12:05:56 -0700 (PDT) Received: from tmusta-sc.rchland.ibm.com (rchp4.rochester.ibm.com. [129.42.161.36]) by mx.google.com with ESMTPSA id ej4sm3032727obb.28.2014.08.13.12.05.51 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 13 Aug 2014 12:05:55 -0700 (PDT) From: Tom Musta To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org Date: Wed, 13 Aug 2014 14:04:44 -0500 Message-Id: <1407956688-16006-10-git-send-email-tommusta@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1407956688-16006-1-git-send-email-tommusta@gmail.com> References: <1407956688-16006-1-git-send-email-tommusta@gmail.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4003:c02::229 Cc: Tom Musta , riku.voipio@linaro.org, agraf@suse.de Subject: [Qemu-devel] [V3 PATCH 09/13] 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 --- V3: new patch 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