summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
authorMichael Brown2016-12-07 14:41:06 +0100
committerMichael Brown2016-12-07 14:46:37 +0100
commit5cf5ffea2874434ffdc64c3242f2c53ed7ec1d40 (patch)
tree5347859587c18d490a65de4cd6fa6170557ae211 /src/include
parent[undi] Try matching UNDI ROMs in BIOS enumeration order (diff)
downloadipxe-5cf5ffea2874434ffdc64c3242f2c53ed7ec1d40.tar.gz
ipxe-5cf5ffea2874434ffdc64c3242f2c53ed7ec1d40.tar.xz
ipxe-5cf5ffea2874434ffdc64c3242f2c53ed7ec1d40.zip
[efi] Work around temporal anomaly encountered during ExitBootServices()
EFI provides no clean way for device drivers to shut down in preparation for handover to a booted operating system. The platform firmware simply doesn't bother to call the drivers' Stop() methods. Instead, drivers must register an EVT_SIGNAL_EXIT_BOOT_SERVICES event to be signalled when ExitBootServices() is called, and clean up without any reference to the EFI driver model. Unfortunately, all timers silently stop working when ExitBootServices() is called. Even more unfortunately, and for no discernible reason, this happens before any EVT_SIGNAL_EXIT_BOOT_SERVICES events are signalled. The net effect of this entertaining design choice is that any timeout loops on the shutdown path (e.g. for gracefully closing outstanding TCP connections) may wait indefinitely. There is no way to report failure from currticks(), since the API lazily assumes that the host system continues to travel through time in the usual direction. Work around EFI's violation of this assumption by falling back to a simple free-running monotonic counter. Debugged-by: Maor Dickman <maord@mellanox.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include')
-rw-r--r--src/include/ipxe/efi/efi.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/include/ipxe/efi/efi.h b/src/include/ipxe/efi/efi.h
index d3415532..48ec0968 100644
--- a/src/include/ipxe/efi/efi.h
+++ b/src/include/ipxe/efi/efi.h
@@ -214,6 +214,7 @@ extern EFI_HANDLE efi_image_handle;
extern EFI_LOADED_IMAGE_PROTOCOL *efi_loaded_image;
extern EFI_DEVICE_PATH_PROTOCOL *efi_loaded_image_path;
extern EFI_SYSTEM_TABLE *efi_systab;
+extern int efi_shutdown_in_progress;
extern const __attribute__ (( pure )) char * efi_guid_ntoa ( EFI_GUID *guid );
extern const __attribute__ (( pure )) char *