From b19fa8126d8bc82cbac746ccc378454e3bd9bf91 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 18 Jul 2019 20:59:16 +0200 Subject: [PATCH] efi: add log_oom() helper --- src/boot/efi/util.c | 6 ++++++ src/boot/efi/util.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/src/boot/efi/util.c b/src/boot/efi/util.c index 6d2ad3d..da743dc 100644 --- a/src/boot/efi/util.c +++ b/src/boot/efi/util.c @@ -350,3 +350,9 @@ EFI_STATUS file_read(EFI_FILE_HANDLE dir, const CHAR16 *name, UINTN off, UINTN s return err; } + +EFI_STATUS log_oom(void) { + Print(L"Out of memory."); + (void) uefi_call_wrapper(BS->Stall, 1, 3 * 1000 * 1000); + return EFI_OUT_OF_RESOURCES; +} diff --git a/src/boot/efi/util.h b/src/boot/efi/util.h index cef127f..8518dfd 100644 --- a/src/boot/efi/util.h +++ b/src/boot/efi/util.h @@ -66,3 +66,5 @@ const EFI_GUID loader_guid; (ptr) = NULL; \ _ptr_; \ }) + +EFI_STATUS log_oom(void); -- 2.7.4