Received: from list by lists.gnu.org with archive (Exim 4.71) id 1esrnm-0005dd-DF for mharc-grub-devel@gnu.org; Mon, 05 Mar 2018 10:13:22 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38087) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1esrnj-0005d4-P3 for grub-devel@gnu.org; Mon, 05 Mar 2018 10:13:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1esrnd-0007hm-Tv for grub-devel@gnu.org; Mon, 05 Mar 2018 10:13:19 -0500 Received: from aserp2130.oracle.com ([141.146.126.79]:37176) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1esrnd-0007hA-LQ for grub-devel@gnu.org; Mon, 05 Mar 2018 10:13:13 -0500 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w25FBrwL080152; Mon, 5 Mar 2018 15:13:11 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2017-10-26; bh=LGVnPK+c37RlwAsf0hA3tNUQgKJb4hCzOGl7SxFZdds=; b=o1rge7slKG3wgRHBXa/83Pr0u4t8krGcVOoPRrye6Bwco9Amd2FgjRbPzEYzke/fL/u+ xQdxzCU3EhBUrNfDI1GEjtn2u62c6gJt/dgag2sDV+/N5FqimXW49TXMx0x0MQT8nsq7 JUVltsW9P5Eac3+U1rHhw03m2vT/OS91MU6ilUEisWn8Y6iF4aAucjBq9CUkpkenW3pc o+pz4AVOqcqFiXi9P6U1K4zTydn/qnlzYgM7xMGwZ9w52QvYgf1qdTSWH//uIEGFyznD IvqtI3OYYc5nqbp5od/cvA4RkQBO6pSd+KuQoA+RpG1R5BsjVOBCEGOSRZgLEAs5aX5K tQ== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp2130.oracle.com with ESMTP id 2gh8agg0dp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 05 Mar 2018 15:13:11 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w25FDAtB016097 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 5 Mar 2018 15:13:10 GMT Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w25FDAI3013546; Mon, 5 Mar 2018 15:13:10 GMT Received: from olila.local.net-space.pl (/10.175.205.113) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 05 Mar 2018 07:13:09 -0800 Date: Mon, 5 Mar 2018 16:13:05 +0100 From: Daniel Kiper To: Leif Lindholm Cc: grub-devel@gnu.org, "Vladimir =?utf-8?Q?'=CF=86-coder=2Fphcoder'?= Serbinenko" Subject: Re: [PATCH 09/10] commands/file: use definitions from arm/linux.h Message-ID: <20180305151305.GZ20614@olila.local.net-space.pl> References: <20180201181858.1472-1-leif.lindholm@linaro.org> <20180201181858.1472-10-leif.lindholm@linaro.org> <20180215103032.GP19041@olila.local.net-space.pl> <20180227123637.25letziowziloypy@bivouac.eciton.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180227123637.25letziowziloypy@bivouac.eciton.net> User-Agent: Mutt/1.5.21 (2010-09-15) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8822 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1803050180 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 141.146.126.79 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: , X-List-Received-Date: Mon, 05 Mar 2018 15:13:20 -0000 On Tue, Feb 27, 2018 at 12:36:37PM +0000, Leif Lindholm wrote: > On Thu, Feb 15, 2018 at 11:30:32AM +0100, Daniel Kiper wrote: > > On Thu, Feb 01, 2018 at 06:18:57PM +0000, Leif Lindholm wrote: > > > 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(-) > > > > > > 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)) > > > > Could you define 0xea000006 as a constant? If you add the comment > > what does it mean that will be perfect. > > I'll be completely honest here and say "I don't have a clue". > > Well, that's not true, I'm broken enough to see that that is a short > forward branch in the A32 ("ARM") instruction set. What I don't > understand is what significance that has for Raspberry Pi. > I just kept the logic for compatibility. > > Vladimir? If Vladimir or anybody else is not able to say then I would not like to hold on you any longer. I am happy with your guess in the comment if you say that it is a guess. Daniel