From patchwork Mon Jan 28 12:44:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 156723 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3385904jaa; Mon, 28 Jan 2019 04:45:06 -0800 (PST) X-Google-Smtp-Source: ALg8bN6wE6z6qrm2AyPlQrjYQJP2TYjbWsKm6EbO+Ye1drFn8eoBrZHjZ26ggiffdHj94UbWSP9O X-Received: by 2002:a5d:6187:: with SMTP id j7mr21811157wru.300.1548679506537; Mon, 28 Jan 2019 04:45:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548679506; cv=none; d=google.com; s=arc-20160816; b=1FhSvaKdYMqacPsnpYUENguPTUda0hdw3dYF0gNP2FfBncY/YSPMZGHA/M47yLP+4l CAWRq2RAxOVfvtawhQxRW9eN5kUCu5+GkwwnqmETlU2ThTFwuiRiLYrSPRV+sCEYj446 yQQbOaZ99B+1UBvWPRxjSvJXLffc225oljPPq0qRLhdvev5Ti2Y8rgFtpquChsA53vzK W5q04QZaEjTG4rWFhITgbfTnrQejeuOkQ/yy+qBUZVjNyI4OhtSvP+bburndO+/b/FFP KnkFXBjy/inQ0Oc+zV2lfH60GnFHst6TinBwGVuGqecyD9QVEbnndnOfRkbPD+TcmXql y24Q== 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=uIqtiZtA8c6ilA3BhSrDGr4uuOdmZx7VlwxiP9Z4Ygw=; b=w6shRy2xiAltlHZDOy0gvON38HklkAZZ6KTe7VgSvlJyH0gZfAbJtgr9RxI9gs/+Gs e6F1mc1uYmgbKwA9N7RPY33U/EcAfBubdoyOmfiZzuTQLz7xFLYeQKwrq/e1U/GEyFwR /80JDpBwn8z5gN6nVdOBTvBuNPTDbDg+KPmSOpST8gtwd8hpjH9I3Zw8zDPPrFitSqK1 UavZXOCZylZYyY6T4KoXtFgY24U6ZWwQ2lBmgGi0/mThDUzgwSlNxAtQdNt8SqQ7h+HA v1YIDEc/j5zjaKtUy1iimdkHY8aFXycZgFT8WNowoPJXsuVQV7D7yXZFhB/x28D9liLf Q/Fg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of grub-devel-bounces+patch=linaro.org@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="grub-devel-bounces+patch=linaro.org@gnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id c7si81634942wru.121.2019.01.28.04.45.06 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 28 Jan 2019 04:45:06 -0800 (PST) Received-SPF: pass (google.com: domain of grub-devel-bounces+patch=linaro.org@gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of grub-devel-bounces+patch=linaro.org@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="grub-devel-bounces+patch=linaro.org@gnu.org" Received: from localhost ([127.0.0.1]:59193 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1go6Hh-0007Lm-DU for patch@linaro.org; Mon, 28 Jan 2019 07:45:05 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48883) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1go6HY-0007Kj-BH for grub-devel@gnu.org; Mon, 28 Jan 2019 07:44:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1go6HW-0003RX-8V for grub-devel@gnu.org; Mon, 28 Jan 2019 07:44:55 -0500 Received: from mx2.suse.de ([195.135.220.15]:59828 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 1go6HU-0003Kc-94 for grub-devel@gnu.org; Mon, 28 Jan 2019 07:44:53 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 50B3AAC70; Mon, 28 Jan 2019 12:44:48 +0000 (UTC) From: Alexander Graf To: grub-devel@gnu.org Subject: [PATCH v5 02/11] PE: Add RISC-V definitions Date: Mon, 28 Jan 2019 13:44:38 +0100 Message-Id: <20190128124447.81028-3-agraf@suse.de> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20190128124447.81028-1-agraf@suse.de> References: <20190128124447.81028-1-agraf@suse.de> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] 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, greentime , Andreas Schwab , David Abdurachmanov , leif.lindholm@linaro.org, atish.patra@wdc.com, Michael Chang , Alistair Francis , Lukas Auer , Paul Walmsley , Bin Meng , Daniel Kiper 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 Reviewed-by: Daniel Kiper --- 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 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