summaryrefslogtreecommitdiffstats
path: root/CryptoPkg
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2024-05-22 12:01:15 +0200
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-09-25 16:08:35 +0000
commit609c7e86794158f847023679841b17bb3f7b8325 (patch)
tree0b3c70c1f23ecb93d285603b89cd90cacb870ae6 /CryptoPkg
parentb8122cc9d8b6c9017905ac5f4c846b4c0f535d01 (diff)
downloadedk2-609c7e86794158f847023679841b17bb3f7b8325.tar.gz
edk2-609c7e86794158f847023679841b17bb3f7b8325.tar.bz2
edk2-609c7e86794158f847023679841b17bb3f7b8325.zip
CrtLibSupport: add sleep()
Will be needed by openssl-3.2.x Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'CryptoPkg')
-rw-r--r--CryptoPkg/Library/BaseCryptLib/SysCall/ConstantTimeClock.c8
-rw-r--r--CryptoPkg/Library/BaseCryptLib/SysCall/TimerWrapper.c10
-rw-r--r--CryptoPkg/Library/BaseCryptLib/SysCall/UnitTestHostCrtWrapper.c8
-rw-r--r--CryptoPkg/Library/Include/CrtLibSupport.h6
4 files changed, 32 insertions, 0 deletions
diff --git a/CryptoPkg/Library/BaseCryptLib/SysCall/ConstantTimeClock.c b/CryptoPkg/Library/BaseCryptLib/SysCall/ConstantTimeClock.c
index 2956b92d08..4f23de2830 100644
--- a/CryptoPkg/Library/BaseCryptLib/SysCall/ConstantTimeClock.c
+++ b/CryptoPkg/Library/BaseCryptLib/SysCall/ConstantTimeClock.c
@@ -42,3 +42,11 @@ gmtime (
{
return NULL;
}
+
+unsigned int
+sleep (
+ unsigned int seconds
+ )
+{
+ return 0;
+}
diff --git a/CryptoPkg/Library/BaseCryptLib/SysCall/TimerWrapper.c b/CryptoPkg/Library/BaseCryptLib/SysCall/TimerWrapper.c
index 2dfc6fe6c5..30c93a45ea 100644
--- a/CryptoPkg/Library/BaseCryptLib/SysCall/TimerWrapper.c
+++ b/CryptoPkg/Library/BaseCryptLib/SysCall/TimerWrapper.c
@@ -9,6 +9,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include <Uefi.h>
#include <CrtLibSupport.h>
+#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
//
@@ -195,3 +196,12 @@ gmtime (
return GmTime;
}
+
+unsigned int
+sleep (
+ unsigned int seconds
+ )
+{
+ gBS->Stall (seconds * 1000 * 1000);
+ return 0;
+}
diff --git a/CryptoPkg/Library/BaseCryptLib/SysCall/UnitTestHostCrtWrapper.c b/CryptoPkg/Library/BaseCryptLib/SysCall/UnitTestHostCrtWrapper.c
index 244e57437e..1ec7fa37cd 100644
--- a/CryptoPkg/Library/BaseCryptLib/SysCall/UnitTestHostCrtWrapper.c
+++ b/CryptoPkg/Library/BaseCryptLib/SysCall/UnitTestHostCrtWrapper.c
@@ -104,4 +104,12 @@ getegid (
return 0;
}
+unsigned int
+sleep (
+ unsigned int seconds
+ )
+{
+ return 0;
+}
+
int errno = 0;
diff --git a/CryptoPkg/Library/Include/CrtLibSupport.h b/CryptoPkg/Library/Include/CrtLibSupport.h
index afc00956ab..a9171fba36 100644
--- a/CryptoPkg/Library/Include/CrtLibSupport.h
+++ b/CryptoPkg/Library/Include/CrtLibSupport.h
@@ -16,6 +16,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
#include <Library/PrintLib.h>
+#include <Library/TimerLib.h>
#define OPENSSLDIR ""
#define ENGINESDIR ""
@@ -334,6 +335,11 @@ gmtime (
const time_t *
);
+unsigned int
+sleep (
+ unsigned int seconds
+ );
+
uid_t
getuid (
void