From patchwork Mon Mar 19 21:18:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Clark X-Patchwork-Id: 10295211 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2781D602C2 for ; Mon, 19 Mar 2018 21:26:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 13AE229432 for ; Mon, 19 Mar 2018 21:26:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0840D29449; Mon, 19 Mar 2018 21:26:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 754BC29432 for ; Mon, 19 Mar 2018 21:26:57 +0000 (UTC) Received: from localhost ([::1]:44016 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ey2Iy-0007nK-Kh for patchwork-qemu-devel@patchwork.kernel.org; Mon, 19 Mar 2018 17:26:56 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33316) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ey2CD-0001SP-O4 for qemu-devel@nongnu.org; Mon, 19 Mar 2018 17:20:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ey2CC-0002iH-C1 for qemu-devel@nongnu.org; Mon, 19 Mar 2018 17:19:57 -0400 Received: from mail-pf0-x243.google.com ([2607:f8b0:400e:c00::243]:45126) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ey2CC-0002hr-76 for qemu-devel@nongnu.org; Mon, 19 Mar 2018 17:19:56 -0400 Received: by mail-pf0-x243.google.com with SMTP id l27so3030804pfk.12 for ; Mon, 19 Mar 2018 14:19:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JjGyplqqVlE4UQ9tNmqboa5lGCOAOgUeBOIRDmEp87s=; b=Ymnwap0L7OFjuUGBNuk5Eh7+6cSDJh2s/GQIE6qrFVgoB8G90t9Vvjj2azg6nvYpb+ Fp+ZnKSRTJJxPUbFBaZSnac1Y4nBmXalh3ZMmlxxzfnnAeBw1wGuV7tumDR/0S/gsgiS MQEpMIOevAKBfvJ2w4U7263IKU7hXIVhO109BbiDgPmPSA+L+WvyA49xV2+F0XOZhHkg 9iCHRUPpYYKP8NaztfFQehvnwHqbSzeUDRRLnJ66bButRuDesHTcJImFWa8i2qcr8CPr JpqDXrcWTOuDdWCSlHds9U5NsbtEp3K3sSp5kgDnBXSNWI0O3pc+mhLZcMsRvRFpIMeI tY7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JjGyplqqVlE4UQ9tNmqboa5lGCOAOgUeBOIRDmEp87s=; b=QLbb84JMJCUCDvk5Yh84WqJXNTbJgSLfK2OW8JHHuSvfY64inrYeNiGG63grzA93iE YeUXjrtOz13PJx28sQgU3KgsxY2Tr5DcttPE2OaOBRcObWW4Yavl07Exn+UtcHORhVdT 2lIQfW27YP80itpCZP2KPaKH5rqh3D3mHJdY7XdXxrYGU8kKJ3LmlET6brq2bQ9ImOGk EEwn4KosNploLrIT9f42BTpg89yqEayvUyuT2UxZLk0agqipjR0Q70rOXrov6Huf5/Lx GYYsvRKX8Slm6ClZukUKsUx2UdqQ0PxNJMHFsAhN5eMZ7t+UrD/zpkVUOz0jMwwy6COe XfzQ== X-Gm-Message-State: AElRT7GXzvvKpVeZS7pepof33RWLtsOT2QUxt2mxsK/i6Das3+FDIkbd MJ30QgejddRUz+CsVt/ajdoriMlcA54= X-Google-Smtp-Source: AG47ELv5IUZqQ1WbTupUWTGI8AJgzH1u8lPdzj30z7JezSMCeMUncwTmG+svHlkAr3A8QnWlhZFFLA== X-Received: by 10.99.186.72 with SMTP id l8mr10420116pgu.410.1521494395249; Mon, 19 Mar 2018 14:19:55 -0700 (PDT) Received: from monty.com ([12.206.222.5]) by smtp.gmail.com with ESMTPSA id i127sm120500pfc.136.2018.03.19.14.19.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 19 Mar 2018 14:19:54 -0700 (PDT) From: Michael Clark To: qemu-devel@nongnu.org Date: Mon, 19 Mar 2018 14:18:39 -0700 Message-Id: <1521494329-19546-17-git-send-email-mjc@sifive.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1521494329-19546-1-git-send-email-mjc@sifive.com> References: <1521494329-19546-1-git-send-email-mjc@sifive.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::243 Subject: [Qemu-devel] [PATCH v4 16/26] RISC-V: Remove EM_RISCV ELF_MACHINE indirection X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: patches@groups.riscv.org, Michael Clark , Palmer Dabbelt , Sagar Karandikar , Bastian Koppelmann Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Pointless indirection. Other ports use EM_ constants directly. Cc: Sagar Karandikar Cc: Bastian Koppelmann Signed-off-by: Michael Clark Signed-off-by: Palmer Dabbelt Reviewed-by: Philippe Mathieu-Daudé --- hw/riscv/sifive_e.c | 2 +- hw/riscv/sifive_u.c | 2 +- hw/riscv/spike.c | 2 +- hw/riscv/virt.c | 2 +- target/riscv/cpu.h | 1 - 5 files changed, 4 insertions(+), 5 deletions(-) diff --git a/hw/riscv/sifive_e.c b/hw/riscv/sifive_e.c index 4872b68..39e4cb4 100644 --- a/hw/riscv/sifive_e.c +++ b/hw/riscv/sifive_e.c @@ -88,7 +88,7 @@ static uint64_t load_kernel(const char *kernel_filename) if (load_elf(kernel_filename, NULL, NULL, &kernel_entry, NULL, &kernel_high, - 0, ELF_MACHINE, 1, 0) < 0) { + 0, EM_RISCV, 1, 0) < 0) { error_report("qemu: could not load kernel '%s'", kernel_filename); exit(1); } diff --git a/hw/riscv/sifive_u.c b/hw/riscv/sifive_u.c index 57b4f4f..0e633a0 100644 --- a/hw/riscv/sifive_u.c +++ b/hw/riscv/sifive_u.c @@ -74,7 +74,7 @@ static uint64_t load_kernel(const char *kernel_filename) if (load_elf(kernel_filename, NULL, NULL, &kernel_entry, NULL, &kernel_high, - 0, ELF_MACHINE, 1, 0) < 0) { + 0, EM_RISCV, 1, 0) < 0) { error_report("qemu: could not load kernel '%s'", kernel_filename); exit(1); } diff --git a/hw/riscv/spike.c b/hw/riscv/spike.c index c7d937b..70e697c 100644 --- a/hw/riscv/spike.c +++ b/hw/riscv/spike.c @@ -64,7 +64,7 @@ static uint64_t load_kernel(const char *kernel_filename) uint64_t kernel_entry, kernel_high; if (load_elf_ram_sym(kernel_filename, NULL, NULL, - &kernel_entry, NULL, &kernel_high, 0, ELF_MACHINE, 1, 0, + &kernel_entry, NULL, &kernel_high, 0, EM_RISCV, 1, 0, NULL, true, htif_symbol_callback) < 0) { error_report("qemu: could not load kernel '%s'", kernel_filename); exit(1); diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c index d680cbd..e3f8bb7 100644 --- a/hw/riscv/virt.c +++ b/hw/riscv/virt.c @@ -68,7 +68,7 @@ static uint64_t load_kernel(const char *kernel_filename) if (load_elf(kernel_filename, NULL, NULL, &kernel_entry, NULL, &kernel_high, - 0, ELF_MACHINE, 1, 0) < 0) { + 0, EM_RISCV, 1, 0) < 0) { error_report("qemu: could not load kernel '%s'", kernel_filename); exit(1); } diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h index 3a0ca2f..7c4482b 100644 --- a/target/riscv/cpu.h +++ b/target/riscv/cpu.h @@ -34,7 +34,6 @@ #define TCG_GUEST_DEFAULT_MO 0 -#define ELF_MACHINE EM_RISCV #define CPUArchState struct CPURISCVState #include "qemu-common.h"