From patchwork Tue Nov 6 17:58:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 150338 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp4208190ljp; Tue, 6 Nov 2018 10:12:32 -0800 (PST) X-Google-Smtp-Source: AJdET5dAnoKlVbJzefuw7dkXu84dXvpEOWKRNCOGJDXy1gm2DeNfgSMig6zyxxyT+g7ay4MKDB1m X-Received: by 2002:a37:8d81:: with SMTP id p123mr25379857qkd.241.1541527952193; Tue, 06 Nov 2018 10:12:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541527952; cv=none; d=google.com; s=arc-20160816; b=Da7a/qRPncxRVnVi8yetZlHSFGIsPzNoVc4ynT6SiNV+/lymrBnZto80hfUocPucWG QfxLPQsCqmLWwWYIDK0zvB9o9S783FyjQddSDNQmYrfz9ZsZSF2SnLMtI+iAFciNnxWX PLmxUITTEBCOuwmfj7LFYXdhosPx4g1yjW7OpsvdPzRiLNVnhMexoG42FzFuqIC5lhJj 0LeWSKp6XfFlDLmOFatJvwERGUxzga//AH1fdD9YPsCafPykADdWBFpEpADNGPf2m3V5 fIg0xqyXC+sW8VRE1cBu1cBhX39pTPi9YSNwnmEauat3eHc4BDz8vC+dcS21blE/1iML 8TlA== 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=xqTVqIuEgBaMMQRnAEJI8i/fkygHjETE4cL32QeSLjA=; b=piGeLhHcMtlR9pvY/IKXpgrbI3fwmyBfl3OuFzHlJBoOPQnqATUE3wtXsPFS01cvq8 kCHDSWpQ0DxYoCx4TA/t9UPKxcT73wMYGlk2pBzMiISAM1UMfynp8cxW/U6DmkAX2gEH ZGCNokC/N3B70EGWp9vHD78Z+XJEwOoSLnTdivgvCsSi19FXzE7wNQOlcU26mLh2XDGx UkQb1TfLRHlQHoZprk63tBDbgxVGhf06FDb9WRYj/9QryVER4kv/g3REatkUoYoaniNl 1dgDIxz+YfF9IPK3/JRLBOy0OskdZhjZh94vOud0/mQH+b41yyfn4VD8kVZ4J/iX+zcF juHg== 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 a123si1535357qkd.182.2018.11.06.10.12.32 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 06 Nov 2018 10:12:32 -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]:42454 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gK5q3-0002gk-LU for patch@linaro.org; Tue, 06 Nov 2018 13:12:31 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38203) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gK5nc-00072Y-Ku for grub-devel@gnu.org; Tue, 06 Nov 2018 13:10:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gK5cu-0003Ug-1B for grub-devel@gnu.org; Tue, 06 Nov 2018 12:58:58 -0500 Received: from mx2.suse.de ([195.135.220.15]:38206 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 1gK5cr-0003P5-Vr for grub-devel@gnu.org; Tue, 06 Nov 2018 12:58:54 -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 882B1AE0C; Tue, 6 Nov 2018 17:58:39 +0000 (UTC) From: Alexander Graf To: grub-devel@gnu.org Subject: [PATCH 2/9] PE: Add RISC-V definitions Date: Tue, 6 Nov 2018 18:58:30 +0100 Message-Id: <20181106175837.9083-3-agraf@suse.de> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20181106175837.9083-1-agraf@suse.de> References: <20181106175837.9083-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" , David Abdurachmanov , schwab@suse.de, "greentime @ andestech . com" , 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 --- 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: Leif Lindholm Reviewed-by: Alistair Francis 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