From nobody Mon Feb 9 20:34:39 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1524700366778623.5574372920579; Wed, 25 Apr 2018 16:52:46 -0700 (PDT) Received: from localhost ([::1]:39572 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fBUDN-00006k-Va for importer@patchew.org; Wed, 25 Apr 2018 19:52:46 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46410) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fBU8S-0004lY-Dr for qemu-devel@nongnu.org; Wed, 25 Apr 2018 19:47:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fBU8R-0004wS-De for qemu-devel@nongnu.org; Wed, 25 Apr 2018 19:47:40 -0400 Received: from mail-pf0-x241.google.com ([2607:f8b0:400e:c00::241]:40914) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fBU8R-0004w3-89 for qemu-devel@nongnu.org; Wed, 25 Apr 2018 19:47:39 -0400 Received: by mail-pf0-x241.google.com with SMTP id f189so7478515pfa.7 for ; Wed, 25 Apr 2018 16:47:39 -0700 (PDT) Received: from localhost.localdomain (122-58-167-38-fibre.bb.spark.co.nz. [122.58.167.38]) by smtp.gmail.com with ESMTPSA id e10sm29577549pfn.67.2018.04.25.16.47.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 25 Apr 2018 16:47:37 -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=lepc8zxluVMM0oaA5K69awM+nhvND7fLI/yHNZqc2GU=; b=eCOKRUss36LPiGZwoduE25Nimd98vNsOekFgs3zAnEOvMPAD5KJBFrFxR5DJ+MxQvz y3ZwcPtMm6XPBoe9eLxqEUMDtgKLbw/7uxIxKiM1XVRzRsm95cGkWx5AA7vALrPgTcX0 5VBvxQupXt6KGZruCDeLusy/Dycb/Fcz6yzRtqbjvQ03ocFuAYuCSe+NEUb8TtLqXEbm vXM54gsogAleQaG8Wxpm1B2kajkWfEqLLNWT20FoByxrlPolMTppykcVgh14COFWueYJ XUE+iHU9fhAMv2ptbvWvzlf3gJABEheUazuEHbIsW1N+E1CvnMtCm6ZIrEyXlRXrHRkZ oihA== 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=lepc8zxluVMM0oaA5K69awM+nhvND7fLI/yHNZqc2GU=; b=YBEyXtHkgSwWn7Ar5wLGGO1nqNgHHNgEIuOEEMQu/1pCKi9XWifCNfpNyTACesevZU lwLRfYfVECzHsKxDtwHg9Nyl9w/JuBNDpWFxBsr+iifB2+GiESPvPmSgN+8ygduv2qzS uh5oEeDQMx4WigoVqKHY+R1yVMa92dBKjB/yiwtMY6lVl5FRu3cPJFzfA9g1BXd7IDmj FUOif4cKxMGJI29L0keTVMA9VuH4u8HY+mO32xKFFZLmw5PEEKl1YosnC7IIRPEvr1sl fCvr8ZdfZEkkwAl1WYUcMOs4BJnxbdvObU85fIjlxyPU2nqRkuZlmMvMvs+KeJaDu2Zz OchQ== X-Gm-Message-State: ALQs6tCS7LWb1Giyf0bXjTLlgb2C8VacKqHkQwQ+udPPCr5Zt/h5T32/ FuVM4cu8gr3mBJpCsooFIe8jFoB4g8A= X-Google-Smtp-Source: AIpwx4+29ZTIVFLFxPO/gcUAxt9yCFgy4c6GB+Qpfu2vmCpjpznHTbFhaULpbjDa0FaUoNEYjDZWvA== X-Received: by 10.99.96.202 with SMTP id u193mr20389299pgb.197.1524700058248; Wed, 25 Apr 2018 16:47:38 -0700 (PDT) From: Michael Clark To: qemu-devel@nongnu.org Date: Thu, 26 Apr 2018 11:45:12 +1200 Message-Id: <1524699938-6764-10-git-send-email-mjc@sifive.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1524699938-6764-1-git-send-email-mjc@sifive.com> References: <1524699938-6764-1-git-send-email-mjc@sifive.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::241 Subject: [Qemu-devel] [PATCH v8 09/35] 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 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=C3=A9 Reviewed-by: Alistair Francis --- 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) =20 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 2412b5d..115618b 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) =20 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 f370f12..3f6bd0a 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; =20 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 782996c..090befe 100644 --- a/hw/riscv/virt.c +++ b/hw/riscv/virt.c @@ -68,7 +68,7 @@ static uint64_t load_kernel(const char *kernel_filename) =20 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 41e06ac..9871e6f 100644 --- a/target/riscv/cpu.h +++ b/target/riscv/cpu.h @@ -34,7 +34,6 @@ =20 #define TCG_GUEST_DEFAULT_MO 0 =20 -#define ELF_MACHINE EM_RISCV #define CPUArchState struct CPURISCVState =20 #include "qemu-common.h" --=20 2.7.0