opnsense-src/sys/boot/efi/loader
Ed Maste 54f97d1eef UEFI: combine GetMemoryMap and ExitBootServices and retry on error
The EFI memory map may change before or during the first
ExitBootServices call. In that case ExitBootServices returns an error,
and GetMemoryMap and ExitBootServices must be retried.

Glue together calls to GetMemoryMap(), ExitBootServices() and storage of
(now up-to-date) MODINFOMD_EFI_MAP metadata within a single function.

That new function - bi_add_efi_data_and_exit() - uses space previously
allocated in bi_load_efi_data() to store the memory map (it will fail if
that space is too short). It handles re-calling GetMemoryMap() once to
update the map key if necessary. Finally, if ExitBootServices() is
successful, it stores the memory map and its header as MODINFOMD_EFI_MAP
metadata.

ExitBootServices() calls are now done earlier, from within arch-
independent bi_load() code.

PR:		202455
Submitted by:	Ganael LAPLANCHE
Reviewed by:	kib
MFC after:	2 weeks
Relnotes:	Yes
Differential Revision:	https://reviews.freebsd.org/D4296
2015-12-16 16:19:18 +00:00
..
arch UEFI: combine GetMemoryMap and ExitBootServices and retry on error 2015-12-16 16:19:18 +00:00
autoload.c Move the efi loaders to be under sys/boot/efi. This will help us add 2015-04-01 08:30:40 +00:00
bootinfo.c UEFI: combine GetMemoryMap and ExitBootServices and retry on error 2015-12-16 16:19:18 +00:00
conf.c Only enable comconsole and nullconsole on x86. 2015-04-03 12:08:08 +00:00
copy.c Use EFI page size constants instead of hardcoding 4096. 2015-09-29 15:49:53 +00:00
devicename.c Move the efi loaders to be under sys/boot/efi. This will help us add 2015-04-01 08:30:40 +00:00
loader_efi.h UEFI: combine GetMemoryMap and ExitBootServices and retry on error 2015-12-16 16:19:18 +00:00
main.c Add FDT to the list of known GUIDs. 2015-05-05 11:07:43 +00:00
Makefile Various small cleanups to EFI loader Makefiles. 2015-09-17 18:32:51 +00:00
Makefile.depend META MODE: Update dependencies with 'the-lot' and add missing directories. 2015-12-01 05:23:19 +00:00
version Move the efi loaders to be under sys/boot/efi. This will help us add 2015-04-01 08:30:40 +00:00