From patchwork Tue Feb 12 10:30:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 158144 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3667663jaa; Tue, 12 Feb 2019 02:35:30 -0800 (PST) X-Google-Smtp-Source: AHgI3Iax6AgkDf/kRsJfwamm+fr0a2IvWT70vLIAjB1W4pSAkqaSRhMXEWWTN607SSHGyouPHqvg X-Received: by 2002:a25:1257:: with SMTP id 84mr2219526ybs.257.1549967730414; Tue, 12 Feb 2019 02:35:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549967730; cv=none; d=google.com; s=arc-20160816; b=ZB2oGOBEQ/1kuZDQZtdSp25eJMikE9EKSAUGJCguwkIOJzNELY+47FIw8uzS0bHNYI 4gcws2jRQWSfU/hre0JbQ2BZl5QPWrUfIjDPwPUPxT/vTwNpVgIZjFymK8nDctgw+YLV BxXFl22ht/iX7oybwZBUkBuIgd+WXnupk67iR2+L8EzwWECKWrwoAVJb1IieyfqPaszC wOcpE16FAR2Ps0MDYpTgX3SkrCBsGVIjy2inxozc6sTJMpUh2uxo2Eh0bRplo4t5LwjL plz01HcHM7uoxvGiTr4WS1szqCLSZehcgjYsYv3MinUFbG0lCI9jhwzFFbIKM9ycRJ2a H1uw== 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=IhtDnf8qO48UEv9vD/jfXK3BLm9qYScsx3mhEmC9Atw=; b=klEJpzpwUpA/nkXR1mrdM7UDk8ua2KmhG87TKMWjTPRNmA2pJoiQBwA+SP5TdPnAD/ 1SPIX0JrTSNrIHEIZtTyyYZV3e9bvyDk5S72sEObLxvLFid2Jy12hVpazPgtja7jedHv AuqhTFy40YxgomCw/O/jyQVAXThq8yCDAWfDxCVGcp65DlTomwDRYWLqYxhcDHcBQ3Bg vznVo3lLw5jeVyKF9lFvzo5W2c0iECsWYkiLoKJCTP/amI/MJNz7a+4LGInPhxWMaOKE Iq6HEPzj7+X9ShlV+J1ZKAMAFdEujZeZs0tv6uCz97AHjn25JosF1khOAFAaVQK0YMMm ap4A== 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 l198si7304456ybl.131.2019.02.12.02.35.30 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 12 Feb 2019 02:35:30 -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]:36984 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtVPV-0003Cv-TU for patch@linaro.org; Tue, 12 Feb 2019 05:35:29 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37274) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtVMJ-0000uG-5V for grub-devel@gnu.org; Tue, 12 Feb 2019 05:32:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gtVMB-000493-Vo for grub-devel@gnu.org; Tue, 12 Feb 2019 05:32:10 -0500 Received: from mx2.suse.de ([195.135.220.15]:51780 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 1gtVM8-0002uH-3E for grub-devel@gnu.org; Tue, 12 Feb 2019 05:32:01 -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 98FE0B116; Tue, 12 Feb 2019 10:31:11 +0000 (UTC) From: Alexander Graf To: grub-devel@gnu.org Subject: [PATCH v6 02/11] PE: Add RISC-V definitions Date: Tue, 12 Feb 2019 11:30:59 +0100 Message-Id: <20190212103108.56963-3-agraf@suse.de> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20190212103108.56963-1-agraf@suse.de> References: <20190212103108.56963-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 , 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 207b0382e..0ed8781f0 100644 --- a/include/grub/efi/pe32.h +++ b/include/grub/efi/pe32.h @@ -77,6 +77,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 @@ -288,9 +290,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