From patchwork Mon May 11 06:29:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Crosthwaite X-Patchwork-Id: 470643 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 89FD314010F for ; Mon, 11 May 2015 16:53:16 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=khxeRgrc; dkim-atps=neutral Received: from localhost ([::1]:35769 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YrhaU-0006Lj-PD for incoming@patchwork.ozlabs.org; Mon, 11 May 2015 02:53:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60023) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YrhIT-0008Ex-JJ for qemu-devel@nongnu.org; Mon, 11 May 2015 02:34:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YrhDx-000300-N6 for qemu-devel@nongnu.org; Mon, 11 May 2015 02:29:59 -0400 Received: from mail-pa0-x229.google.com ([2607:f8b0:400e:c03::229]:34592) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YrhDx-0002zu-Fs for qemu-devel@nongnu.org; Mon, 11 May 2015 02:29:57 -0400 Received: by pacyx8 with SMTP id yx8so102169901pac.1 for ; Sun, 10 May 2015 23:29: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 :in-reply-to:references; bh=yvNdDdZyU4KXj75T+DIY+kmQN4o4snt77mYiPJ+63ag=; b=khxeRgrc4nZdhvfJuqI4l8O9huacvLObxgCjfFPTN8LSjDoypGR9KLLIreHYWt1BV7 fRoXF2WfWVCpwHAAV9vpqEkJboNJL45P25sdEG4uEnMO74NTSZY+5nfSEANQixCgE4tE RZDxd01NrJo5ic6e8NOCjlo2FPStaX/s2sRgUgydOjAV4Sm/SGxaCnr6r7QPaBSp7b93 /Iok079QDlwVfWehoE09pWuK45hQagpwMmYhKtd9FU63szwWRmm62mjOLxGlkrATg2ja tgZtOM5rWHNfD4SvD3omsb48NFQy8rfgJDBOILhOBWudBLAEwuHqd103TKImujAgFIcf ERkA== X-Received: by 10.66.188.107 with SMTP id fz11mr16757450pac.85.1431325796845; Sun, 10 May 2015 23:29:56 -0700 (PDT) Received: from pcrost-laptop.hsd1.ca.comcast.net (c-24-5-157-48.hsd1.ca.comcast.net. [24.5.157.48]) by mx.google.com with ESMTPSA id pw9sm11935481pac.27.2015.05.10.23.29.55 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 10 May 2015 23:29:56 -0700 (PDT) From: Peter Crosthwaite X-Google-Original-From: Peter Crosthwaite To: qemu-devel@nongnu.org Date: Sun, 10 May 2015 23:29:10 -0700 Message-Id: <7d5b1f104fd5a573a545e54e6419bd0cf1090c79.1431322749.git.crosthwaite.peter@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400e:c03::229 Cc: peter.maydell@linaro.org, edgari@xilinx.com, sorenb@xilinx.com, afaerber@suse.de, rth@twiddle.net Subject: [Qemu-devel] [RFC PATCH 07/34] mb: Remove ELF_MACHINE from cpu.h 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 only generic code relying on this is linux-user. Linux user already has a lot of #ifdef TARGET_ customisation so just define ELF_MACHINE locally there. The microblaze bootloader can just pass EM_MICROBLAZE directly, as that is architecture specific code. This remove another architecture specific definition from the global namespace. Signed-off-by: Peter Crosthwaite --- hw/microblaze/boot.c | 4 ++-- linux-user/elfload.c | 1 + target-microblaze/cpu.h | 2 -- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/hw/microblaze/boot.c b/hw/microblaze/boot.c index 4c44317..b3d7c99 100644 --- a/hw/microblaze/boot.c +++ b/hw/microblaze/boot.c @@ -140,12 +140,12 @@ void microblaze_load_kernel(MicroBlazeCPU *cpu, hwaddr ddr_base, /* Boots a kernel elf binary. */ kernel_size = load_elf(kernel_filename, NULL, NULL, &entry, &low, &high, - big_endian, ELF_MACHINE, 0); + big_endian, EM_MICROBLAZE, 0); base32 = entry; if (base32 == 0xc0000000) { kernel_size = load_elf(kernel_filename, translate_kernel_address, NULL, &entry, NULL, NULL, - big_endian, ELF_MACHINE, 0); + big_endian, EM_MICROBLAZE, 0); } /* Always boot into physical ram. */ boot_info.bootstrap_pc = (uint32_t)entry; diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 0ba9706..de7fe14 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -945,6 +945,7 @@ static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUMIPSState *e #ifdef TARGET_MICROBLAZE #define ELF_START_MMAP 0x80000000 +#define ELF_MACHINE EM_MICROBLAZE #define elf_check_arch(x) ( (x) == EM_MICROBLAZE || (x) == EM_MICROBLAZE_OLD) diff --git a/target-microblaze/cpu.h b/target-microblaze/cpu.h index ba02a87..7030123 100644 --- a/target-microblaze/cpu.h +++ b/target-microblaze/cpu.h @@ -34,8 +34,6 @@ typedef struct CPUMBState CPUMBState; #include "mmu.h" #endif -#define ELF_MACHINE EM_MICROBLAZE - #define MB_EXCP_MMU 1 #define MB_EXCP_IRQ 2 #define MB_EXCP_BREAK 3