From 549d34691d68518e55c2edd6e759b19de7f8ddef Mon Sep 17 00:00:00 2001 From: Kamil Aronowski Date: Wed, 12 Apr 2023 18:50:12 +0200 Subject: 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 --- include/asm.h | 4 ++-- include/console.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/asm.h b/include/asm.h index 03b06557..f5118b23 100644 --- a/include/asm.h +++ b/include/asm.h @@ -40,11 +40,11 @@ static inline void wait_for_debug(void) { uint64_t a, b; int x; - extern void msleep(unsigned long msecs); + extern void usleep(unsigned long usecs); a = read_counter(); for (x = 0; x < 1000; x++) { - msleep(1000); + usleep(1000); b = read_counter(); if (a != b) break; diff --git a/include/console.h b/include/console.h index 2a29c2dc..8eb4b47f 100644 --- a/include/console.h +++ b/include/console.h @@ -123,7 +123,7 @@ extern EFI_STATUS print_crypto_errors(EFI_STATUS rc, char *file, const char *fun #define crypterr(rc) print_crypto_errors((rc), __FILE__, __func__, __LINE__) #ifndef SHIM_UNIT_TEST -extern VOID msleep(unsigned long msecs); +extern VOID usleep(unsigned long usecs); #endif /* This is used in various things to determine if we should print to the -- cgit v1.2.3