From patchwork Sun Nov 25 23:38:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 151944 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp4943426ljp; Sun, 25 Nov 2018 15:38:42 -0800 (PST) X-Google-Smtp-Source: AFSGD/XdcMjBTy8oTwDWF3f4WqMJ+bfB4OYqoqjmG6C/yQdB7zmJ565OqA05eQBcvwZwjvEaUDvA X-Received: by 2002:a25:7804:: with SMTP id t4-v6mr24970010ybc.385.1543189122353; Sun, 25 Nov 2018 15:38:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543189122; cv=none; d=google.com; s=arc-20160816; b=Fyn6uImh9oHgapVXGbhZDD0I8nHLJqvGw0BSj9JKO8bbsmps3RbyAwy1JHSZ7z0Ax9 oKQvXHuxny4lwRAamrb+AF20S47TiFcrSNeevj7EiTkrmcEKq5a4lDowqfZbmT/lmkhr fpEw+98tW4WuPK2MPNz4V9HWlpN2fpaJGlqz29n41eaFd8ZaGf502BWZ0M/XAWyyCwbH NLOIrl0UWpeH96p0oCDBJXpxIqyF9S7MgF4d/LjU6/YAv/X/VpSHEupxeLe/xD/ML3um hdsxR7Hfz5hTk9RX6jUNFciq7KSPifTvJQsJCapXWQjCEa7+xnTww6erhmvEZBScveEY IQ+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:references:in-reply-to:message-id:date:subject :to:from; bh=mChAYVaZO4JuElon9TVxJpNg8tyEAx+6vr7dV1mMFaQ=; b=pN+R5BHgdywmrKHgfiqGne1EjtO+OwlvppiYWn11riwrI1Pimc5sjzJMUaTcbzuaWU fjIHmUKf/KJ4UHIUek46R9DKRKScrTY9roXUgmVVpXXiKrA+yWhxYChNlQqy58YYiowd 8UQ6QdjEIrB32jg8J00ORXBs7PUELzIoNGXEPHYJxUwSw8XhZGPOpD6Vd3jxRVGoupOi 0qWVPThiUWNSsdWIs+Es0lK8XyTX1KtuPaAiV85uuAqOlM/mQt3o/nk+pb+/L6h2v10h 64acleCPpCDz40sfkR02n0F5hS5Bf7XlO9gsQ45f8bGuGCITJaXy5Pvd3qQu2m11lBla MOIw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of grub-devel-bounces+patch=linaro.org@gnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="grub-devel-bounces+patch=linaro.org@gnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id y135si24993736ywy.308.2018.11.25.15.38.42 for (version=TLS1 cipher=AES128-SHA bits=128/128); Sun, 25 Nov 2018 15:38:42 -0800 (PST) Received-SPF: pass (google.com: domain of grub-devel-bounces+patch=linaro.org@gnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; spf=pass (google.com: domain of grub-devel-bounces+patch=linaro.org@gnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="grub-devel-bounces+patch=linaro.org@gnu.org" Received: from localhost ([::1]:33461 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gR3z7-0000zE-LI for patch@linaro.org; Sun, 25 Nov 2018 18:38:41 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52664) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gR3yq-0000yD-85 for grub-devel@gnu.org; Sun, 25 Nov 2018 18:38:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gR3yo-0008V2-9R for grub-devel@gnu.org; Sun, 25 Nov 2018 18:38:24 -0500 Received: from mx2.suse.de ([195.135.220.15]:49614 helo=mx1.suse.de) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gR3yo-0008UA-1w for grub-devel@gnu.org; Sun, 25 Nov 2018 18:38:22 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 611BAADA9; Sun, 25 Nov 2018 23:38:18 +0000 (UTC) From: Alexander Graf To: grub-devel@gnu.org Subject: [PATCH v4 02/10] PE: Add RISC-V definitions Date: Mon, 26 Nov 2018 00:38:07 +0100 Message-Id: <20181125233815.56392-3-agraf@suse.de> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20181125233815.56392-1-agraf@suse.de> References: <20181125233815.56392-1-agraf@suse.de> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] [fuzzy] X-Received-From: 195.135.220.15 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: The development of GNU GRUB Cc: rickchen36@gmail.com, David Abdurachmanov , Andreas Schwab , greentime , leif.lindholm@linaro.org, atish.patra@wdc.com, Michael Chang , Alistair Francis , Lukas Auer , Paul Walmsley , Bin Meng MIME-Version: 1.0 Errors-To: grub-devel-bounces+patch=linaro.org@gnu.org Sender: "Grub-devel" The PE format defines magic numbers as well as relocation identifiers for RISC-V. Add them to our include file, so we can make use of them. Signed-off-by: Alexander Graf Reviewed-by: Leif Lindholm Reviewed-by: Alistair Francis Reviewed-by: Bin Meng Tested-by: Bin Meng --- include/grub/efi/pe32.h | 5 +++++ 1 file changed, 5 insertions(+) -- 2.12.3 _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel Reviewed-by: Daniel Kiper diff --git a/include/grub/efi/pe32.h b/include/grub/efi/pe32.h index 7d44732d2..d1359eb66 100644 --- a/include/grub/efi/pe32.h +++ b/include/grub/efi/pe32.h @@ -70,6 +70,8 @@ struct grub_pe32_coff_header #define GRUB_PE32_MACHINE_X86_64 0x8664 #define GRUB_PE32_MACHINE_ARMTHUMB_MIXED 0x01c2 #define GRUB_PE32_MACHINE_ARM64 0xAA64 +#define GRUB_PE32_MACHINE_RISCV32 0x5032 +#define GRUB_PE32_MACHINE_RISCV64 0x5064 #define GRUB_PE32_RELOCS_STRIPPED 0x0001 #define GRUB_PE32_EXECUTABLE_IMAGE 0x0002 @@ -281,9 +283,12 @@ struct grub_pe32_fixup_block #define GRUB_PE32_REL_BASED_HIGHADJ 4 #define GRUB_PE32_REL_BASED_MIPS_JMPADDR 5 #define GRUB_PE32_REL_BASED_ARM_MOV32A 5 +#define GRUB_PE32_REL_BASED_RISCV_HI20 5 #define GRUB_PE32_REL_BASED_SECTION 6 #define GRUB_PE32_REL_BASED_REL 7 #define GRUB_PE32_REL_BASED_ARM_MOV32T 7 +#define GRUB_PE32_REL_BASED_RISCV_LOW12I 7 +#define GRUB_PE32_REL_BASED_RISCV_LOW12S 8 #define GRUB_PE32_REL_BASED_IA64_IMM64 9 #define GRUB_PE32_REL_BASED_DIR64 10 #define GRUB_PE32_REL_BASED_HIGH3ADJ 11