From patchwork Wed Mar 21 20:46:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Clark X-Patchwork-Id: 10300417 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 7AD2860386 for ; Wed, 21 Mar 2018 21:07:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 65AC929849 for ; Wed, 21 Mar 2018 21:07:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5A8E929876; Wed, 21 Mar 2018 21:07:12 +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 03E4529873 for ; Wed, 21 Mar 2018 21:07:11 +0000 (UTC) Received: from localhost ([::1]:57462 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eykww-0003JH-9j for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Mar 2018 17:07:10 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53142) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eykeT-00026H-Re for qemu-devel@nongnu.org; Wed, 21 Mar 2018 16:48:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eykeS-000294-P0 for qemu-devel@nongnu.org; Wed, 21 Mar 2018 16:48:05 -0400 Received: from mail-pf0-x243.google.com ([2607:f8b0:400e:c00::243]:34030) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eykeS-00028p-Iu for qemu-devel@nongnu.org; Wed, 21 Mar 2018 16:48:04 -0400 Received: by mail-pf0-x243.google.com with SMTP id j20so2466288pfi.1 for ; Wed, 21 Mar 2018 13:48:04 -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=DBArUN2zNPrlfhOX4s8VXPo43Ha+iCkpoiKJ0l2eNFQ=; b=CkaH/6EcpYbqDPcOpjaPBVLVS1+H4wjpmvD5W5wwHGLObKJBR1Uf564l4FVOXFH6ia P/q0YnPOFRkU8OfX0LSxnyLqGs44aDm91EJIZ9wyxWGXhImwuFNkrb2PCrHwFdqmgaV6 +4vkZrgdaj0cnz+wuCfuWqBriEwnDWxr5mpKbTNea1HPgLpZM4hDV5Xnndz9haurP7O3 DojuD4gzD3hlDEhJ1kpYqwDUsAyB2n9joMKqfOrAlzll1zka/2HxUN/1ig+++KoEgtfN 1tkxBTQAVhWoh2iKyzInRN5ngQu6z1BANh0ROBGSPF2N5Fa/ciR6B0i0JjBEw3RNttKw DsUQ== 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=DBArUN2zNPrlfhOX4s8VXPo43Ha+iCkpoiKJ0l2eNFQ=; b=qxJd/CT3Sl2oJYFJ1bQQSzRDZCht5A+So3GW4IZiuJO+Tp1QyHZzE+Z4XNjbm8RkMv 0XFhKR+8m736iKd1wQi/nR6R/A4639EQMIN0wh8N8SorASPKnr0aMPf9b22t9WKxQphQ /CTym7qBgdcE3uCtLxaNx32LgrK+Z0EAfvJ3LJNHKPR5dnEw4Pyi9wlTu5M8gegNP3mz TPNeYjhwAcWCHOeDUuAghXQ5yH2YN36LsIpFW6dYhXqIRvZnpJ8StmASXDPxp0I4zQ8e xnKmGR1gu7qGjRcdxdcINeihvRrTBcN73GeBOPfoSrm3a9lGdq+46Oc+lzrGtjftOoyP QEuw== X-Gm-Message-State: AElRT7HSuFaWcM2VyIqQfcmnt0GCSWljp5ocSmodOSUfuPKawEEUeVpz 5poTIqhToAbVd8CV+q/9cwXGRYuRcSg= X-Google-Smtp-Source: AG47ELuOHVyleUKqUQixHq/4cHmR2XIoyjBJ+s1D5vP4NXcFN4q4nu6DNQT9v8yAqLZ8Y+9+i98hqw== X-Received: by 10.99.100.196 with SMTP id y187mr3689151pgb.83.1521665283514; Wed, 21 Mar 2018 13:48:03 -0700 (PDT) Received: from monty.com ([12.206.222.5]) by smtp.gmail.com with ESMTPSA id w10sm8244499pgr.57.2018.03.21.13.48.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 21 Mar 2018 13:48:03 -0700 (PDT) From: Michael Clark To: qemu-devel@nongnu.org Date: Wed, 21 Mar 2018 13:46:51 -0700 Message-Id: <1521665220-3869-16-git-send-email-mjc@sifive.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1521665220-3869-1-git-send-email-mjc@sifive.com> References: <1521665220-3869-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] [PULL 15/24] 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 1fdcd75..1dcbdbe 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"