From patchwork Wed Nov 14 13:11: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: 151080 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp5683513ljp; Wed, 14 Nov 2018 05:24:36 -0800 (PST) X-Google-Smtp-Source: AJdET5eUsjbF1lgiJw94CLkNusuZqLTZFoSRfpUN7otPAs5uU21+DQ6XEQkhZD9ZTDayNWU3bQ9D X-Received: by 2002:a0c:b174:: with SMTP id r49mr1702718qvc.70.1542201876546; Wed, 14 Nov 2018 05:24:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542201876; cv=none; d=google.com; s=arc-20160816; b=z2Q0S1Xc1TyNupn7cMRmib8pht+yai4mBKR8LsaI0AZeLWYr3uwzX2Owaa7gMPWGsW SPQUFG6bIYwku+G8zm5Yy0iJ2Mt7xjFZLaKIwX7rHfwlM/tK3oN7hvHTMk0wnh3dxtPe ev1iojBnjs2BLaLKEeXj0+8aq4Tif80DU+Exw1tWm3J5D3fz624li2Whx8Nl2pERZjK5 VeAsXRIRheaxvJTCDGRoZ9nf2O4lsduO2qFTvAT5b+2g2YQvmLAcldh1tGd/s3nLFrKf M8RSTUwydEAFS4fdxtKSuRVH9lUhE8lzfjLk//mWXoUaFObAff1YEGNs2keA3yyVoWGT 1jCA== 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=YfHM/z79y/5BSyex/uSDb4A8+K7fZgN4rTFvs5BikLI=; b=cJKe1L3FoLUlFzIk9teW7s92rHH2onEdViFbOXB3KbRn6XHun+DVC7g/ge2n+in88o 8tvkp5kY5vmeYgAk4uZUTVtstxGoE2MFdJ6PlT5KD1EGV1Q4+hO8zJvojYd0ivWox83j jdo+/NojY3BSgUa6Ti9+XO9Kouv2IRNsBlC+BBamtcwa97TSnwyNHjWDxLFYAzDApW1T hpyYqB+Ar6MxQju03ICIyTQJpQlrzKp4qAv0EcbQIBQW8SUxoZrU7fwBEQU+NFxYm+Eu 3/w6QbXlXZsJkdklj86B3Ve1lOxqsSQ2heKMpxYRKV3MTv/wqAY14VnrM55KLXO/n+Ku 6tHw== 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 j129si273514qkc.168.2018.11.14.05.24.36 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 14 Nov 2018 05:24:36 -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]:60221 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gMv9n-0004TQ-VF for patch@linaro.org; Wed, 14 Nov 2018 08:24:36 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41157) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gMuxZ-0002cR-Sd for grub-devel@gnu.org; Wed, 14 Nov 2018 08:12:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gMuxW-0006DN-Hp for grub-devel@gnu.org; Wed, 14 Nov 2018 08:11:57 -0500 Received: from mx2.suse.de ([195.135.220.15]:56742 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 1gMuxW-0005xF-6o for grub-devel@gnu.org; Wed, 14 Nov 2018 08:11:54 -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 3211FB0CE; Wed, 14 Nov 2018 13:11:41 +0000 (UTC) From: Alexander Graf To: grub-devel@gnu.org Subject: [PATCH v2 02/10] PE: Add RISC-V definitions Date: Wed, 14 Nov 2018 14:11:30 +0100 Message-Id: <20181114131138.43713-3-agraf@suse.de> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20181114131138.43713-1-agraf@suse.de> References: <20181114131138.43713-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 Reviewed-by: Leif Lindholm Reviewed-by: Alistair Francis --- 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: Bin Meng Tested-by: Bin Meng 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