From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1ZvsiE-00044k-Os for mharc-grub-devel@gnu.org; Mon, 09 Nov 2015 15:06:46 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53970) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZvsiB-0003zT-RF for grub-devel@gnu.org; Mon, 09 Nov 2015 15:06:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZvsiA-0002bX-Ls for grub-devel@gnu.org; Mon, 09 Nov 2015 15:06:43 -0500 Received: from mail-wm0-x22c.google.com ([2a00:1450:400c:c09::22c]:37494) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZvsiA-0002bK-Dk for grub-devel@gnu.org; Mon, 09 Nov 2015 15:06:42 -0500 Received: by wmww144 with SMTP id w144so47759979wmw.0 for ; Mon, 09 Nov 2015 12:06:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type; bh=KvVZRYs9p7hAtsanvIiOHmm/j04Nk3SQlwWivxN87O4=; b=w8aYPbgeNdg10Wd76+AUx7Zhw/h6maShBbDyoB3ruDQewQ8bQ5XNuuLOtXHkeJvl6r RTZLTW6gSov0EoMcMu/GJ/lPhbsOy7dpFZiJoRhLT67Qm41t6ImoNXqgAYvANHV8c2NC wICFOHixi6NzfSOvDz+X17pvsDdfZGIVanpe1g1MEESUAnenbQUJTyAc+csvaCAI3QMP lWAulrCTcZxmqlf2wzlPmxfeCVuE4+SC6BGz6vZSJnbofsnO9pQmdIFfgkDcU/ksghzj tJ2zcPLxZE8td13dKeJ4k1WlJyvQRn5/4LMIKKbbdmUNcSLNQ5cqLoNAHMrOP39Q/eLK aaZA== X-Received: by 10.28.170.65 with SMTP id t62mr345441wme.1.1447099601855; Mon, 09 Nov 2015 12:06:41 -0800 (PST) Received: from ?IPv6:2a02:1205:34c8:dc00:863a:4bff:fe50:abc4? ([2a02:1205:34c8:dc00:863a:4bff:fe50:abc4]) by smtp.gmail.com with ESMTPSA id t194sm345952wmt.11.2015.11.09.12.06.40 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Nov 2015 12:06:41 -0800 (PST) Subject: Re: [PATCH v2 4/6] multiboot2: Add tags used to pass ImageHandle to loaded image To: Daniel Kiper , The development of GRUB 2 References: <1437402954-7375-1-git-send-email-daniel.kiper@oracle.com> <1437402954-7375-5-git-send-email-daniel.kiper@oracle.com> From: =?UTF-8?Q?Vladimir_'=cf=86-coder/phcoder'_Serbinenko?= Message-ID: <5640FCD0.2020908@gmail.com> Date: Mon, 9 Nov 2015 21:06:40 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="628LS5qTv87jVTSQA7vFILakn6M3PdVoo" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c09::22c X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 20:06:45 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --628LS5qTv87jVTSQA7vFILakn6M3PdVoo Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 09.11.2015 20:15, Vladimir 'phcoder' Serbinenko wrote: > Lgtm >=20 > Le 20 juil. 2015 4:36 PM, "Daniel Kiper" > a =C3=A9crit : >=20 > Add tags used to pass ImageHandle to loaded image. It is used > by at least ExitBootServices() function. >=20 > Signed-off-by: Daniel Kiper > > --- > grub-core/loader/multiboot_mbi2.c | 46 > +++++++++++++++++++++++++++++-------- > include/multiboot2.h | 16 +++++++++++++ > 2 files changed, 53 insertions(+), 9 deletions(-) >=20 > diff --git a/grub-core/loader/multiboot_mbi2.c > b/grub-core/loader/multiboot_mbi2.c > index 8d66e3f..dc9c709 100644 > --- a/grub-core/loader/multiboot_mbi2.c > +++ b/grub-core/loader/multiboot_mbi2.c > @@ -172,6 +172,8 @@ grub_multiboot_load (grub_file_t file, const > char *filename) > case MULTIBOOT_TAG_TYPE_NETWORK: > case MULTIBOOT_TAG_TYPE_EFI_MMAP: > case MULTIBOOT_TAG_TYPE_EFI_BS: > + case MULTIBOOT_TAG_TYPE_EFI32_IH: > + case MULTIBOOT_TAG_TYPE_EFI64_IH: > break; >=20 > default: > @@ -407,16 +409,18 @@ grub_multiboot_get_mbi_size (void) > + grub_get_multiboot_mmap_count () > * sizeof (struct multiboot_mmap_entry)), > MULTIBOOT_TAG_ALIGN) > + ALIGN_UP (sizeof (struct multiboot_tag_framebuffer), > MULTIBOOT_TAG_ALIGN) > +#ifdef GRUB_MACHINE_EFI > + ALIGN_UP (sizeof (struct multiboot_tag_efi32), > MULTIBOOT_TAG_ALIGN) > + ALIGN_UP (sizeof (struct multiboot_tag_efi64), > MULTIBOOT_TAG_ALIGN) > + + ALIGN_UP (sizeof (struct multiboot_tag_efi32_ih), > MULTIBOOT_TAG_ALIGN) > + + ALIGN_UP (sizeof (struct multiboot_tag_efi64_ih), > MULTIBOOT_TAG_ALIGN) > + + ALIGN_UP (sizeof (struct multiboot_tag_efi_mmap) > + + efi_mmap_size, MULTIBOOT_TAG_ALIGN) > +#endif > + ALIGN_UP (sizeof (struct multiboot_tag_old_acpi) > + sizeof (struct grub_acpi_rsdp_v10), > MULTIBOOT_TAG_ALIGN) > + acpiv2_size () > + net_size () > -#ifdef GRUB_MACHINE_EFI > - + ALIGN_UP (sizeof (struct multiboot_tag_efi_mmap) > - + efi_mmap_size, MULTIBOOT_TAG_ALIGN) > -#endif > + sizeof (struct multiboot_tag_vbe) + MULTIBOOT_TAG_ALIGN - 1 > + sizeof (struct multiboot_tag_apm) + MULTIBOOT_TAG_ALIGN - 1;= > } > @@ -906,11 +910,35 @@ grub_multiboot_make_mbi (grub_uint32_t *targe= t) >=20 > if (keep_bs) > { > - struct multiboot_tag *tag =3D (struct multiboot_tag *) ptror= ig; > - tag->type =3D MULTIBOOT_TAG_TYPE_EFI_BS; > - tag->size =3D sizeof (struct multiboot_tag); > - ptrorig +=3D ALIGN_UP (tag->size, MULTIBOOT_TAG_ALIGN) > - / sizeof (grub_properly_aligned_t); > + { > + struct multiboot_tag *tag =3D (struct multiboot_tag *) ptro= rig; > + tag->type =3D MULTIBOOT_TAG_TYPE_EFI_BS; > + tag->size =3D sizeof (struct multiboot_tag); > + ptrorig +=3D ALIGN_UP (tag->size, MULTIBOOT_TAG_ALIGN) > + / sizeof (grub_properly_aligned_t); > + } > + > +#ifdef __x86_64__ > + { > + struct multiboot_tag_efi64_ih *tag =3D (struct > multiboot_tag_efi64_ih *) ptrorig; > + tag->type =3D MULTIBOOT_TAG_TYPE_EFI64_IH; > + tag->size =3D sizeof (*tag); > + tag->pointer =3D (grub_addr_t) grub_efi_image_handle; > + ptrorig +=3D ALIGN_UP (tag->size, MULTIBOOT_TAG_ALIGN) > + / sizeof (grub_properly_aligned_t); > + } > +#endif > + > +#ifdef __i386__ > + { > + struct multiboot_tag_efi32_ih *tag =3D (struct > multiboot_tag_efi32_ih *) ptrorig; > + tag->type =3D MULTIBOOT_TAG_TYPE_EFI32_IH; > + tag->size =3D sizeof (*tag); > + tag->pointer =3D (grub_addr_t) grub_efi_image_handle; > + ptrorig +=3D ALIGN_UP (tag->size, MULTIBOOT_TAG_ALIGN) > + / sizeof (grub_properly_aligned_t); > + } > +#endif > } > #endif >=20 > diff --git a/include/multiboot2.h b/include/multiboot2.h > index b3977e3..9f97ddc 100644 > --- a/include/multiboot2.h > +++ b/include/multiboot2.h > @@ -60,6 +60,8 @@ > #define MULTIBOOT_TAG_TYPE_NETWORK 16 > #define MULTIBOOT_TAG_TYPE_EFI_MMAP 17 > #define MULTIBOOT_TAG_TYPE_EFI_BS 18 > +#define MULTIBOOT_TAG_TYPE_EFI32_IH 19 > +#define MULTIBOOT_TAG_TYPE_EFI64_IH 20 >=20 > #define MULTIBOOT_HEADER_TAG_END 0 > #define MULTIBOOT_HEADER_TAG_INFORMATION_REQUEST 1 > @@ -379,6 +381,20 @@ struct multiboot_tag_efi_mmap > multiboot_uint8_t efi_mmap[0]; > }; >=20 > +struct multiboot_tag_efi32_ih > +{ > + multiboot_uint32_t type; > + multiboot_uint32_t size; > + multiboot_uint32_t pointer; > +}; > + > +struct multiboot_tag_efi64_ih > +{ > + multiboot_uint32_t type; > + multiboot_uint32_t size; > + multiboot_uint64_t pointer; > +}; > + > #endif /* ! ASM_FILE */ >=20 > #endif /* ! MULTIBOOT_HEADER */ > -- > 1.7.10.4 >=20 --628LS5qTv87jVTSQA7vFILakn6M3PdVoo Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iF4EAREKAAYFAlZA/NAACgkQmBXlbbo5nOuTqQD/aQq7pV7c2xENAzDyE+YAWOC8 kEv1IGWXRSEyVmTQ07EA/09xe54TqUFp5lUXG6FL773OX9lsq/GcUGFclKA9HZH+ =vgy8 -----END PGP SIGNATURE----- --628LS5qTv87jVTSQA7vFILakn6M3PdVoo--