From patchwork Fri Mar 9 04:12:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Clark X-Patchwork-Id: 10269655 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 2E46F60236 for ; Fri, 9 Mar 2018 04:25:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 18CCA29C70 for ; Fri, 9 Mar 2018 04:25:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0CCB429CB5; Fri, 9 Mar 2018 04:25:10 +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 91CAB29C70 for ; Fri, 9 Mar 2018 04:25:09 +0000 (UTC) Received: from localhost ([::1]:43154 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eu9ae-0004Sr-Q3 for patchwork-qemu-devel@patchwork.kernel.org; Thu, 08 Mar 2018 23:25:08 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55847) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eu9Qp-0004Q6-MJ for qemu-devel@nongnu.org; Thu, 08 Mar 2018 23:15:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eu9Qo-00075X-HQ for qemu-devel@nongnu.org; Thu, 08 Mar 2018 23:14:59 -0500 Received: from mail-pl0-x241.google.com ([2607:f8b0:400e:c01::241]:45129) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eu9Qo-00075E-AY for qemu-devel@nongnu.org; Thu, 08 Mar 2018 23:14:58 -0500 Received: by mail-pl0-x241.google.com with SMTP id v9-v6so4592915plp.12 for ; Thu, 08 Mar 2018 20:14:58 -0800 (PST) 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; bh=+j/SSPlOst+oGGxyEGnpDqo/DJyW8hLnCdpp96OtkQY=; b=IMz19Uea7uOdkFGlvS33rrui0KJfAJp2P8y4GtRKM36ZEIFLY/W2+RypqgloeX/+O7 R4irzBcTMoDcwQzdKAmIlFYIVAmG+c8lKL5IJyH9MQKuLE7wFRE3a/vsnW3eGgC9MHTV kTVXavrMcFLOXdoEex8SLpjXS0an/3BCHa0Lv6c5CbjB1ykKHl2AwuU/Vg0lFZUwBSgE QxfWiZPKS7F5hjBGmSO4yQsuYlC/kWtFy7CDn5jfm6kSlOZ10sFMtF45PEdeswtPNjNu xtAUkI7la22OkuK2nrVIwfVNpVqTky1X1M3hVy4qIwl3PxnyCbwCNWPfI1vZzEDbHr7b KjAw== 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; bh=+j/SSPlOst+oGGxyEGnpDqo/DJyW8hLnCdpp96OtkQY=; b=miJUthOOYPaXhoVa7Vd3Aem3QZ/esHfx4T+sqKIRt/UsxH/J4nGkjEj4f35cyJQPXf 913LrO958/Ql2IxjoxTITC0ONTiWmRk3by1Pb49ZZC4JSRNuBujHNgQg9aEfgGz+BNd3 k6Gr3ab8FNYLhFuNGBLToYs67BjIPj4Yuz1LBl+7hF5OO74/nwYkgSKHFisYDiZ/jJ4+ a9iFVkbwkb8hiVCbPPf0RDu/GcSyo6L3vo9bmBi3BgFqsUAO8kcauwhlonzaa0iFRDVf 23+UiC2t3vAdZJVaVIzkINfARUZsS2RiELYdijmq8RU8xhOPud7QVF4S+DxR4ABKYPhn SBsA== X-Gm-Message-State: AElRT7Ep9MTlBf59winvY117UKINY0X5FXXHAsX/IbDG2zSsw9C1agqb CSZ7fzsXjkLTNwigNbPPSQopPezOUdE= X-Google-Smtp-Source: AG47ELszQXZejrgsS8awPNq82lN9PLtcrmrWsw/gHo6nhuG/5vA9WbY7ICePbYA9cgIqIjAkZaIung== X-Received: by 2002:a17:902:70c5:: with SMTP id l5-v6mr6296713plt.13.1520568897380; Thu, 08 Mar 2018 20:14:57 -0800 (PST) Received: from localhost.localdomain (125-237-39-90-fibre.bb.spark.co.nz. [125.237.39.90]) by smtp.gmail.com with ESMTPSA id h15sm334141pfi.56.2018.03.08.20.14.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 08 Mar 2018 20:14:56 -0800 (PST) From: Michael Clark To: qemu-devel@nongnu.org Date: Fri, 9 Mar 2018 17:12:38 +1300 Message-Id: <1520568765-58189-17-git-send-email-mjc@sifive.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1520568765-58189-1-git-send-email-mjc@sifive.com> References: <1520568765-58189-1-git-send-email-mjc@sifive.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c01::241 Subject: [Qemu-devel] [PATCH v2 16/23] 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: Bastian Koppelmann , Michael Clark , Palmer Dabbelt , Sagar Karandikar 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"