Hi Andreas,
here we go again ;)
On 2018-05-25 14:00, [ext] Andreas J. Reichel wrote:
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);
+}
+
Why not as macro? (I guess because of the includes?)
Anyway, you could also put a 'inline' there.
Claudius
VOID *mmalloc(UINTN bytes)
{
EFI_STATUS status;
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-54 Fax: (+49)-8142-66989-80 Email: [email protected]
--
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/c23b30cf-5b51-e592-e6af-7c30563e65d5%40siemens.com.
For more options, visit https://groups.google.com/d/optout.