]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkModulePkg/Universal/MonotonicCounter/RuntimeDxe/MonotonicCounter.c
Add some definitions for efi event in Uefi/UefiSpec.h to follow spec.
[mirror_edk2.git] / EdkModulePkg / Universal / MonotonicCounter / RuntimeDxe / MonotonicCounter.c
index da76b55e459807b0b84e2b5189d7d327f2dd57cb..31efab323ace8afdb975bb70a71dd3abcc40135b 100644 (file)
@@ -1,13 +1,13 @@
 /*++\r
 \r
-Copyright (c) 2006 - 2007, Intel Corporation                                                         \r
-All rights reserved. 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 - 2007, Intel Corporation\r
+All rights reserved. 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
 \r
 Module Name:\r
 \r
@@ -84,7 +84,7 @@ Returns:
   //\r
   // Update the monotonic counter with a lock\r
   //\r
-  OldTpl  = gBS->RaiseTPL (EFI_TPL_HIGH_LEVEL);\r
+  OldTpl  = gBS->RaiseTPL (TPL_HIGH_LEVEL);\r
   *Count  = mEfiMtc;\r
   mEfiMtc++;\r
   gBS->RestoreTPL (OldTpl);\r
@@ -104,22 +104,22 @@ Returns:
 /**\r
   Returns the next high 32 bits of the platform's monotonic counter.\r
 \r
-  The GetNextHighMonotonicCount() function returns the next high 32 bits \r
-  of the platform's monotonic counter. The platform's monotonic counter is \r
-  comprised of two 32 bit quantities:  the high 32 bits and the low 32 bits.  \r
-  During boot service time the low 32 bit value is volatile:  it is reset to \r
+  The GetNextHighMonotonicCount() function returns the next high 32 bits\r
+  of the platform's monotonic counter. The platform's monotonic counter is\r
+  comprised of two 32 bit quantities:  the high 32 bits and the low 32 bits.\r
+  During boot service time the low 32 bit value is volatile:  it is reset to\r
   zero on every system reset and is increased by 1 on every call to GetNextMonotonicCount().\r
-  The high 32 bit value is non-volatile and is increased by 1 whenever the system resets \r
+  The high 32 bit value is non-volatile and is increased by 1 whenever the system resets\r
   or whenever the low 32 bit count [returned by GetNextMonoticCount()] overflows.\r
-  The GetNextMonotonicCount() function is only available at boot services time.  \r
-  If the operating system wishes to extend the platform monotonic counter to runtime, \r
-  it may do so by utilizing GetNextHighMonotonicCount().  To do this, before calling \r
-  ExitBootServices() the operating system would call GetNextMonotonicCount() to obtain \r
-  the current platform monotonic count.  The operating system would then provide an \r
-  interface that returns the next count by:  \r
+  The GetNextMonotonicCount() function is only available at boot services time.\r
+  If the operating system wishes to extend the platform monotonic counter to runtime,\r
+  it may do so by utilizing GetNextHighMonotonicCount().  To do this, before calling\r
+  ExitBootServices() the operating system would call GetNextMonotonicCount() to obtain\r
+  the current platform monotonic count.  The operating system would then provide an\r
+  interface that returns the next count by:\r
     Adding 1 to the last count.\r
-    Before the lower 32 bits of the count overflows, call GetNextHighMonotonicCount().  \r
-    This will increase the high 32 bits of the platform's non-volatile portion of the monotonic \r
+    Before the lower 32 bits of the count overflows, call GetNextHighMonotonicCount().\r
+    This will increase the high 32 bits of the platform's non-volatile portion of the monotonic\r
     count by 1.\r
 \r
   This function may only be called at Runtime.\r
@@ -128,7 +128,7 @@ Returns:
 \r
   @retval EFI_INVALID_PARAMETER If HighCount is NULL.\r
   @retval EFI_SUCCESS           Operation is successful.\r
-  @retval EFI_OUT_OF_RESOURCES  If variable service reports that not enough storage \r
+  @retval EFI_OUT_OF_RESOURCES  If variable service reports that not enough storage\r
                                 is available to hold the variable and its data.\r
   @retval EFI_DEVICE_ERROR      The variable could not be saved due to a hardware failure.\r
 \r
@@ -162,7 +162,7 @@ Returns:
     //\r
     // Use a lock if called before ExitBootServices()\r
     //\r
-    OldTpl      = gBS->RaiseTPL (EFI_TPL_HIGH_LEVEL);\r
+    OldTpl      = gBS->RaiseTPL (TPL_HIGH_LEVEL);\r
     *HighCount  = (UINT32) RShiftU64 (mEfiMtc, 32) + 1;\r
     mEfiMtc     = LShiftU64 (*HighCount, 32);\r
     gBS->RestoreTPL (OldTpl);\r
@@ -203,7 +203,7 @@ Arguments:
 \r
 Returns:\r
 \r
-  EFI_SUCCESS       The event has been handled properly \r
+  EFI_SUCCESS       The event has been handled properly\r
   EFI_NOT_FOUND     An error occurred updating the variable.\r
 \r
 --*/\r
@@ -243,8 +243,8 @@ Returns:
   // Initialize event to handle overflows\r
   //\r
   Status = gBS->CreateEvent (\r
-                  EFI_EVENT_NOTIFY_SIGNAL,\r
-                  EFI_TPL_CALLBACK,\r
+                  EVT_NOTIFY_SIGNAL,\r
+                  TPL_CALLBACK,\r
                   EfiMtcEventHandler,\r
                   NULL,\r
                   &mEfiMtcEvent\r