From: Andreas Reichel <[email protected]>

Sometimes it is of advantage to have time to read the output
before the OS is booted. Implement a simple sleep function.

Signed-off-by: Andreas Reichel <[email protected]>
---
 include/utils.h | 1 +
 utils.c         | 5 +++++
 2 files changed, 6 insertions(+)

diff --git a/include/utils.h b/include/utils.h
index a73c554..285e45e 100644
--- a/include/utils.h
+++ b/include/utils.h
@@ -31,6 +31,7 @@ typedef enum { DOSFSLABEL, CUSTOMLABEL, NOLABEL } LABELMODE;
 
 uint32_t calc_crc32(void *data, int32_t size);
 void __noreturn error_exit(CHAR16 *message, EFI_STATUS status);
+VOID sleep(int32_t sec);
 VOID *mmalloc(UINTN bytes);
 EFI_STATUS mfree(VOID *p);
 CHAR16 *get_volume_label(EFI_FILE_HANDLE fh);
diff --git a/utils.c b/utils.c
index 9d3eb4d..33e3a90 100644
--- a/utils.c
+++ b/utils.c
@@ -32,6 +32,11 @@ void __noreturn error_exit(CHAR16 *message, EFI_STATUS 
status)
        unreachable();
 }
 
+VOID sleep(int32_t sec)
+{
+       uefi_call_wrapper(BS->Stall, 1, sec * 1000 * 1000);
+}
+
 VOID *mmalloc(UINTN bytes)
 {
        EFI_STATUS status;
-- 
2.17.0

-- 
You received this message because you are subscribed to the Google Groups "EFI 
Boot Guard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/efibootguard-dev/20180525120108.31055-2-andreas.reichel.ext%40siemens.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to