From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=217.140.101.70; helo=foss.arm.com; envelope-from=jagadeesh.ujja@arm.com; receiver=edk2-devel@lists.01.org Received: from foss.arm.com (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by ml01.01.org (Postfix) with ESMTP id 935E821BADAB9 for ; Wed, 31 Oct 2018 04:10:13 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 71C1D80D for ; Wed, 31 Oct 2018 04:10:13 -0700 (PDT) Received: from usa.arm.com (a75556-lin.blr.arm.com [10.162.2.34]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id A6AFE3F71D for ; Wed, 31 Oct 2018 04:10:12 -0700 (PDT) From: Jagadeesh Ujja To: edk2-devel@lists.01.org Date: Wed, 31 Oct 2018 16:39:44 +0530 Message-Id: <20181031110947.6305-7-jagadeesh.ujja@arm.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181031110947.6305-1-jagadeesh.ujja@arm.com> References: <20181031110947.6305-1-jagadeesh.ujja@arm.com> MIME-Version: 1.0 Subject: [RFC PATCH 6/9] CryptoPkg/BaseCryptLib: Hack to get time in MM Standalone mode X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2018 11:10:13 -0000 X-List-Received-Date: Wed, 31 Oct 2018 11:10:13 -0000 X-List-Received-Date: Wed, 31 Oct 2018 11:10:13 -0000 X-List-Received-Date: Wed, 31 Oct 2018 11:10:13 -0000 X-List-Received-Date: Wed, 31 Oct 2018 11:10:13 -0000 X-List-Received-Date: Wed, 31 Oct 2018 11:10:13 -0000 X-List-Received-Date: Wed, 31 Oct 2018 11:10:13 -0000 X-List-Received-Date: Wed, 31 Oct 2018 11:10:13 -0000 X-List-Received-Date: Wed, 31 Oct 2018 11:10:13 -0000 X-List-Received-Date: Wed, 31 Oct 2018 11:10:13 -0000 X-List-Received-Date: Wed, 31 Oct 2018 11:10:13 -0000 X-List-Received-Date: Wed, 31 Oct 2018 11:10:13 -0000 X-List-Received-Date: Wed, 31 Oct 2018 11:10:13 -0000 X-List-Received-Date: Wed, 31 Oct 2018 11:10:13 -0000 X-List-Received-Date: Wed, 31 Oct 2018 11:10:13 -0000 X-List-Received-Date: Wed, 31 Oct 2018 11:10:13 -0000 X-List-Received-Date: Wed, 31 Oct 2018 11:10:13 -0000 X-List-Received-Date: Wed, 31 Oct 2018 11:10:13 -0000 Content-Transfer-Encoding: 8bit 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 --- 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.
+Copyright (c) 2018, ARM Limited. All rights reserved.
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