diff options
| author | Kamil Aronowski <kamil.aronowski@yahoo.com> | 2023-04-12 18:50:12 +0200 |
|---|---|---|
| committer | Peter Jones <pjones@redhat.com> | 2023-06-21 14:19:51 -0400 |
| commit | 549d34691d68518e55c2edd6e759b19de7f8ddef (patch) | |
| tree | 84bfec1f3e6d73869daad14c7a4c01e1a8980848 /replacements.c | |
| parent | f7a4338f1b5ef03dca83ce44075e9d6e5897e037 (diff) | |
| download | efi-boot-shim-549d34691d68518e55c2edd6e759b19de7f8ddef.tar.gz efi-boot-shim-549d34691d68518e55c2edd6e759b19de7f8ddef.zip | |
Rename 'msecs' to 'usecs' to avoid potential confusion
The function msleep uses gBS->Stall which waits for a specified number
of microseconds.
Reference: https://edk2-docs.gitbook.io/edk-ii-uefi-driver-writer-s-guide/5_uefi_services/51_services_that_uefi_drivers_commonly_use/517_stall
This reference even mentions an example sleeping for 10 microseconds: // Wait 10 uS. Notice the letter 'u'.
Therefore it's a good idea to call the function 'usleep' rather than
'msleep', so no one confuses it with milliseconds, and to change the
argument name to match as well.
Signed-off-by: Kamil Aronowski <kamil.aronowski@yahoo.com>
Diffstat (limited to 'replacements.c')
| -rw-r--r-- | replacements.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/replacements.c b/replacements.c index 6066f9d6..469e73aa 100644 --- a/replacements.c +++ b/replacements.c @@ -109,7 +109,7 @@ replacement_start_image(EFI_HANDLE image_handle, UINTN *exit_data_size, CHAR16 * console_print(L"Something has gone seriously wrong: %r\n", efi_status2); console_print(L"shim cannot continue, sorry.\n"); - msleep(5000000); + usleep(5000000); RT->ResetSystem(EfiResetShutdown, EFI_SECURITY_VIOLATION, 0, NULL); @@ -137,7 +137,7 @@ exit_boot_services(EFI_HANDLE image_key, UINTN map_key) console_print(L"Bootloader has not verified loaded image.\n"); console_print(L"System is compromised. halting.\n"); - msleep(5000000); + usleep(5000000); RT->ResetSystem(EfiResetShutdown, EFI_SECURITY_VIOLATION, 0, NULL); return EFI_SECURITY_VIOLATION; } @@ -162,7 +162,7 @@ do_exit(EFI_HANDLE ImageHandle, EFI_STATUS ExitStatus, console_print(L"Something has gone seriously wrong: %r\n", efi_status2); console_print(L"shim cannot continue, sorry.\n"); - msleep(5000000); + usleep(5000000); RT->ResetSystem(EfiResetShutdown, EFI_SECURITY_VIOLATION, 0, NULL); } |
