This is hack to get the time when executing in MM Standalone mode. It is not clear how to implement a function that gets the current time. So using this as a hack for now.
Change-Id: I6f0ad72d2c965e8f1e7e4871039b3399cf9c3c6a Signed-off-by: Jagadeesh Ujja <jagadeesh.u...@arm.com> --- CryptoPkg/Library/BaseCryptLib/SysCall/TimerWrapper.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/CryptoPkg/Library/BaseCryptLib/SysCall/TimerWrapper.c b/CryptoPkg/Library/BaseCryptLib/SysCall/TimerWrapper.c index 5f9b0c2..72208c0 100644 --- a/CryptoPkg/Library/BaseCryptLib/SysCall/TimerWrapper.c +++ b/CryptoPkg/Library/BaseCryptLib/SysCall/TimerWrapper.c @@ -3,6 +3,7 @@ for OpenSSL-based Cryptographic Library (used in DXE & RUNTIME). Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR> +Copyright (c) 2018, ARM Limited. All rights reserved.<BR> This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -72,11 +73,13 @@ UINTN CumulativeDays[2][14] = { // ) time_t time (time_t *timer) { +#ifndef MM_STANDALONE EFI_STATUS Status; +#endif EFI_TIME Time; time_t CalTime; UINTN Year; - +#ifndef MM_STANDALONE // // Get the current time and date information // @@ -84,7 +87,19 @@ time_t time (time_t *timer) if (EFI_ERROR (Status) || (Time.Year < 1970)) { return 0; } - +#else + // + //[ToDo] Find out a way to get the current time for code executing as MM_STANDALONE + // + Time.Year = 2007; + Time.Month = 11; + Time.Day = 29; + Time.Hour = 17; + Time.Minute = 43; + Time.Second = 30; + + Year = (UINTN) (Time.Year % 100); +#endif // // Years Handling // UTime should now be set to 00:00:00 on Jan 1 of the current year. -- 1.9.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel