add-Exit - Add Exit() library function which calls BS->Exit()
Signed-off-by: Jonathon Reinhart <jonathon.reinhart@gmail.com> Signed-off-by: Nigel Croxon <ncroxon@redhat.com>
This commit is contained in:
parent
787cb7fcd8
commit
3f8935c3d0
12
apps/exit.c
Normal file
12
apps/exit.c
Normal file
@ -0,0 +1,12 @@
|
||||
#include <efi.h>
|
||||
#include <efilib.h>
|
||||
|
||||
EFI_STATUS
|
||||
efi_main (EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *systab)
|
||||
{
|
||||
InitializeLib(image_handle, systab);
|
||||
|
||||
Exit(EFI_SUCCESS, 0, NULL);
|
||||
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
@ -208,6 +208,13 @@ EFIDebugVariable (
|
||||
VOID
|
||||
);
|
||||
|
||||
VOID
|
||||
Exit(
|
||||
IN EFI_STATUS ExitStatus,
|
||||
IN UINTN ExitDataSize,
|
||||
IN CHAR16 *ExitData OPTIONAL
|
||||
);
|
||||
|
||||
INTN
|
||||
GetShellArgcArgv(
|
||||
EFI_HANDLE ImageHandle,
|
||||
|
@ -44,7 +44,7 @@ TOPDIR = $(SRCDIR)/..
|
||||
|
||||
CDIR = $(TOPDIR)/..
|
||||
FILES = boxdraw smbios console crc data debug dpath \
|
||||
error event guid hand hw init lock \
|
||||
error event exit guid hand hw init lock \
|
||||
misc print sread str cmdline \
|
||||
runtime/rtlock runtime/efirtlib runtime/rtstr runtime/vm runtime/rtdata \
|
||||
$(ARCH)/initplat $(ARCH)/math $(ARCH)/setjmp
|
||||
|
@ -24,6 +24,11 @@ Revision History
|
||||
|
||||
BOOLEAN LibInitialized = FALSE;
|
||||
|
||||
//
|
||||
// ImageHandle - Current ImageHandle, as passed to InitializeLib
|
||||
//
|
||||
EFI_HANDLE LibImageHandle;
|
||||
|
||||
//
|
||||
// ST - pointer to the EFI system table
|
||||
//
|
||||
|
19
lib/exit.c
Normal file
19
lib/exit.c
Normal file
@ -0,0 +1,19 @@
|
||||
#include "lib.h"
|
||||
|
||||
VOID
|
||||
Exit(
|
||||
IN EFI_STATUS ExitStatus,
|
||||
IN UINTN ExitDataSize,
|
||||
IN CHAR16 *ExitData OPTIONAL
|
||||
)
|
||||
{
|
||||
uefi_call_wrapper(BS->Exit,
|
||||
4,
|
||||
LibImageHandle,
|
||||
ExitStatus,
|
||||
ExitDataSize,
|
||||
ExitData);
|
||||
|
||||
// Uh oh, Exit() returned?!
|
||||
for (;;) { }
|
||||
}
|
@ -49,6 +49,8 @@ Returns:
|
||||
if (!LibInitialized) {
|
||||
LibInitialized = TRUE;
|
||||
LibFwInstance = FALSE;
|
||||
LibImageHandle = ImageHandle;
|
||||
|
||||
|
||||
//
|
||||
// Set up global pointer to the system table, boot services table,
|
||||
|
@ -81,6 +81,7 @@ LibDuplicateDevicePathInstance (
|
||||
//
|
||||
extern BOOLEAN LibInitialized;
|
||||
extern BOOLEAN LibFwInstance;
|
||||
extern EFI_HANDLE LibImageHandle;
|
||||
extern SIMPLE_TEXT_OUTPUT_INTERFACE *LibRuntimeDebugOut;
|
||||
extern EFI_UNICODE_COLLATION_INTERFACE *UnicodeInterface;
|
||||
extern EFI_UNICODE_COLLATION_INTERFACE LibStubUnicodeInterface;
|
||||
|
Loading…
Reference in New Issue
Block a user