]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/Dxe/Event/Timer.c
MdeModulePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdeModulePkg / Core / Dxe / Event / Timer.c
index 1b20e327cdadec1f61720d3b7009fbd71eaa90cb..7a94712d81707a56262615ce0560bb3962f3b1e6 100644 (file)
@@ -1,14 +1,8 @@
 /** @file\r
   Core Timer Services\r
 \r
-Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution.  The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
@@ -187,7 +181,7 @@ CoreInitializeTimer (
 /**\r
   Called by the platform code to process a tick.\r
 \r
-  @param  Duration               The number of 100ns elasped since the last call\r
+  @param  Duration               The number of 100ns elapsed since the last call\r
                                  to TimerTick\r
 \r
 **/\r
@@ -261,7 +255,7 @@ CoreSetTimer (
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
-  if (Type < 0 || Type > TimerRelative  || (Event->Type & EVT_TIMER) == 0) {\r
+  if ((UINT32)Type > TimerRelative  || (Event->Type & EVT_TIMER) == 0) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
@@ -281,6 +275,9 @@ CoreSetTimer (
   if (Type != TimerCancel) {\r
 \r
     if (Type == TimerPeriodic) {\r
+      if (TriggerTime == 0) {\r
+        gTimer->GetTimerPeriod (gTimer, &TriggerTime);\r
+      }\r
       Event->Timer.Period = TriggerTime;\r
     }\r
 \r