From patchwork Thu Feb 1 18:18:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leif Lindholm X-Patchwork-Id: 126566 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp1950879ljc; Thu, 1 Feb 2018 10:20:35 -0800 (PST) X-Google-Smtp-Source: AH8x2257kNBa6Hxjx8+na0i5ytoj3ZzBew195Pay0A+fAw0fdseg/6AasJYA5ZIhkSULFS+RkDVd X-Received: by 10.37.111.85 with SMTP id k82mr5924018ybc.353.1517509235075; Thu, 01 Feb 2018 10:20:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517509235; cv=none; d=google.com; s=arc-20160816; b=SYHzPbGgIQKAjMFMgVDkmMOsuCtzVhQX6bjpF5vdflROLLrQzGYynDpHPm/hzxpu5C gqTiU4wmDqiG1MgROlfWKqv7rLCXHsOIlwWD4nVxo15+HTH5Fed07b/nOMZZxKZ/5k/i C1qB7fPmBOHA2BMjroiSDwcS69nfMqL1pN/epBGrFV3/2BEPmTtoiKHNhnjQTal4enen 0c/utbbMyRRh0jNPJUdYtBckCqMz/oujSBUXGYzmYUbIyiMzs1Zig6k0U4tJP7o8iYiC FSuWmK/rA+Z6sEqRFdBk+PfQgJiwUvJO/KPSWvFtLPq2LKNJtq+J42EWG8xa/37ESyCm 7C6Q== 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:dkim-signature:arc-authentication-results; bh=Ti4ExvMzN3Ttzxd9c5YwxGVkzNnOivXYvta4XqmYy10=; b=D+lKufRE2Af4tbmnZHdpXXHqAAa6QcYqaQawx6qBLluT3DSG+tTK2yWSwhKFtGZi9L EMu+lHss4gsDn4ZC+0a1SLfftkJgrNhMxRVa741GlXLXCj0DtGJIRrwdnvHcMMfdwsY8 AIMLtb3kfyV8WIx5yQax5/O5BxOfe56YHUFQdh4hbIKFz04VEukZ6cYOjhNtX8BWbuLx z5FGxIbs/2ULNRcU8kMvVVkFWKJI538AP+5bEpqNw+QfCvCt6vGZYDBjtQq70SGXQXo9 SaeZvYmgh7fTJpCw9BvolQXXKJn4FOFCZo+2ODsCL6ZD50RxTsjHURYw6Q50+d17YLvg u2ZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=VV7uyUQf; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id f82si27624ybg.616.2018.02.01.10.20.34 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 01 Feb 2018 10:20:35 -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; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=VV7uyUQf; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:52715 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ehJTO-0003oX-FC for patch@linaro.org; Thu, 01 Feb 2018 13:20:34 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55386) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ehJRz-0003mD-KN for grub-devel@gnu.org; Thu, 01 Feb 2018 13:19:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ehJRw-0003Af-1R for grub-devel@gnu.org; Thu, 01 Feb 2018 13:19:07 -0500 Received: from mail-wr0-x244.google.com ([2a00:1450:400c:c0c::244]:42982) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ehJRv-000390-Qi for grub-devel@gnu.org; Thu, 01 Feb 2018 13:19:03 -0500 Received: by mail-wr0-x244.google.com with SMTP id 41so18625213wrc.9 for ; Thu, 01 Feb 2018 10:19:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=c+P6XR6FHtjjXn8KX6k3ISFOn8qGbbo1e+rGs2MR4ig=; b=VV7uyUQfXEZybAuLWCe8FAkWOvJ87NSs/YWGlSVXKJLxeuBERKk7ldBhP1RVhwZxfz mWT2PBNKQRhMGjtsycvENIeXYs77pXYaIO2hBXyrsa2ymhnene9+1iu1DdPfXmOw9nMb oVeSNy83UXcaw0pwJpaxRgTZx8XkN+Sfoufx4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=c+P6XR6FHtjjXn8KX6k3ISFOn8qGbbo1e+rGs2MR4ig=; b=s5UoQwDsXgAiIw8DAM+rj67J+uEcYq3uAi4qYbv5E3Gd70zw05z6s4+NIEe/o4JSu2 FFrBQFxue91iW2d+J2nc7De2r58KVS027Ez14nLg10JzCQOHf+cRu4xMt+UIbiJUh/VE v84dZvS8tZUkm4hUNTOTfiiF0yyj5nyom/yyJbp34G6BmW/i7atC4BRVz2mq/H5kshal /h00HfHUe6nfh1Xq/nJFtT7RuicETVmwVN2jFku+FGboTqXzFjMr3RUPhRIYsr1KbPiq yy7/L96jp7bSACact+lnVxSG/g4XCa6XSqIap4dHKFLKruh8VJQz4v5k9vHDX2QjoplN k1aw== X-Gm-Message-State: AKwxytcGuN7VpHcU3qUxa9XS0G2lBmoziznoAbsOz/xWc5O6gbmfIt1w yCeZ36nXKysJ4pCILLvgGQBG9G3Jtrw= X-Received: by 10.223.163.195 with SMTP id m3mr11395299wrb.90.1517509142567; Thu, 01 Feb 2018 10:19:02 -0800 (PST) Received: from vanye.hemma.eciton.net (cpc92316-cmbg19-2-0-cust118.5-4.cable.virginm.net. [82.12.0.119]) by smtp.gmail.com with ESMTPSA id b11sm163911wrf.23.2018.02.01.10.19.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Feb 2018 10:19:00 -0800 (PST) From: Leif Lindholm To: grub-devel@gnu.org Subject: [PATCH 01/10] arm64/efi: move EFI_PAGE definitions to efi/memory.h Date: Thu, 1 Feb 2018 18:18:49 +0000 Message-Id: <20180201181858.1472-2-leif.lindholm@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180201181858.1472-1-leif.lindholm@linaro.org> References: <20180201181858.1472-1-leif.lindholm@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::244 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: Daniel Kiper MIME-Version: 1.0 Errors-To: grub-devel-bounces+patch=linaro.org@gnu.org Sender: "Grub-devel" The EFI page definitions and macros are generic and should not be confined to arm64 headers - so move to efi/memory.h. Also add EFI_PAGE_SIZE macro. Update loader sources to reflect new header location. Signed-off-by: Leif Lindholm --- grub-core/loader/arm64/linux.c | 1 + grub-core/loader/arm64/xen_boot.c | 1 + grub-core/loader/efi/fdt.c | 1 + include/grub/efi/fdtload.h | 3 --- include/grub/efi/memory.h | 7 +++++++ 5 files changed, 10 insertions(+), 3 deletions(-) -- 2.11.0 _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel Reviewed-by: Daniel Kiper diff --git a/grub-core/loader/arm64/linux.c b/grub-core/loader/arm64/linux.c index 746edd104..ca01a2349 100644 --- a/grub-core/loader/arm64/linux.c +++ b/grub-core/loader/arm64/linux.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include diff --git a/grub-core/loader/arm64/xen_boot.c b/grub-core/loader/arm64/xen_boot.c index 6780b1f0c..0a40e16be 100644 --- a/grub-core/loader/arm64/xen_boot.c +++ b/grub-core/loader/arm64/xen_boot.c @@ -30,6 +30,7 @@ #include #include #include +#include #include /* required by struct xen_hypervisor_header */ #include #include diff --git a/grub-core/loader/efi/fdt.c b/grub-core/loader/efi/fdt.c index 17212c38d..c0c6800f7 100644 --- a/grub-core/loader/efi/fdt.c +++ b/grub-core/loader/efi/fdt.c @@ -24,6 +24,7 @@ #include #include #include +#include static void *loaded_fdt; static void *fdt; diff --git a/include/grub/efi/fdtload.h b/include/grub/efi/fdtload.h index 7b9ddba91..713c9424d 100644 --- a/include/grub/efi/fdtload.h +++ b/include/grub/efi/fdtload.h @@ -29,7 +29,4 @@ grub_fdt_unload (void); grub_err_t grub_fdt_install (void); -#define GRUB_EFI_PAGE_SHIFT 12 -#define GRUB_EFI_BYTES_TO_PAGES(bytes) (((bytes) + 0xfff) >> GRUB_EFI_PAGE_SHIFT) - #endif diff --git a/include/grub/efi/memory.h b/include/grub/efi/memory.h index 20526b146..08fe62277 100644 --- a/include/grub/efi/memory.h +++ b/include/grub/efi/memory.h @@ -22,6 +22,13 @@ #include #include +/* The term "page" in UEFI refers only to a 4 KiB-aligned 4 KiB size region of + memory. It is not concerned with underlying translation management concepts, + but only used as the granule for memory allocations. */ +#define GRUB_EFI_PAGE_SHIFT 12 +#define GRUB_EFI_PAGE_SIZE (1 << GRUB_EFI_PAGE_SHIFT) +#define GRUB_EFI_BYTES_TO_PAGES(bytes) (((bytes) + 0xfff) >> GRUB_EFI_PAGE_SHIFT) + #define GRUB_MMAP_REGISTER_BY_FIRMWARE 1 grub_err_t grub_machine_mmap_register (grub_uint64_t start, grub_uint64_t size, From patchwork Thu Feb 1 18:18:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leif Lindholm X-Patchwork-Id: 126564 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp1950031ljc; Thu, 1 Feb 2018 10:19:24 -0800 (PST) X-Google-Smtp-Source: AH8x227yX3WrZuFDILYK2h0PcF0zkP5zDjA8tzCFCH1wmvHpzx/P+khBYA0ZdYX511D565sWW0mD X-Received: by 10.37.135.4 with SMTP id a4mr25293405ybl.109.1517509164548; Thu, 01 Feb 2018 10:19:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517509164; cv=none; d=google.com; s=arc-20160816; b=ulV4pD1HgdEXppHacIqSz8u4a/B0vWeu9mZLoHp93S/WfMmgA6MS+jDcFcyvwK8XX+ fAfLwo3XVaBZ6mNhFvUDtgoZg993fmrorAfHKXy3n8gVsmMBKnmENm3kbGKzHfXN269t TWjUygaNBvIabS7cU+t2yvzJOKHMX9XdVDUqEZte/LVzzWvJOV0COlhBWKLk7xAnzY7Y sSN6H4PJ/+Q4pm298d2l90v59+nTz1x4zwiyVaqmATvNWgMkDmGoNddUDPaKxLqjAw0h cbuct3lmh1ilR2BlQ3O2pPbO5uxLtgRnlTj1thYqMdqelcTJOUynTHKt/uY5rGLhWFKn lfUQ== 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:dkim-signature:arc-authentication-results; bh=tFxbbph4gcaSh/i9Knbnwn1aFUhGX936LbvrLvX74P0=; b=aGqDA2C89ny/8Y7QHmiuGGDLAiIStM1rqzqFxN6ONIek+vZVmmrxziX9uAg1ZgR+S9 q6xBkpCsA17BamY3MHLX3w1VVXDMw3OXX29GxzQB0CEucYMKulsZXTASrtzhD6c88c82 tXWVz8jbzn6pjngqfDAKqt03skE9u1lglXLOKpaiXCFH2RxYN+gupIBvc3G88k3+tcfX VSExqPOnY6X/pljHlcdwOQsoShkx3EKeNFXdrVPV0eYZL/lczCr+kH5mK4o7UnVme4ki 7fZGjhIYmVY9GoscOO1oG3bs680BSGb9cc1zH/gNFBJJpkNTvA8/gXzOeHwplHaaBAEc BKFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=YZL43TX4; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id 204si31906ywl.561.2018.02.01.10.19.24 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 01 Feb 2018 10:19:24 -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; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=YZL43TX4; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:52716 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ehJSF-0003pL-Oy for patch@linaro.org; Thu, 01 Feb 2018 13:19:23 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55388) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ehJRz-0003mE-Km for grub-devel@gnu.org; Thu, 01 Feb 2018 13:19:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ehJRx-0003EQ-Gy for grub-devel@gnu.org; Thu, 01 Feb 2018 13:19:07 -0500 Received: from mail-wr0-x243.google.com ([2a00:1450:400c:c0c::243]:46579) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ehJRx-0003C5-9x for grub-devel@gnu.org; Thu, 01 Feb 2018 13:19:05 -0500 Received: by mail-wr0-x243.google.com with SMTP id g21so20007946wrb.13 for ; Thu, 01 Feb 2018 10:19:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=o/viKKYWb2AO14TdeEDzESMXQiHm56sNzAXeQWA4I3k=; b=YZL43TX4kK826goJuPqaoGnftLdo86JCpl1WahwfyAOChdLixtKtrge1Zl94LcJpnr 7rQtuFrnCrIQlWzF3vlWZNk5H0t9f0mw3b5+FpLshTzMOOLeNK8+eo3I0IdsKVXxqxTP Yb644En39RbcCwn6PkCwvspNaQfhuolcczphU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=o/viKKYWb2AO14TdeEDzESMXQiHm56sNzAXeQWA4I3k=; b=OVOED8yGE4jN5f0LQdlDkeiBpTQfoHjswQGM1Vly/k/PxLx8Ac9EocXFFuuazTZR/Z sKJVNrwK2nTd+URyssw4oTzjGqCE5AVTjbuOh6hn9RsiovEE4RT1DtrPADlaIEeCu5WB w4JmCNLXg1XEC1UKCAV0TETIcTvMQPrsFdN0c5HH0Wq2GZbXsxEjE3dqsuqbpRdCKfPq z7N6TRpYRgbOBi01IkOP90j+K9cUgTJLsOjYkSEaHnM9BCqKyP05Q7CqoLhPmcr+Etaj RcaQeYw5SXbAuhjH/G4YE+TheaEvOAK9gWi0qOi/qYXW2Cg4HJ2wMWfUXoQk+jb4PkPR l7VQ== X-Gm-Message-State: AKwxytdePR9qtajpk+ujTlXH48n0LoQD2iJgDIvK7Q/XnZkuAZBKB4Gc 3LOR/rZ8BgAR8mdk49cNjOWXPqD4B3U= X-Received: by 10.223.156.145 with SMTP id d17mr32233638wre.61.1517509144003; Thu, 01 Feb 2018 10:19:04 -0800 (PST) Received: from vanye.hemma.eciton.net (cpc92316-cmbg19-2-0-cust118.5-4.cable.virginm.net. [82.12.0.119]) by smtp.gmail.com with ESMTPSA id b11sm163911wrf.23.2018.02.01.10.19.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Feb 2018 10:19:03 -0800 (PST) From: Leif Lindholm To: grub-devel@gnu.org Subject: [PATCH 02/10] Make arch-specific linux.h include guards architecture unique Date: Thu, 1 Feb 2018 18:18:50 +0000 Message-Id: <20180201181858.1472-3-leif.lindholm@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180201181858.1472-1-leif.lindholm@linaro.org> References: <20180201181858.1472-1-leif.lindholm@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::243 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: Daniel Kiper MIME-Version: 1.0 Errors-To: grub-devel-bounces+patch=linaro.org@gnu.org Sender: "Grub-devel" Replace uses of GRUB_LINUX_MACHINE_HEADER and GRUB_LINUX_CPU_HEADER with GRUB__LINUX_HEADER include guards to prevent issues when including more than one of them. Signed-off-by: Leif Lindholm --- include/grub/arm/linux.h | 6 +++--- include/grub/arm64/linux.h | 6 +++--- include/grub/i386/linux.h | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) -- 2.11.0 _______________________________________________ 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/arm/linux.h b/include/grub/arm/linux.h index f217f8281..3706c46c6 100644 --- a/include/grub/arm/linux.h +++ b/include/grub/arm/linux.h @@ -17,8 +17,8 @@ * along with GRUB. If not, see . */ -#ifndef GRUB_LINUX_CPU_HEADER -#define GRUB_LINUX_CPU_HEADER 1 +#ifndef GRUB_ARM_LINUX_HEADER +#define GRUB_ARM_LINUX_HEADER 1 #define LINUX_ZIMAGE_OFFSET 0x24 #define LINUX_ZIMAGE_MAGIC 0x016f2818 @@ -66,4 +66,4 @@ grub_arm_firmware_get_machine_type (void) #define FDT_ADDITIONAL_ENTRIES_SIZE 0x300 -#endif /* ! GRUB_LINUX_CPU_HEADER */ +#endif /* ! GRUB_ARM_LINUX_HEADER */ diff --git a/include/grub/arm64/linux.h b/include/grub/arm64/linux.h index a981df5d1..a8edf50dc 100644 --- a/include/grub/arm64/linux.h +++ b/include/grub/arm64/linux.h @@ -16,8 +16,8 @@ * along with GRUB. If not, see . */ -#ifndef GRUB_LINUX_CPU_HEADER -#define GRUB_LINUX_CPU_HEADER 1 +#ifndef GRUB_ARM64_LINUX_HEADER +#define GRUB_ARM64_LINUX_HEADER 1 #include @@ -43,4 +43,4 @@ grub_err_t grub_arm64_uefi_check_image (struct grub_arm64_linux_kernel_header grub_err_t grub_arm64_uefi_boot_image (grub_addr_t addr, grub_size_t size, char *args); -#endif /* ! GRUB_LINUX_CPU_HEADER */ +#endif /* ! GRUB_ARM64_LINUX_HEADER */ diff --git a/include/grub/i386/linux.h b/include/grub/i386/linux.h index da0ca3b83..2ff1621a4 100644 --- a/include/grub/i386/linux.h +++ b/include/grub/i386/linux.h @@ -16,8 +16,8 @@ * along with GRUB. If not, see . */ -#ifndef GRUB_LINUX_MACHINE_HEADER -#define GRUB_LINUX_MACHINE_HEADER 1 +#ifndef GRUB_I386_LINUX_HEADER +#define GRUB_I386_LINUX_HEADER 1 #define GRUB_LINUX_MAGIC_SIGNATURE 0x53726448 /* "HdrS" */ #define GRUB_LINUX_DEFAULT_SETUP_SECTS 4 @@ -312,4 +312,4 @@ struct linux_kernel_params } GRUB_PACKED; #endif /* ! ASM_FILE */ -#endif /* ! GRUB_LINUX_MACHINE_HEADER */ +#endif /* ! GRUB_I386_LINUX_HEADER */ From patchwork Thu Feb 1 18:18:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leif Lindholm X-Patchwork-Id: 126569 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp1951847ljc; Thu, 1 Feb 2018 10:21:46 -0800 (PST) X-Google-Smtp-Source: AH8x224ds+aNsd3M1mAwk8U57aCeWCmNPQdcShVdd8fmKXgau4fuEV0SOTovbznsOv5fimG28Fa7 X-Received: by 10.37.186.135 with SMTP id s7mr25168794ybg.436.1517509305976; Thu, 01 Feb 2018 10:21:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517509305; cv=none; d=google.com; s=arc-20160816; b=Hhpd/JeZS2C11j+uugaEicjl6g5Y77fsEaskmEcv/2OkeDgyo9hUyaBuDLeZzD1/4X Nk0GKNorqQ4YREFm4AJOj3S2bn4vEKUtawbYawOZ6mr1z6uK0ib6MxnVTpn0tmvnrnjT VYfbA7HjWmwRzYtZDJ0dDRufLXOMA0jk0YwU6N8gl1lGGvHZ7WtSjHkVnbRtFeyiyo6s cACn2zrqBjwomJlS1pd6ZpoZFkbSA5zspck6znviWXaioasE3FJh0e1g3JB0Iaa+3VcU haYcBN4EkyEKJwq/fOoUnIxFlkIQVe/DW4lZCtkQvNDRSjHcjMTal1J1I8UQh2V5E2J/ /AyQ== 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:dkim-signature:arc-authentication-results; bh=OKygyyE26LGmuw3VkEZB7n2w7jVxkcnQ+1L6OzYq/c4=; b=KmeiavXzVyb7sDHbPrm6hhgji3Qe0cjPuljArmUb7oKTTXXnGDg+gi3VUc79PWOu9y 9o1Isq/Y1TCQxcYzhYS2Le74mbDOQlfCma2MWVwjkkgvcPKS+/YlTCdfyj4+HyGKTFmv lqxO84d6aSSZls+g4m7lQ/3qRVXpnxmBW0liDI9XuyKSk8TzoEMqcwCCzmyMwh38NKqQ qmpILv9ua3yvgtpnWdmXicZjnd2ithyo7mFDHdTwI/FTzBXGLnHDFVReMY4b6t5fVjuZ JnIIoxv0hey2AiMhNLOy9jOcRCkXGb6Lf53Jk1Ww/s6JsZ7OUyDOnALYSKDJ0GjWMOSQ XlTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=b3AntV76; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id x26si32015ybd.431.2018.02.01.10.21.45 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 01 Feb 2018 10:21:45 -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; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=b3AntV76; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:52766 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ehJUX-0005d2-C0 for patch@linaro.org; Thu, 01 Feb 2018 13:21:45 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55402) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ehJS0-0003mh-Cf for grub-devel@gnu.org; Thu, 01 Feb 2018 13:19:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ehJRy-0003JI-TD for grub-devel@gnu.org; Thu, 01 Feb 2018 13:19:08 -0500 Received: from mail-wr0-x244.google.com ([2a00:1450:400c:c0c::244]:46580) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ehJRy-0003G8-Jh for grub-devel@gnu.org; Thu, 01 Feb 2018 13:19:06 -0500 Received: by mail-wr0-x244.google.com with SMTP id g21so20008010wrb.13 for ; Thu, 01 Feb 2018 10:19:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=/4MIf+FgtjYbgcC8Kf+5piqh1FRCd5P2vfkhu+wE04M=; b=b3AntV76evTIOm6JoRn+n7/fxzVmdCN28Sd8NKejVvCUSJrK75TiSlsdzsqsLu0DYD N2yj8ALk2C2hVHr1Fz6oigluFVp3yodnasCO4tsehHIFLWT5EWDUFV/GiROM+Wy83tmq c6P4v/Vbf3fkHs2HPIBxafzyRQAg33TlfnRV4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=/4MIf+FgtjYbgcC8Kf+5piqh1FRCd5P2vfkhu+wE04M=; b=kf+F/3EK0fN0aLg48ki7f9iGk/IQU3W5Z/qCNH5e2rGFBagU+zpx0c85Cv1zs4th5R 9l8D5I70MVFa2fwK/1+ag9wpfi9xPQrn0AurR6dyLzUkt7+UcQhosRxPTK68UBEW1ei2 SbI8a0LmTXQmcppaaghDd8A3H2Iqk/OJNVuUejcjVKajhpGArIHhXNn+RkFmfhBHb36x QqZ2ZfGxVZmLJCjRTgbuJ59qyo8RwKxwplkWgZqdx/ar9IehytcYJrayGPso34k99xXH kyW0KQ4bP3Wrw11nkYkY8rgOh7hiHWoZQTqHW1Ncr28Fp/ekRQxwXLbcaBbCybATQjJK WcHw== X-Gm-Message-State: AKwxytdl8LnQf34JRMvW7YlQuPxQCCJFp90pgMbvxmjeA1QOocKAvNxx X6LcIiQFKWEhdlRxaKnIJX7henRZEoc= X-Received: by 10.223.173.2 with SMTP id p2mr18672086wrc.107.1517509145353; Thu, 01 Feb 2018 10:19:05 -0800 (PST) Received: from vanye.hemma.eciton.net (cpc92316-cmbg19-2-0-cust118.5-4.cable.virginm.net. [82.12.0.119]) by smtp.gmail.com with ESMTPSA id b11sm163911wrf.23.2018.02.01.10.19.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Feb 2018 10:19:04 -0800 (PST) From: Leif Lindholm To: grub-devel@gnu.org Subject: [PATCH 03/10] make GRUB_LINUX_MAGIC_SIGNATURE architecture-specific Date: Thu, 1 Feb 2018 18:18:51 +0000 Message-Id: <20180201181858.1472-4-leif.lindholm@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180201181858.1472-1-leif.lindholm@linaro.org> References: <20180201181858.1472-1-leif.lindholm@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::244 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: Daniel Kiper MIME-Version: 1.0 Errors-To: grub-devel-bounces+patch=linaro.org@gnu.org Sender: "Grub-devel" Rename GRUB_LINUX_MAGIC_SIGNATURE GRUB_LINUX_I386_MAGIC_SIGNATURE, to be usable in code that supports more than one image type. Signed-off-by: Leif Lindholm --- grub-core/commands/file.c | 4 ++-- grub-core/loader/i386/linux.c | 2 +- grub-core/loader/i386/pc/linux.c | 6 +++--- grub-core/loader/i386/xen_file.c | 2 +- include/grub/i386/linux.h | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) -- 2.11.0 _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel diff --git a/grub-core/commands/file.c b/grub-core/commands/file.c index 12fba99e0..474666d3a 100644 --- a/grub-core/commands/file.c +++ b/grub-core/commands/file.c @@ -508,7 +508,7 @@ grub_cmd_file (grub_extcmd_context_t ctxt, int argc, char **args) /* FIXME: some really old kernels (< 1.3.73) will fail this. */ if (lh.header != - grub_cpu_to_le32_compile_time (GRUB_LINUX_MAGIC_SIGNATURE) + grub_cpu_to_le32_compile_time (GRUB_LINUX_I386_MAGIC_SIGNATURE) || grub_le_to_cpu16 (lh.version) < 0x0200) break; @@ -521,7 +521,7 @@ grub_cmd_file (grub_extcmd_context_t ctxt, int argc, char **args) /* FIXME: 2.03 is not always good enough (Linux 2.4 can be 2.03 and still not support 32-bit boot. */ if (lh.header != - grub_cpu_to_le32_compile_time (GRUB_LINUX_MAGIC_SIGNATURE) + grub_cpu_to_le32_compile_time (GRUB_LINUX_I386_MAGIC_SIGNATURE) || grub_le_to_cpu16 (lh.version) < 0x0203) break; diff --git a/grub-core/loader/i386/linux.c b/grub-core/loader/i386/linux.c index 083f9417c..9bd5afb65 100644 --- a/grub-core/loader/i386/linux.c +++ b/grub-core/loader/i386/linux.c @@ -721,7 +721,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), /* FIXME: 2.03 is not always good enough (Linux 2.4 can be 2.03 and still not support 32-bit boot. */ - if (lh.header != grub_cpu_to_le32_compile_time (GRUB_LINUX_MAGIC_SIGNATURE) + if (lh.header != grub_cpu_to_le32_compile_time (GRUB_LINUX_I386_MAGIC_SIGNATURE) || grub_le_to_cpu16 (lh.version) < 0x0203) { grub_error (GRUB_ERR_BAD_OS, "version too old for 32-bit boot" diff --git a/grub-core/loader/i386/pc/linux.c b/grub-core/loader/i386/pc/linux.c index a293b17aa..31a687644 100644 --- a/grub-core/loader/i386/pc/linux.c +++ b/grub-core/loader/i386/pc/linux.c @@ -169,7 +169,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), maximal_cmdline_size = 256; - if (lh.header == grub_cpu_to_le32_compile_time (GRUB_LINUX_MAGIC_SIGNATURE) + if (lh.header == grub_cpu_to_le32_compile_time (GRUB_LINUX_I386_MAGIC_SIGNATURE) && grub_le_to_cpu16 (lh.version) >= 0x0200) { grub_linux_is_bzimage = (lh.loadflags & GRUB_LINUX_FLAG_BIG_KERNEL); @@ -322,7 +322,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), goto fail; } - if (lh.header != grub_cpu_to_le32_compile_time (GRUB_LINUX_MAGIC_SIGNATURE) + if (lh.header != grub_cpu_to_le32_compile_time (GRUB_LINUX_I386_MAGIC_SIGNATURE) || grub_le_to_cpu16 (lh.version) < 0x0200) /* Clear the heap space. */ grub_memset (grub_linux_real_chunk @@ -407,7 +407,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), lh = (struct linux_kernel_header *) grub_linux_real_chunk; - if (!(lh->header == grub_cpu_to_le32_compile_time (GRUB_LINUX_MAGIC_SIGNATURE) + if (!(lh->header == grub_cpu_to_le32_compile_time (GRUB_LINUX_I386_MAGIC_SIGNATURE) && grub_le_to_cpu16 (lh->version) >= 0x0200)) { grub_error (GRUB_ERR_BAD_OS, "the kernel is too old for initrd"); diff --git a/grub-core/loader/i386/xen_file.c b/grub-core/loader/i386/xen_file.c index 99fad4cad..6e76e16aa 100644 --- a/grub-core/loader/i386/xen_file.c +++ b/grub-core/loader/i386/xen_file.c @@ -43,7 +43,7 @@ grub_xen_file (grub_file_t file) goto fail; if (lh.boot_flag != grub_cpu_to_le16_compile_time (0xaa55) - || lh.header != grub_cpu_to_le32_compile_time (GRUB_LINUX_MAGIC_SIGNATURE) + || lh.header != grub_cpu_to_le32_compile_time (GRUB_LINUX_I386_MAGIC_SIGNATURE) || grub_le_to_cpu16 (lh.version) < 0x0208) { grub_error (GRUB_ERR_BAD_OS, "version too old for xen boot"); diff --git a/include/grub/i386/linux.h b/include/grub/i386/linux.h index 2ff1621a4..3ff432be9 100644 --- a/include/grub/i386/linux.h +++ b/include/grub/i386/linux.h @@ -19,7 +19,7 @@ #ifndef GRUB_I386_LINUX_HEADER #define GRUB_I386_LINUX_HEADER 1 -#define GRUB_LINUX_MAGIC_SIGNATURE 0x53726448 /* "HdrS" */ +#define GRUB_LINUX_I386_MAGIC_SIGNATURE 0x53726448 /* "HdrS" */ #define GRUB_LINUX_DEFAULT_SETUP_SECTS 4 #define GRUB_LINUX_INITRD_MAX_ADDRESS 0x37FFFFFF #define GRUB_LINUX_MAX_SETUP_SECTS 64 From patchwork Thu Feb 1 18:18:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leif Lindholm X-Patchwork-Id: 126567 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp1951825ljc; Thu, 1 Feb 2018 10:21:44 -0800 (PST) X-Google-Smtp-Source: AH8x226rSY49mgtQaYCwAxet7B8XHYHa+MpBzfbFOtRwlNwIzKM9Bxbw7NalBlZIeqfL2NU0XODl X-Received: by 10.37.102.76 with SMTP id z12mr8521356ybm.86.1517509304270; Thu, 01 Feb 2018 10:21:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517509304; cv=none; d=google.com; s=arc-20160816; b=RU978s4CPB67y2IUTFrOXCnsbgbry2xmbBjFq2SsmSz5YdixtnKwgCIXKDxss4zies WmJOMp2ZmxNCgR26PCy4uhbRN3aUVMRHEijnfR0ChOMwi7DdHfDoc7pmsAjqq4l4Mbl/ /JiD0PTWc4zaBfnAhGu8cQgURMltGpxIsUMgdMjz6s/7vgycC+1FJpgGiFCKHsIOrE5h dxklH2xAvagh5ifPIkvov6oHwVvRX6fCW5/s0/d0urFhAbBf5lWXC4loUbzowfp0Vdl0 K5mSKT0lKrRi1Lt4FsB07KL2ldgglzZrxyV5OMWFslD9AOMyfW8nvSZcg9H+5Xf+TPM5 m+tA== 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:dkim-signature:arc-authentication-results; bh=Zq23JpxbJVT93z21CPQf+ORBTM8KRTVSM3STUs5Cp6E=; b=vUEeKudnrpDbY9gBcjSinqQL2YRyrQ+UPXOwTcQhNI8FHs6ULlBltAbrpRn7Yy/MqI EDJVb1TLnjXTZrxzp4Vt40Og4f1GKWK0JcnUtS8MTvli66v6XBu4z5EV0dcZfs+pBFGZ 3L8gzikfEXdmnM9OhOvGLhTbBbpDP/TmnjdZaV7LZC2Ub18p+cBOMjxP0tVMNMROVGQR 5k1A2nBpc82VP7+2ZgZ4xoyg+Q3nG5TZglhHFXVp+6SeDPfWgowtZ/Dl1WbFYiutKkiU VMizdVKC/lal+HcjgKLVre6PpTTIyljBqKFyTiajcx3r571Jds3yz4Re2H2Riwji7B6i YdLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=N05r+thx; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id t83si30835ywb.721.2018.02.01.10.21.44 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 01 Feb 2018 10:21:44 -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; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=N05r+thx; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:52725 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ehJUV-0004up-K8 for patch@linaro.org; Thu, 01 Feb 2018 13:21:43 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55422) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ehJS1-0003nb-OO for grub-devel@gnu.org; Thu, 01 Feb 2018 13:19:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ehJS0-0003QF-MK for grub-devel@gnu.org; Thu, 01 Feb 2018 13:19:09 -0500 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:40645) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ehJS0-0003NW-Fa for grub-devel@gnu.org; Thu, 01 Feb 2018 13:19:08 -0500 Received: by mail-wm0-x243.google.com with SMTP id v123so7515512wmd.5 for ; Thu, 01 Feb 2018 10:19:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=58d3AvtE8zlfZWwP1YiJo0ISwxHdMb+CboCO4Y5rEko=; b=N05r+thxlOo9HQYdbrccdCI5rWNzMAGKa+BRUy+PDz6K0qLLaUsYOKEMMIBz8qKoao 4WUBNWmRFU6kMqlWSd4LbxIQavECUlxPsrkzBzun1XYtkuBwNY7w60sm9NxzbgoKuHnB ZYmb/AbeEj/uX3B5S1kQK1r3HMlxotI0x9C1Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=58d3AvtE8zlfZWwP1YiJo0ISwxHdMb+CboCO4Y5rEko=; b=t3Btks1UgTeKKeo3E33liM89TCsfctnxbSl+PVB/HV6mBXX5Y0fGYaR0nzHRB/mTcB uRehTPG3UFLQEgbS8CsiSrYQicP1XUOnGvrUw3mjsn92J9z90AZXz0O2OlL/NJlU6kuc WDPuY3vujM2P7RIsyQdOJODAT58MClhx3O4kTmYNt8H9h3l2cx8DOnm3lkaaWsdzxqNZ LcXHdMPs5IiWjwF5oW1Swt45v6SXqwhf+FtQ2OJJa/gD0AWy5xgyjTnugUnNKU6NBEtK ZfejHQ6W35VBBYgCEaK8JEdsQow7O1TNvcRhzjAAKngzbj+NTTAFDgu7Cwj0vadgmPnC NdOg== X-Gm-Message-State: AKwxyte6rpP1xPMOXiZ6n1qFoNBwIm42mCDE1/87yjyNW6KoWSEOsV/m sT1xk7+0XoyXRHFb7azuDsLE96JJhlc= X-Received: by 10.28.62.203 with SMTP id l194mr26344385wma.121.1517509147196; Thu, 01 Feb 2018 10:19:07 -0800 (PST) Received: from vanye.hemma.eciton.net (cpc92316-cmbg19-2-0-cust118.5-4.cable.virginm.net. [82.12.0.119]) by smtp.gmail.com with ESMTPSA id b11sm163911wrf.23.2018.02.01.10.19.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Feb 2018 10:19:06 -0800 (PST) From: Leif Lindholm To: grub-devel@gnu.org Subject: [PATCH 04/10] i386: make struct linux_kernel_header architecture specific Date: Thu, 1 Feb 2018 18:18:52 +0000 Message-Id: <20180201181858.1472-5-leif.lindholm@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180201181858.1472-1-leif.lindholm@linaro.org> References: <20180201181858.1472-1-leif.lindholm@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::243 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: Daniel Kiper MIME-Version: 1.0 Errors-To: grub-devel-bounces+patch=linaro.org@gnu.org Sender: "Grub-devel" struct linux_kernel_header -> struct linux_i386_kernel_header Signed-off-by: Leif Lindholm --- grub-core/commands/file.c | 2 +- grub-core/loader/i386/linux.c | 2 +- grub-core/loader/i386/pc/linux.c | 6 +++--- grub-core/loader/i386/xen_file.c | 2 +- include/grub/i386/linux.h | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) -- 2.11.0 _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel Reviewed-by: Daniel Kiper diff --git a/grub-core/commands/file.c b/grub-core/commands/file.c index 474666d3a..63c84499b 100644 --- a/grub-core/commands/file.c +++ b/grub-core/commands/file.c @@ -497,7 +497,7 @@ grub_cmd_file (grub_extcmd_context_t ctxt, int argc, char **args) case IS_X86_LINUX32: case IS_X86_LINUX: { - struct linux_kernel_header lh; + struct linux_i386_kernel_header lh; if (grub_file_read (file, &lh, sizeof (lh)) != sizeof (lh)) break; if (lh.boot_flag != grub_cpu_to_le16_compile_time (0xaa55)) diff --git a/grub-core/loader/i386/linux.c b/grub-core/loader/i386/linux.c index 9bd5afb65..44301e126 100644 --- a/grub-core/loader/i386/linux.c +++ b/grub-core/loader/i386/linux.c @@ -678,7 +678,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), int argc, char *argv[]) { grub_file_t file = 0; - struct linux_kernel_header lh; + struct linux_i386_kernel_header lh; grub_uint8_t setup_sects; grub_size_t real_size, prot_size, prot_file_size; grub_ssize_t len; diff --git a/grub-core/loader/i386/pc/linux.c b/grub-core/loader/i386/pc/linux.c index 31a687644..b69cb7a3a 100644 --- a/grub-core/loader/i386/pc/linux.c +++ b/grub-core/loader/i386/pc/linux.c @@ -121,7 +121,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), int argc, char *argv[]) { grub_file_t file = 0; - struct linux_kernel_header lh; + struct linux_i386_kernel_header lh; grub_uint8_t setup_sects; grub_size_t real_size; grub_ssize_t len; @@ -387,7 +387,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), { grub_size_t size = 0; grub_addr_t addr_max, addr_min; - struct linux_kernel_header *lh; + struct linux_i386_kernel_header *lh; grub_uint8_t *initrd_chunk; grub_addr_t initrd_addr; grub_err_t err; @@ -405,7 +405,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), goto fail; } - lh = (struct linux_kernel_header *) grub_linux_real_chunk; + lh = (struct linux_i386_kernel_header *) grub_linux_real_chunk; if (!(lh->header == grub_cpu_to_le32_compile_time (GRUB_LINUX_I386_MAGIC_SIGNATURE) && grub_le_to_cpu16 (lh->version) >= 0x0200)) diff --git a/grub-core/loader/i386/xen_file.c b/grub-core/loader/i386/xen_file.c index 6e76e16aa..77a93e7b2 100644 --- a/grub-core/loader/i386/xen_file.c +++ b/grub-core/loader/i386/xen_file.c @@ -26,7 +26,7 @@ grub_elf_t grub_xen_file (grub_file_t file) { grub_elf_t elf; - struct linux_kernel_header lh; + struct linux_i386_kernel_header lh; grub_file_t off_file; grub_uint32_t payload_offset, payload_length; grub_uint8_t magic[6]; diff --git a/include/grub/i386/linux.h b/include/grub/i386/linux.h index 3ff432be9..0bd758817 100644 --- a/include/grub/i386/linux.h +++ b/include/grub/i386/linux.h @@ -85,7 +85,7 @@ enum }; /* For the Linux/i386 boot protocol version 2.10. */ -struct linux_kernel_header +struct linux_i386_kernel_header { grub_uint8_t code1[0x0020]; grub_uint16_t cl_magic; /* Magic number 0xA33F */ From patchwork Thu Feb 1 18:18:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leif Lindholm X-Patchwork-Id: 126572 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp1952893ljc; Thu, 1 Feb 2018 10:23:02 -0800 (PST) X-Google-Smtp-Source: AH8x225JHyob6KDBUwI6I1+yfTnmL5HxsDvTAw7zWk4wVzOFf8ShUhBmjcS+K4a+DTWwGcnG5SJx X-Received: by 10.37.93.18 with SMTP id r18mr20377794ybb.424.1517509382879; Thu, 01 Feb 2018 10:23:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517509382; cv=none; d=google.com; s=arc-20160816; b=Rzr++vwE9Knon2OnPs2BoqLaGiz4XB9067bzeegzFwqD0WOY572RdJnifFpgYtyXlR fB2pdCQnOLP3qDfysUQtKSUT+EvKfre/y1/WC4OBzQOljdW5xhLstopHZfqA1yJ7AvOF 9ZDHdPPEcdupPyg52MU11Mbii9TIRPdRatB8Up+ngjLTizZWP0P2uO58keylUipd8dtL DNv6e9R/T+yr+KTFSGarzLHKECsG8KTIHC5t6JtjIscs4d0S4LtKnyk5OzF1hdSHg3+X vUGBGpKso6TriOcy3mcDch76xeoBN8G9Jd96H6/fV0fofjqzrc2Sq47YJvi/e2tppQNC Oscw== 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:dkim-signature:arc-authentication-results; bh=xlzSDROY8ga/kCzaHKjj28vGIEC/WBzbbluJuEdhIV0=; b=Vz1mDIORD6htEZ8jvuK07JnSpzNfsw+rJ41JQXrCJ7wz63KwMR0WcKmTUZ7/IneePu 33iIRDm8xYl6iL9uUGoQM9luWOPCeEZYwk5K6S29gsY5Oh3k8prwPQfYbhQcFDIYc8Tb hLuPseLTg3zXBxxeyZRCTH3P/yAQ3MLoMKbsBM/BOD1AvkntBcfh/1fRhPDlVquDtQS1 H5Xq73RyFobVgPCu9Z33o/ekITxO6C4UVZnyv1L9Dc4QlcXJMQHQwvdW4liVramvzS0c AJZxN5mKkRvHgit8YTDhJnQVDmTlHRu9kiPYUhwBaiYOzPSxjbsKfuhAyQmGt/2cm8hR xYqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=guNZOGpw; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id k127si38216ywg.165.2018.02.01.10.23.02 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 01 Feb 2018 10:23:02 -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; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=guNZOGpw; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:52842 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ehJVm-0006Zz-92 for patch@linaro.org; Thu, 01 Feb 2018 13:23:02 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55443) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ehJS4-0003oH-Sl for grub-devel@gnu.org; Thu, 01 Feb 2018 13:19:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ehJS2-0003U8-4w for grub-devel@gnu.org; Thu, 01 Feb 2018 13:19:11 -0500 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:38229) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ehJS1-0003Rv-UI for grub-devel@gnu.org; Thu, 01 Feb 2018 13:19:10 -0500 Received: by mail-wm0-x243.google.com with SMTP id 141so7503009wme.3 for ; Thu, 01 Feb 2018 10:19:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=73RGxGH1VSixfDeTKR0WjMQMucL+rbQbn9gNFopgUZI=; b=guNZOGpwobJC29Z3v/FOWzjA9HCO3Z1tOVf0E8FzNJZZzDauf0IahthXCp+48uh9cP owKglwYdFlyrKjwXn5SU4fxPWQ1NvFkmHZzpVk/JYLeFtqWoimSnTDtkvwAFCgtUWn+b Q/RjwYDS0nHuELD5qzRR9WrjVjHCrZCgiBZN0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=73RGxGH1VSixfDeTKR0WjMQMucL+rbQbn9gNFopgUZI=; b=CBp5sVLaShSNFEyiWrdEleqnQaODu1oviTrM6/WPQ+nKzNdkJ3SiOZU4i3PK9Bn8WF 8H4a1aSVQ9ipdqgPdEpqHnD8XSvol86gYenZiCE7BNl6V4FxFv8EpkZm2c7u55zyyalC 5H0rKi4DUS0xKVZOa0xEIpyfKryzlLIzFd89N8MZrRltr/v8g8Q5Bxnv8WvqLbytWAZi dkhQJjgbBNuBWE1j69dbJn1JwS6g/zKIYNvzCu41VnsCj2O+yj2a5jHWsZQjB3Btt8eJ iF8ml/YZZkVi5hT3F4E1ucVpSV+F7/ab4139WZKdNzprEQ9zBXvrr9q1uxBy4Dc/1GiX WheQ== X-Gm-Message-State: AKwxytdMF0r+Pd4XrU2oko+oexE+vsAyQhNOb9DIi4RENljOg8ZNBe/Q fpn/z4qni+rPdqxTkhUh/QAVp6pLWkw= X-Received: by 10.28.29.81 with SMTP id d78mr29617562wmd.65.1517509148703; Thu, 01 Feb 2018 10:19:08 -0800 (PST) Received: from vanye.hemma.eciton.net (cpc92316-cmbg19-2-0-cust118.5-4.cable.virginm.net. [82.12.0.119]) by smtp.gmail.com with ESMTPSA id b11sm163911wrf.23.2018.02.01.10.19.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Feb 2018 10:19:07 -0800 (PST) From: Leif Lindholm To: grub-devel@gnu.org Subject: [PATCH 05/10] arm64: align linux kernel header struct naming with i386 Date: Thu, 1 Feb 2018 18:18:53 +0000 Message-Id: <20180201181858.1472-6-leif.lindholm@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180201181858.1472-1-leif.lindholm@linaro.org> References: <20180201181858.1472-1-leif.lindholm@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::243 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: Daniel Kiper MIME-Version: 1.0 Errors-To: grub-devel-bounces+patch=linaro.org@gnu.org Sender: "Grub-devel" Rename struct grub_arm64_linux_kernel_header -> linux_arm64_kernel_header. Signed-off-by: Leif Lindholm --- grub-core/loader/arm64/linux.c | 4 ++-- grub-core/loader/arm64/xen_boot.c | 4 ++-- include/grub/arm64/linux.h | 5 ++--- 3 files changed, 6 insertions(+), 7 deletions(-) -- 2.11.0 _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel Reviewed-by: Daniel Kiper diff --git a/grub-core/loader/arm64/linux.c b/grub-core/loader/arm64/linux.c index ca01a2349..79f25a711 100644 --- a/grub-core/loader/arm64/linux.c +++ b/grub-core/loader/arm64/linux.c @@ -48,7 +48,7 @@ static grub_addr_t initrd_start; static grub_addr_t initrd_end; grub_err_t -grub_arm64_uefi_check_image (struct grub_arm64_linux_kernel_header * lh) +grub_arm64_uefi_check_image (struct linux_arm64_kernel_header * lh) { if (lh->magic != GRUB_ARM64_LINUX_MAGIC) return grub_error(GRUB_ERR_BAD_OS, "invalid magic number"); @@ -249,7 +249,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), int argc, char *argv[]) { grub_file_t file = 0; - struct grub_arm64_linux_kernel_header lh; + struct linux_arm64_kernel_header lh; grub_dl_ref (my_mod); diff --git a/grub-core/loader/arm64/xen_boot.c b/grub-core/loader/arm64/xen_boot.c index 0a40e16be..258264c79 100644 --- a/grub-core/loader/arm64/xen_boot.c +++ b/grub-core/loader/arm64/xen_boot.c @@ -67,7 +67,7 @@ typedef enum module_type module_type_t; struct xen_hypervisor_header { - struct grub_arm64_linux_kernel_header efi_head; + struct linux_arm64_kernel_header efi_head; /* This is always PE\0\0. */ grub_uint8_t signature[GRUB_PE32_SIGNATURE_SIZE]; @@ -469,7 +469,7 @@ grub_cmd_xen_hypervisor (grub_command_t cmd __attribute__ ((unused)), if (grub_file_read (file, &sh, sizeof (sh)) != (long) sizeof (sh)) goto fail; if (grub_arm64_uefi_check_image - ((struct grub_arm64_linux_kernel_header *) &sh) != GRUB_ERR_NONE) + ((struct linux_arm64_kernel_header *) &sh) != GRUB_ERR_NONE) goto fail; grub_file_seek (file, 0); diff --git a/include/grub/arm64/linux.h b/include/grub/arm64/linux.h index a8edf50dc..abe7e9cc3 100644 --- a/include/grub/arm64/linux.h +++ b/include/grub/arm64/linux.h @@ -24,7 +24,7 @@ #define GRUB_ARM64_LINUX_MAGIC 0x644d5241 /* 'ARM\x64' */ /* From linux/Documentation/arm64/booting.txt */ -struct grub_arm64_linux_kernel_header +struct linux_arm64_kernel_header { grub_uint32_t code0; /* Executable code */ grub_uint32_t code1; /* Executable code */ @@ -38,8 +38,7 @@ struct grub_arm64_linux_kernel_header grub_uint32_t hdr_offset; /* Offset of PE/COFF header */ }; -grub_err_t grub_arm64_uefi_check_image (struct grub_arm64_linux_kernel_header - *lh); +grub_err_t grub_arm64_uefi_check_image (struct linux_arm64_kernel_header *lh); grub_err_t grub_arm64_uefi_boot_image (grub_addr_t addr, grub_size_t size, char *args); From patchwork Thu Feb 1 18:18:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leif Lindholm X-Patchwork-Id: 126571 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp1952714ljc; Thu, 1 Feb 2018 10:22:51 -0800 (PST) X-Google-Smtp-Source: AH8x224Ta0A2ex08ZzuHhb5n6iE8A46qm1+BVL/V0lHdkr2WVADh1vNYcyDttsQ5MJWi1wvthNtr X-Received: by 10.13.249.129 with SMTP id j123mr20672250ywf.51.1517509370981; Thu, 01 Feb 2018 10:22:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517509370; cv=none; d=google.com; s=arc-20160816; b=08s3xRMzOxPW5BIEE0+mIRa0XoSCYek5RMwtt+MajaDOYqUhT+kzd58O9rLWEUXESz itgeg6+aAnJv4yKLAodKSp5DPhuKWWFv5EXQgm29nLXqOL0v4slMI8u8DypKmO/kWK83 e65+4N6DTh/+gTiEi9rZkIiYQFfC2SWiedOB6h2TVU/0LhHhkzh8iX5lj+k6z7k0L0o7 BEklXifM8nc2dL9durNdxVefayYhavhc5K+FeUgnBvpRQj7Ji38ofxtr+ECbS6thZ+OT I6FnTZ7AdJ1T1bfrSL9pqO97VZ2PvFUZyMP3wUOovdGkxz7NQOgEAfnkMcmR9/l8ayWH 5Xig== 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:dkim-signature:arc-authentication-results; bh=iBwlRsR751ehXTjpP9+0Jg03mBNbYJRq1JlLxGjPP+s=; b=QkuJK0m9DLuICOrhuunrYf9k8JF0fycQePSJADF9Ru66djdx751hVeYh7n1VwTsUfj Wswg2sijxpeUxwpQ1VUtz8agqvivmI1T/uySqeT1LL/NPPeWleNuoTN7SPCZHHKISsJL UAhClRUiDVWmjKsYypFwrmd8LRkVbuo1GqI+kdqeqz1EFSRd4+m9JWzusLG6BiYMBWry rVifv+nlKTjG9MuLg1UlKdr8Oo4vqbwUdcWc1zNtvmfnt1VCkJLpwY3PlzkZUD9spEZr M5uSorMz6AfupIfp2YxlUh9VMju24z/LHHeW6PI4ctnCdOgrEog7mEXihIBKipDNZN1O jMJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=N4Et/OxR; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id n11si39556ywi.88.2018.02.01.10.22.50 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 01 Feb 2018 10:22:50 -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; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=N4Et/OxR; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:52807 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ehJVa-0005vN-DT for patch@linaro.org; Thu, 01 Feb 2018 13:22:50 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55455) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ehJS5-0003oe-BF for grub-devel@gnu.org; Thu, 01 Feb 2018 13:19:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ehJS4-0003Yh-En for grub-devel@gnu.org; Thu, 01 Feb 2018 13:19:13 -0500 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:38229) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ehJS4-0003Wc-7y for grub-devel@gnu.org; Thu, 01 Feb 2018 13:19:12 -0500 Received: by mail-wm0-x242.google.com with SMTP id 141so7503224wme.3 for ; Thu, 01 Feb 2018 10:19:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=1qo2PxeKmlnle2oiz3Y+7j083YUq+FRlrTd1NP0gzMY=; b=N4Et/OxRo2vUJPEc/v+vmvAb+FAsuGnGSK8js76ZHc7fJ5hL7WiHLfSQtbuNezDUfa 6MwECy9YVu6z8ER7UsFeENyNnI1AaReKJMTYZr3ThGeG+QRopCU8UerEj5FY+s1U0XDR +E0oc9+Qu8MujZDmNMiPxt7XS4qLt7jQSvWVA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=1qo2PxeKmlnle2oiz3Y+7j083YUq+FRlrTd1NP0gzMY=; b=p6NSns2dq80vjpztZrqKvnwrNifFlsc8gIW1gRb/2BjAKSZ0P2etjKjYf8pIYtmHgl hnpVcZ314WBZffUR1wr23s/L8nLJRsI57QgOt5jv4BZ3J6xdlO0RRoxcpZ8RxjhZ864B n0feyBo7qiD8fVwoyBSzbktI0Zp5QgJV5tP7y5wlg7gcpk3it+yDkSJpDlTmwqmGN3Tf WhCc0KeMoKCumbPwz99tr35R5yCRj606Fusm8Hnx2kvQWABVyNlZaFgku8vyb+bBWvPM txjkSBcW8/bj+A0Gu0tk+5ZSZeNBfJMsOa4kn+o50hxThAzdJCfXZ6MwqiR9ny/apVqo 8sxQ== X-Gm-Message-State: AKwxyteDc2yEEjqCmBQIoQF96F8sHkCSivQMXVMYpFECqimgX15L5WT0 2jSuI679iV8tOZ+SI8nLR1FjT3GqQRI= X-Received: by 10.28.182.5 with SMTP id g5mr26325828wmf.44.1517509150464; Thu, 01 Feb 2018 10:19:10 -0800 (PST) Received: from vanye.hemma.eciton.net (cpc92316-cmbg19-2-0-cust118.5-4.cable.virginm.net. [82.12.0.119]) by smtp.gmail.com with ESMTPSA id b11sm163911wrf.23.2018.02.01.10.19.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Feb 2018 10:19:08 -0800 (PST) From: Leif Lindholm To: grub-devel@gnu.org Subject: [PATCH 06/10] arm64: align linux kernel magic macro naming with i386 Date: Thu, 1 Feb 2018 18:18:54 +0000 Message-Id: <20180201181858.1472-7-leif.lindholm@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180201181858.1472-1-leif.lindholm@linaro.org> References: <20180201181858.1472-1-leif.lindholm@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::242 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: Daniel Kiper MIME-Version: 1.0 Errors-To: grub-devel-bounces+patch=linaro.org@gnu.org Sender: "Grub-devel" Change GRUB_ARM64_LINUX_MAGIC to GRUB_LINUX_ARM64_MAGIC_SIGNATURE. Signed-off-by: Leif Lindholm --- grub-core/loader/arm64/linux.c | 2 +- include/grub/arm64/linux.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -- 2.11.0 _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel Reviewed-by: Daniel Kiper diff --git a/grub-core/loader/arm64/linux.c b/grub-core/loader/arm64/linux.c index 79f25a711..ebe1e730d 100644 --- a/grub-core/loader/arm64/linux.c +++ b/grub-core/loader/arm64/linux.c @@ -50,7 +50,7 @@ static grub_addr_t initrd_end; grub_err_t grub_arm64_uefi_check_image (struct linux_arm64_kernel_header * lh) { - if (lh->magic != GRUB_ARM64_LINUX_MAGIC) + if (lh->magic != GRUB_LINUX_ARM64_MAGIC_SIGNATURE) return grub_error(GRUB_ERR_BAD_OS, "invalid magic number"); if ((lh->code0 & 0xffff) != GRUB_PE32_MAGIC) diff --git a/include/grub/arm64/linux.h b/include/grub/arm64/linux.h index abe7e9cc3..b06347624 100644 --- a/include/grub/arm64/linux.h +++ b/include/grub/arm64/linux.h @@ -21,7 +21,7 @@ #include -#define GRUB_ARM64_LINUX_MAGIC 0x644d5241 /* 'ARM\x64' */ +#define GRUB_LINUX_ARM64_MAGIC_SIGNATURE 0x644d5241 /* 'ARM\x64' */ /* From linux/Documentation/arm64/booting.txt */ struct linux_arm64_kernel_header From patchwork Thu Feb 1 18:18:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leif Lindholm X-Patchwork-Id: 126573 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp1954225ljc; Thu, 1 Feb 2018 10:24:55 -0800 (PST) X-Google-Smtp-Source: AH8x227O1u9qlh1TzLBGcpQCCQe4nj43lMe+RiGGOvus9VzxWB5dXzw/raZwMy7BlHj3OKGxZUJI X-Received: by 10.37.210.14 with SMTP id j14mr14098950ybg.229.1517509495736; Thu, 01 Feb 2018 10:24:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517509495; cv=none; d=google.com; s=arc-20160816; b=wI5eJGpbzPNHb6vDgaE5Fp3AgKEiJYhkV2d3AAxTctfT1ngttXM285qn1kiVocKv8s r1iAHSKhmoP4MVSsqRnwetQcUHV2gCmJjfVVWPhtE72++P3T+10rDwbo+xuhIJed12tl yuSUy7/102fxGpVj7B9cVnPOcUI4ZajXBas43GqFP0rlL6xmZTpkC4s36ERd3yGsC0Fs 9fWnad0DPSEbCMBLW3VGwJoYThNDlPna91yIs174bQkDMHKY+bxvSXqTlGpKQxX6ubJ7 iL1AuEBQMNJEa1O2E5Ew37dEWj2vkFTV6YDBOZ77XB7BLdlnzgiPSx1BfVKJ4iGTC+1L yKNQ== 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:dkim-signature:arc-authentication-results; bh=A2c6NnoUN+NevYdxE5zYa/h/qasqmi+I2bjG2y2mjtg=; b=Mt4j9yE/Qp968yaZbE8rh2ccln8uwDpiw3J1bMEhhlHXWPI08/8jFzuvyfbKojTjQd atLyoU5RO2wp8vlzDHojSNnZq8toCh6bthe7/+EbB57sErbC2WwvuCj5yLIGlw8WMqsz 7WVjGKY1tHjrDVY14GTFZ0IGDhTb+lO3vnLff8dmKsEIPlXypUvCqnswC0l92fupnTlQ WKVV2htRGvqIq1abJVCmChLmDL09poeuB5RMfcEpilSuIPvFhVXaMEbmA00C2WeH01H5 yuKL/wZKy+Kmbxd9SMNsUoLrzAggzzWCLp7XCej8lfxZwTFEuaogtuIofJtuOIqbkWW/ yGYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=aTxNQl3y; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id x124si29874ybx.578.2018.02.01.10.24.55 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 01 Feb 2018 10:24:55 -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; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=aTxNQl3y; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:52888 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ehJXb-0007Q9-38 for patch@linaro.org; Thu, 01 Feb 2018 13:24:55 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55504) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ehJS9-0003tI-Tz for grub-devel@gnu.org; Thu, 01 Feb 2018 13:19:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ehJS5-0003b6-A0 for grub-devel@gnu.org; Thu, 01 Feb 2018 13:19:17 -0500 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:39904) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ehJS5-0003Yd-3a for grub-devel@gnu.org; Thu, 01 Feb 2018 13:19:13 -0500 Received: by mail-wm0-x244.google.com with SMTP id b21so7523712wme.4 for ; Thu, 01 Feb 2018 10:19:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Do/O/HDi4YkZchAgjSaFM2IIHKEKTA0bEqj9o6HoBeE=; b=aTxNQl3yM0CCvITDnWB9HXmjT4UAoJ7OS5XJDWltkWQRzbtakdt0aHOJqUqddP0SGp h98hEwtN8lTGq2ylMJMKY6VNVeGRK+8cQpNUTIOwa1lW/PbUog/gKTCcJpQV/I1vDtYj cfw16H2pBT3LI57yC3hMsUoz3N1DzY1CeDwyM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Do/O/HDi4YkZchAgjSaFM2IIHKEKTA0bEqj9o6HoBeE=; b=VH6qF/B++jBYSovXT1Cg2vkXHqjnx/R0f0iq96HOjty8X5yi9TPiFs2LLA2Byxd4Z7 OufQVvIPgfWqPYlspNo93MFTwkP5OupSPXBZ9NfdG01O3IBd8D9+/EFPeKcjKQNVjEGc tkxuzNIX5CiYdRYTvo9uWBI+h3X0HNkiogZJp0NSWTtka3fbE/byooC8A4kI02e6tUGe HyxUs9JMFCVIzeA/+ZNJbqEgSfQsefgac1BVVFgEj6ZZxQ2uUNytSYR0UngmCVGVm2Od KRnexyoiRWQPpzzOadPTdhtB6KPT9Ozk4WiWan3K7sdA/utfkLZX5jj7raIA3hcQthjo PFbA== X-Gm-Message-State: AKwxyte+izLUjunSnwuL4g31pVv+p+gbPbo/1MH4c7r9ycIj3uEH3yTA AwC/z0UFTLNdhKRM5ew/0wk+0ch7BKM= X-Received: by 10.28.247.25 with SMTP id v25mr29619903wmh.10.1517509151658; Thu, 01 Feb 2018 10:19:11 -0800 (PST) Received: from vanye.hemma.eciton.net (cpc92316-cmbg19-2-0-cust118.5-4.cable.virginm.net. [82.12.0.119]) by smtp.gmail.com with ESMTPSA id b11sm163911wrf.23.2018.02.01.10.19.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Feb 2018 10:19:10 -0800 (PST) From: Leif Lindholm To: grub-devel@gnu.org Subject: [PATCH 07/10] arm: switch linux loader to linux_arm_kernel_header struct Date: Thu, 1 Feb 2018 18:18:55 +0000 Message-Id: <20180201181858.1472-8-leif.lindholm@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180201181858.1472-1-leif.lindholm@linaro.org> References: <20180201181858.1472-1-leif.lindholm@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::244 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: Daniel Kiper MIME-Version: 1.0 Errors-To: grub-devel-bounces+patch=linaro.org@gnu.org Sender: "Grub-devel" Use kernel header struct and magic definition to align (and coexist) with i386/arm64 ports. Signed-off-by: Leif Lindholm --- grub-core/loader/arm/linux.c | 11 +++++------ include/grub/arm/linux.h | 15 ++++++++++++--- 2 files changed, 17 insertions(+), 9 deletions(-) -- 2.11.0 _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel Reviewed-by: Daniel Kiper diff --git a/grub-core/loader/arm/linux.c b/grub-core/loader/arm/linux.c index e64c79a95..9f43e41bb 100644 --- a/grub-core/loader/arm/linux.c +++ b/grub-core/loader/arm/linux.c @@ -46,9 +46,6 @@ static const void *current_fdt; typedef void (*kernel_entry_t) (int, unsigned long, void *); -#define LINUX_ZIMAGE_OFFSET 0x24 -#define LINUX_ZIMAGE_MAGIC 0x016f2818 - #define LINUX_PHYS_OFFSET (0x00008000) #define LINUX_INITRD_PHYS_OFFSET (LINUX_PHYS_OFFSET + 0x02000000) #define LINUX_FDT_PHYS_OFFSET (LINUX_INITRD_PHYS_OFFSET - 0x10000) @@ -315,6 +312,7 @@ linux_boot (void) static grub_err_t linux_load (const char *filename, grub_file_t file) { + struct linux_arm_kernel_header *lh; int size; size = grub_file_size (file); @@ -337,9 +335,10 @@ linux_load (const char *filename, grub_file_t file) return grub_errno; } - if (size > LINUX_ZIMAGE_OFFSET + 4 - && *(grub_uint32_t *) (linux_addr + LINUX_ZIMAGE_OFFSET) - == LINUX_ZIMAGE_MAGIC) + lh = (void *) linux_addr; + + if ((grub_size_t) size > sizeof (*lh) && + lh->magic == GRUB_LINUX_ARM_MAGIC_SIGNATURE) ; else if (size > 0x8000 && *(grub_uint32_t *) (linux_addr) == 0xea000006 && machine_type == GRUB_ARM_MACHINE_TYPE_RASPBERRY_PI) diff --git a/include/grub/arm/linux.h b/include/grub/arm/linux.h index 3706c46c6..64dd3173c 100644 --- a/include/grub/arm/linux.h +++ b/include/grub/arm/linux.h @@ -20,11 +20,20 @@ #ifndef GRUB_ARM_LINUX_HEADER #define GRUB_ARM_LINUX_HEADER 1 -#define LINUX_ZIMAGE_OFFSET 0x24 -#define LINUX_ZIMAGE_MAGIC 0x016f2818 - #include "system.h" +#define GRUB_LINUX_ARM_MAGIC_SIGNATURE 0x016f2818 + +struct linux_arm_kernel_header { + grub_uint32_t code0; + grub_uint32_t reserved1[8]; + grub_uint32_t magic; + grub_uint32_t start; /* _start */ + grub_uint32_t end; /* _edata */ + grub_uint32_t reserved2[4]; + grub_uint32_t hdr_offset; +}; + #if defined GRUB_MACHINE_UBOOT # include # define LINUX_ADDRESS (start_of_ram + 0x8000) From patchwork Thu Feb 1 18:18:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leif Lindholm X-Patchwork-Id: 126568 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp1951833ljc; Thu, 1 Feb 2018 10:21:44 -0800 (PST) X-Google-Smtp-Source: AH8x224NwtA1PL6giDyTsOqg+GaUTH3lyJXVw+X+dJIXsgmaCczNEbLHYd4T+RU/meEOVgV4o0er X-Received: by 10.37.205.197 with SMTP id d188mr11288088ybf.244.1517509304817; Thu, 01 Feb 2018 10:21:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517509304; cv=none; d=google.com; s=arc-20160816; b=rUxemVzfJEG0gfj8lBf5UdC4bWgUe5DU8QCw4eZYpFdk5r5aLhTMh96v8YxvYyQ6qZ oi8scv8aM08dZCy76wXyDgm4wA6+VfbrbvW3CNjaKe98gXeo/eba52WLFYvvfeFuU7gX /jLfkfeiGZqE7Tl7jED4DsRPDQX2RVZX7NW1PpuQMrbeQW7L+YsbsjthKrBJMOw0OwXC K3eyXx3YOEfm6SiW7uJvySOMETTk9ELojNnETv9JyfI+ODi8Tfgn+zjOZldXYF1ATycI fjsSrZubsCVI787fsIIszf5JLlYhXA4xg9lqvgs7EMkR+6XtthVSaQVRjqQha5EP4TkN FytA== 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:dkim-signature:arc-authentication-results; bh=eaRrkyVXHp9AjDXcQUMKzZQD8N/a+R+I2rN1xV+VKXw=; b=heUYkq+IDx/0BtcQXlxcapZkP1soHAUcbxoQv4m8CtNqI/iYwQsxUdxinEM/CEGlb+ e2cePi0lE3Es8BbG+DHIjbr5emlN9Kma7ClI1LwsycOy6mO4TmYB3cEl40jn/r5+l7l6 u6mOD0XCDY0fM4XM2JBLkCwT8dHS0yEl70M+PJYZyDYc8zKC8sMOSkefkSLQ+kV/oIfT Pz9eqMV7KNbEkMOYeWHkqi76z5qHO99uTf2AR01qITXBpRb+DOhjuAYfl8ZhfNBdxlpd 5klHRMfEnpzzqJEl0goAyEci05UskojrpSZJS8AuwvbEBFCAfLap74vvgnTY9OCElVNF xi0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=DnO1Y0qh; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id c6si35650ywm.233.2018.02.01.10.21.44 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 01 Feb 2018 10:21:44 -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; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=DnO1Y0qh; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:52729 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ehJUW-0004vN-3y for patch@linaro.org; Thu, 01 Feb 2018 13:21:44 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55526) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ehJSA-0003u4-LU for grub-devel@gnu.org; Thu, 01 Feb 2018 13:19:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ehJS6-0003f0-Q9 for grub-devel@gnu.org; Thu, 01 Feb 2018 13:19:18 -0500 Received: from mail-wr0-x241.google.com ([2a00:1450:400c:c0c::241]:41792) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ehJS6-0003d2-Jo for grub-devel@gnu.org; Thu, 01 Feb 2018 13:19:14 -0500 Received: by mail-wr0-x241.google.com with SMTP id v15so20022606wrb.8 for ; Thu, 01 Feb 2018 10:19:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=qXO1p/h5ZR0VKc/lR0DYW4tPwlPdukreY46jZ9hKKEE=; b=DnO1Y0qhN1rp8dRgcr9SmLtL/l9rNp8YlgW7T/K5vqAYsvUCvt4unwZND/w6IS6u3u IXNcm6eloChKroPW4B7WX24yE+lpw/rDXAyg+owzJm+0zoZR5g7DbYe48Mn2kYXmaa36 FUZUkIK7bo0EQFfQUmAaDis/29SFJ0g7UYPmw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=qXO1p/h5ZR0VKc/lR0DYW4tPwlPdukreY46jZ9hKKEE=; b=FB9zOjIGU3PvN2i9rFMGlgNssOjZHmCLfGaRNjXi9cudUSDjInCEI7zcrPlvjHLsx5 SrRVZny13c0wm33kThXnvjcAPtCHXmEb5V2g/rIwEE4hTIi8PzEux+AZkS4puQokOmYY iX35X+eCoqnRtpAKP4PF38BUIpUkj1RZ7FimPmPj1m9reen8xjsNGRxA7MTcQSp1SMUZ K56bsynTu7i8ONjOkxbwpdCQoXBFY0t3wsXoPvaD1an4Irwhb5/JCSq3S8d54vMWY+3i uCBY0ugJhh0TTAroWMXMH4vs4D1v7MiB4hAYnZQIoqMPLyqAsoNbY7wpkP2MBeEwNpg8 BFqQ== X-Gm-Message-State: AKwxyteK0jqMy2YyHW5DxueTE9xPxpp+i1hDGKf07bbtmIZ61VD/cBnH VrtXrHX2kgAEaInPEyC+N4EKPV8HCso= X-Received: by 10.223.157.200 with SMTP id q8mr7052766wre.205.1517509153357; Thu, 01 Feb 2018 10:19:13 -0800 (PST) Received: from vanye.hemma.eciton.net (cpc92316-cmbg19-2-0-cust118.5-4.cable.virginm.net. [82.12.0.119]) by smtp.gmail.com with ESMTPSA id b11sm163911wrf.23.2018.02.01.10.19.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Feb 2018 10:19:11 -0800 (PST) From: Leif Lindholm To: grub-devel@gnu.org Subject: [PATCH 08/10] arm: make linux.h safe to include for non-native builds Date: Thu, 1 Feb 2018 18:18:56 +0000 Message-Id: <20180201181858.1472-9-leif.lindholm@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180201181858.1472-1-leif.lindholm@linaro.org> References: <20180201181858.1472-1-leif.lindholm@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::241 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: Daniel Kiper MIME-Version: 1.0 Errors-To: grub-devel-bounces+patch=linaro.org@gnu.org Sender: "Grub-devel" (for machine arm/efi) and (for machine arm/coreboot) will not always resolve (and will likely not be valid to) if pulled in when building non-native commands, such as host tools or the "file" command. So explicitly include them with their expanded pathnames. Signed-off-by: Leif Lindholm --- include/grub/arm/linux.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.11.0 _______________________________________________ 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/arm/linux.h b/include/grub/arm/linux.h index 64dd3173c..cceb9c4a9 100644 --- a/include/grub/arm/linux.h +++ b/include/grub/arm/linux.h @@ -43,7 +43,7 @@ struct linux_arm_kernel_header { # define grub_arm_firmware_get_machine_type grub_uboot_get_machine_type #elif defined GRUB_MACHINE_EFI # include -# include +# include /* On UEFI platforms - load the images at the lowest available address not less than *_PHYS_OFFSET from the first available memory location. */ # define LINUX_PHYS_OFFSET (0x00008000) @@ -57,7 +57,7 @@ grub_arm_firmware_get_machine_type (void) } #elif defined (GRUB_MACHINE_COREBOOT) #include -#include +#include # define LINUX_ADDRESS (start_of_ram + 0x8000) # define LINUX_INITRD_ADDRESS (start_of_ram + 0x02000000) # define LINUX_FDT_ADDRESS (LINUX_INITRD_ADDRESS - 0x10000) From patchwork Thu Feb 1 18:18:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leif Lindholm X-Patchwork-Id: 126574 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp1954817ljc; Thu, 1 Feb 2018 10:25:47 -0800 (PST) X-Google-Smtp-Source: AH8x227kO5dQAElLBvaHW4N7Hpdc6WmC0FOmksGz0KRT1B4al3LM9OeCNbEHpPVVO8tfc6kgMmtx X-Received: by 10.37.4.84 with SMTP id 81mr25463621ybe.351.1517509547385; Thu, 01 Feb 2018 10:25:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517509547; cv=none; d=google.com; s=arc-20160816; b=FWSjKC1zNBEXBuvNC6XbZq3SUDWE3v/qNAYQORIb9hZyEhSjuPUeuk3fwrs+EFbJfo sC7NslwJymc2xjPzvGD4tEiIqcg+BolB6m2E7w32l0eKLlgZTVdpBmOdBBb/QWjvCI+s dZtzjyb/KmVdFY+rl1RGjkYEbfC+D2WasaoVjT6pb1PzK+wv7SMWUdjImEdBVqz+u6Jx xe846uB13iy+7a09Uh51fZ+JYlQTO0Pf62lrw7jqC/NGwb7t8D2kwgJ05n8pRzYXDtbr MukRkksOVj5I1xSDl1kywgJc3B7hdICAnRhXQXE7+jA4Pqky680ZKKGX+OGzIEcYkOti tmhQ== 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:dkim-signature:arc-authentication-results; bh=TRjP2n1sw2TefYB0cfMpZTMj89IECMEPFff1Gov650w=; b=UBDK1cp3pdbqePppGutZI7ulejEMQgl04YxxT+GclcxD49GuzP6p9TaeS46YkLFHVI jtI3dpYOfn1Z+73hLq+ktoAvcZN4ygiZcDAoaDm4CzMz1DuqZahhvstAVejP+vXrl52k h3U93SAOMqyUVO44i+uKk375/nZnpHWQDfL2qsGtYRG3TXU0P3Pp8pVwmROMwhxXbix4 9x+OodrL8tefqxmbVKl1JoAA78eRFF9MI1ZTffHdKTHbyDjM9kesjKLK2Jre4z9A+Ogc 4f+KbayufuKgyNuJilE+fvd4pEQ3soYxdUfCkmsnabB631O75jnM2wIaZ16z9/G1ZA+t HbyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=MCjAYYf9; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id u1si35627ybg.199.2018.02.01.10.25.47 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 01 Feb 2018 10:25:47 -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; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=MCjAYYf9; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:52909 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ehJYQ-0008Cu-PV for patch@linaro.org; Thu, 01 Feb 2018 13:25:46 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55503) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ehJS9-0003tH-Tv for grub-devel@gnu.org; Thu, 01 Feb 2018 13:19:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ehJS8-0003ho-8I for grub-devel@gnu.org; Thu, 01 Feb 2018 13:19:17 -0500 Received: from mail-wr0-x243.google.com ([2a00:1450:400c:c0c::243]:39594) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ehJS8-0003gM-0r for grub-devel@gnu.org; Thu, 01 Feb 2018 13:19:16 -0500 Received: by mail-wr0-x243.google.com with SMTP id f6so18375595wra.6 for ; Thu, 01 Feb 2018 10:19:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=mng1MPrNw+VSuh/7UrbZgcOsLSYgcISJyfq/n7NahzE=; b=MCjAYYf9eLSLA+cdh+GQkqkxqdagZiZApV3+WAgVDSpMV/Elikn+cm55zsFGz5JOyW Ns3hK7Ls67DzeW0mLzBq98QhedGSjG+sql/6SKV4pdM4+CfiPY+UVKFVN8oooPk2DDo2 /lX8HcBpDkBDJwv4IyaKM1f+yKgqZ7YaJBKPc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=mng1MPrNw+VSuh/7UrbZgcOsLSYgcISJyfq/n7NahzE=; b=NR0du6i5v3w5//5KA0QsWGo6ukrj2tP+FdJBUcGVmZDFnvaOsqy3xisiZugvIYJOEd zM1cTQoqlZj9Mykz+nfyMv8AlffAAyzP/hESf3eK9OtyGtUk22TbKMcC/hMPf0WiIY7z wB8umOegEGvG8BdZnXhe8CMV7hSxrveWY8BpS9ts7On6JmN5ScZvM3M4/MwEF8UaukKa hchOI1swiBnGQIqSi6WoTsGIsfveG+rifLcPGz3hS8iMHIlx4W4dJvX/Hk2dH7wuTyvv SXOZNxWYHkaZzd6v367hob9KIPiAVB+8AnE8a6iGA5P2pm8tJfKneBRy4optj/giNOy0 jayQ== X-Gm-Message-State: AKwxytdk/zEUqJuivvW2mZpIMFbBmbr7yMN2/aR9dsMRp00693OrzfvI V1iR9vgkxuBbdZjnuXGs/Mote+sTgyM= X-Received: by 10.223.163.195 with SMTP id m3mr11395896wrb.90.1517509154874; Thu, 01 Feb 2018 10:19:14 -0800 (PST) Received: from vanye.hemma.eciton.net (cpc92316-cmbg19-2-0-cust118.5-4.cable.virginm.net. [82.12.0.119]) by smtp.gmail.com with ESMTPSA id b11sm163911wrf.23.2018.02.01.10.19.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Feb 2018 10:19:13 -0800 (PST) From: Leif Lindholm To: grub-devel@gnu.org Subject: [PATCH 09/10] commands/file: use definitions from arm/linux.h Date: Thu, 1 Feb 2018 18:18:57 +0000 Message-Id: <20180201181858.1472-10-leif.lindholm@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180201181858.1472-1-leif.lindholm@linaro.org> References: <20180201181858.1472-1-leif.lindholm@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::243 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: Daniel Kiper MIME-Version: 1.0 Errors-To: grub-devel-bounces+patch=linaro.org@gnu.org Sender: "Grub-devel" Clean up code for matching IS_ARM slightly by making use of struct linux_arm_kernel_header and GRUB_LINUX_ARM_MAGIC_SIGNATURE. Signed-off-by: Leif Lindholm --- grub-core/commands/file.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) -- 2.11.0 _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel diff --git a/grub-core/commands/file.c b/grub-core/commands/file.c index 63c84499b..fad191202 100644 --- a/grub-core/commands/file.c +++ b/grub-core/commands/file.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -383,21 +384,18 @@ grub_cmd_file (grub_extcmd_context_t ctxt, int argc, char **args) } case IS_ARM_LINUX: { - grub_uint32_t sig, sig_pi; - if (grub_file_read (file, &sig_pi, 4) != 4) + struct linux_arm_kernel_header lh; + if (grub_file_read (file, &lh, sizeof (lh)) != sizeof (lh)) break; /* Raspberry pi. */ - if (sig_pi == grub_cpu_to_le32_compile_time (0xea000006)) + if (lh.code0 == grub_cpu_to_le32_compile_time (0xea000006)) { ret = 1; break; } - if (grub_file_seek (file, 0x24) == (grub_size_t) -1) - break; - if (grub_file_read (file, &sig, 4) != 4) - break; - if (sig == grub_cpu_to_le32_compile_time (0x016f2818)) + if (lh.magic == + grub_cpu_to_le32_compile_time (GRUB_LINUX_ARM_MAGIC_SIGNATURE)) { ret = 1; break; From patchwork Thu Feb 1 18:18:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leif Lindholm X-Patchwork-Id: 126570 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp1952512ljc; Thu, 1 Feb 2018 10:22:36 -0800 (PST) X-Google-Smtp-Source: AH8x227set5kdp0nX0oVHnlru2S9m7B9w0303/9lWL2D7lw8sRlq1sHDjFn7R3zRx31+DzN9jNdl X-Received: by 10.129.39.143 with SMTP id n137mr25916154ywn.53.1517509356075; Thu, 01 Feb 2018 10:22:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517509356; cv=none; d=google.com; s=arc-20160816; b=VSKQ2t7Y+LcXKxSdwPJclDe0ZkUI9P6/dChzUvmXjKujTTeOjxUweh0I15lkb8IKti eJ0RTVOWYJ5JEvZDf6h/U/8+w3hbjhDf8x83Voz9QsVhy6Z7O2VY8r1cs7wFVuOaUIRk 066w4B5mQ8ygs7d9QQ7y1vpOLR12NB/TfXORn6KJlgAPRS8qrZvkgCUfZ0YNDk8sYk2W 2JnnooAydwz90BH0iu5q8xOOk7fG/Xj82LH9FtRWlNSNJuLKZVxLLsmo49yG6DQBNAoG Kp4iGdNc84ZDkHMIxcSgH36qV6t1WbMRevlnodWg1jwnIGSOq3KltBCXQviU1oESs552 OTxQ== 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:dkim-signature:arc-authentication-results; bh=HchjxBCb3fybc+0cjlSlwY3OppUtnSVkLve2cP2YDZ0=; b=ieToqog/Ff0ZMVrxHnFdk1evh6NT0FlU2wjRLDXDjYDIMraRn2BwJEIRB5YTRMNXpd qPtrQooCKnZ3w6rccpKeXVbAi0x9nI/qGwK2EMaiTyfFP0MKoYBcnR81rGY77mGjR7vr MKdhp+CMmnpuySrPM7QBR48pqUllmZxre4ucPfv5jeYZ6j67UeLTIFlEWngyQ3a3IwN3 kssQmyURSK6ftgqtoQ5HGzmPWoybZ9yqetSOPbxC92s2zFah1RErNw718xbUHpYo844+ hgr38en8gk6viqfVpIAqGdyb6O18Tskw5v6QTjRSdgJmRZb6huRPRLKoXH7o3tlW+LKT Tc+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=DyfkevZn; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id f23si33040ybj.460.2018.02.01.10.22.35 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 01 Feb 2018 10:22: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; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=DyfkevZn; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:52831 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ehJVL-0006FP-GX for patch@linaro.org; Thu, 01 Feb 2018 13:22:35 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55518) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ehJSA-0003tv-GK for grub-devel@gnu.org; Thu, 01 Feb 2018 13:19:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ehJS9-0003lM-LR for grub-devel@gnu.org; Thu, 01 Feb 2018 13:19:18 -0500 Received: from mail-wr0-x243.google.com ([2a00:1450:400c:c0c::243]:46581) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ehJS9-0003j9-Es for grub-devel@gnu.org; Thu, 01 Feb 2018 13:19:17 -0500 Received: by mail-wr0-x243.google.com with SMTP id g21so20008561wrb.13 for ; Thu, 01 Feb 2018 10:19:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=VAgx3yqpan9OWo9pRjqLIQ66rzVYgsdPC4rUXzojcQA=; b=DyfkevZn2TSc1gkJ+if6V+5cFUtLbcDYjhjvqPAB9bf5t0AMP2lHAQGFMwYVVMP9os 90k8irTMCttahjlnNIMNPz3Uu1z3BB3YNITgTwgQd43OFx66fjzYPnNeCgB8aOVqXWWv bTF9WnSqS06T+ACTtzXNSg8ETPW3MUMh7+MEk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=VAgx3yqpan9OWo9pRjqLIQ66rzVYgsdPC4rUXzojcQA=; b=LWYfjfx+UsYPldSIZaNmzxuOR5RkA1ImYKEB8gFsbkZMvNSQTFNFYeFyfGTVjZtPVY bpIyzU9eVQtYDdo+0gaZ7Cx5V20ZmTg6X/LnTwvIdNCt71irkCwQGuWuCMxe/oHjogWL LKzwYi5QNHlE2pfc4o35X+Kz6KSq9+fCp747fmtI3yZ/6CUL4qxI0DADFksAUiBN7txI Gfm89jDon4+67hMaLriAZcwskmw1Xufk3u4y1oR/m1byixJ6DqJ9Wb22ZsTPBf6TBOYK Qe3eGu1b7JBpVwrBDJJv9tnDF+jONDt5x/dUft2alvvvB47YYU9bcHdKvj6mj8m9cILF B/ow== X-Gm-Message-State: AKwxytfcWx2f8agy/TLDQgRKPeNf03Q0taOv0EGWKh4CJ4RGoDLpE9SN pT4MSZBlyR1oUKgXuSBFdZmQ4Yb9/Y8= X-Received: by 10.223.153.240 with SMTP id y103mr16515284wrb.36.1517509156252; Thu, 01 Feb 2018 10:19:16 -0800 (PST) Received: from vanye.hemma.eciton.net (cpc92316-cmbg19-2-0-cust118.5-4.cable.virginm.net. [82.12.0.119]) by smtp.gmail.com with ESMTPSA id b11sm163911wrf.23.2018.02.01.10.19.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Feb 2018 10:19:15 -0800 (PST) From: Leif Lindholm To: grub-devel@gnu.org Subject: [PATCH 10/10] commands/file: use definitions from arm64/linux.h Date: Thu, 1 Feb 2018 18:18:58 +0000 Message-Id: <20180201181858.1472-11-leif.lindholm@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180201181858.1472-1-leif.lindholm@linaro.org> References: <20180201181858.1472-1-leif.lindholm@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::243 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: Daniel Kiper MIME-Version: 1.0 Errors-To: grub-devel-bounces+patch=linaro.org@gnu.org Sender: "Grub-devel" Clean up code for matching IS_ARM64 slightly by making use of struct linux_arm_kernel_header and GRUB_LINUX_ARM64_MAGIC_SIGNATURE. Signed-off-by: Leif Lindholm --- grub-core/commands/file.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) -- 2.11.0 _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel Reviewed-by: Daniel Kiper diff --git a/grub-core/commands/file.c b/grub-core/commands/file.c index fad191202..dd729a8a8 100644 --- a/grub-core/commands/file.c +++ b/grub-core/commands/file.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -404,13 +405,13 @@ grub_cmd_file (grub_extcmd_context_t ctxt, int argc, char **args) } case IS_ARM64_LINUX: { - grub_uint32_t sig; + struct linux_arm64_kernel_header lh; - if (grub_file_seek (file, 0x38) == (grub_size_t) -1) - break; - if (grub_file_read (file, &sig, 4) != 4) + if (grub_file_read (file, &lh, sizeof (lh)) != sizeof (lh)) break; - if (sig == grub_cpu_to_le32_compile_time (0x644d5241)) + + if (lh.magic == + grub_cpu_to_le32_compile_time (GRUB_LINUX_ARM64_MAGIC_SIGNATURE)) { ret = 1; break;