public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Jagadeesh Ujja <jagadeesh.ujja@arm.com>
To: edk2-devel@lists.01.org
Subject: [RFC PATCH 6/9] CryptoPkg/BaseCryptLib: Hack to get time in MM Standalone mode
Date: Wed, 31 Oct 2018 16:39:44 +0530	[thread overview]
Message-ID: <20181031110947.6305-7-jagadeesh.ujja@arm.com> (raw)
In-Reply-To: <20181031110947.6305-1-jagadeesh.ujja@arm.com>

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.ujja@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



  parent reply	other threads:[~2018-10-31 11:10 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-31 11:09 [RFC PATCH 0/9] Extend secure variable service to be usable from Standalone MM Jagadeesh Ujja
2018-10-31 11:09 ` [RFC PATCH 1/9] StandaloneMmPkg: Pull in additonal libraries from staging branch Jagadeesh Ujja
2018-10-31 11:09 ` [RFC PATCH 2/9] ArmPlatformPkg/NorFlashDxe: allow reusability as a MM driver Jagadeesh Ujja
2018-10-31 11:09 ` [RFC PATCH 3/9] MdeModulePkg/FaultTolerantWriteDxe: " Jagadeesh Ujja
2018-10-31 11:09 ` [RFC PATCH 4/9] MdeModulePkg/Variable/RuntimeDxe: adapt for usability with MM Standalone Jagadeesh Ujja
2018-10-31 11:09 ` [RFC PATCH 5/9] MdeModulePkg/Variable/RuntimeDxe: adapt as a MM Standalone driver Jagadeesh Ujja
2018-10-31 11:09 ` Jagadeesh Ujja [this message]
2018-10-31 11:09 ` [RFC PATCH 7/9] SecurityPkg/AuthVariableLib:allow reusability as MM_STANDALONE Jagadeesh Ujja
2018-11-09  6:04   ` Zhang, Chao B
2018-10-31 11:09 ` [RFC PATCH 8/9] MdeModulePkg VarCheckLib: allow " Jagadeesh Ujja
2018-10-31 11:09 ` [RFC PATCH 9/9] CryptoPkg/BaseCryptLib: allow MM_STANDALONE drivers to use this library Jagadeesh Ujja
2018-10-31 13:58 ` [RFC PATCH 0/9] Extend secure variable service to be usable from Standalone MM Gao, Liming

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181031110947.6305-7-jagadeesh.ujja@arm.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox