Extensible Firmware Interface Specification
74 12/12/00 Version 1.02
3.4.5 Exit()
Summary
Terminates the currently loaded EFI image and returns control to boot services.
Prototype
EFI_STATUS
Exit (
IN EFI_HANDLE ImageHandle,
IN EFI_STATUS ExitStatus,
IN UINTN ExitDataSize,
IN CHAR16 *ExitData OPTIONAL
);
Parameters
ImageHandle Handle that identifies the image. This parameter is passed to the image
on entry. Type EFI_HANDLE is defined in Section 3.3.1.
ExitStatus The images exit code.
ExitDataSize The size, in bytes, of ExitData. Ignored if ExitStatus is
EFI_SUCCESS.
ExitData Pointer to a data buffer that includes a Null-terminated Unicode string,
optionally followed by additional binary data. The string is a description
that the caller may use to further indicate the reason for the images exit.
ExitData is only valid if ExitStatus is something other than
EFI_SUCCESS. The ExitData buffer must be allocated by calling
AllocatePool(). (See Section 3.2.4.)
Description
The Exit() function terminates the image referenced by ImageHandle and returns control to
boot services. This function can only be called by the currently executing image. This function
may not be called if the image has already returned from its entry point
(EFI_IMAGE_ENTRY_POINT) or if it has loaded any child images that have not exited (all child
images must exit before this image can exit).
Using Exit() is similar to returning from the images EFI_IMAGE_ENTRY_POINT except that
Exit() may also return additional ExitData.