]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkModulePkg/Universal/StatusCode/Dxe/DataHubStatusCodeWorker.c
Add some definitions for efi event in Uefi/UefiSpec.h to follow spec.
[mirror_edk2.git] / EdkModulePkg / Universal / StatusCode / Dxe / DataHubStatusCodeWorker.c
index 85e552bac0433924fd5cb39db6de3b21f5670905..72d699df44ba4f01701cc462c7637e0d1864c475 100644 (file)
@@ -1,14 +1,14 @@
 /** @file\r
   Data Hub status code worker in DXE.\r
 \r
-  Copyright (c) 2006, 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, 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:  DataHubStatusCodeWorker.c\r
 \r
@@ -33,9 +33,9 @@ EFI_DATA_HUB_PROTOCOL     *mDataHubProtocol;
 \r
 /**\r
   Return one DATAHUB_STATUSCODE_RECORD space.\r
-  The size of free record pool would be extend, if the pool is empty. \r
+  The size of free record pool would be extend, if the pool is empty.\r
+\r
 \r
\r
   @retval  NULL   Can not allocate free memeory for record.\r
   @retval  !NULL  Point to buffer of record.\r
 \r
@@ -51,7 +51,7 @@ AcquireRecordBuffer (
   LIST_ENTRY                *Node;\r
   UINT32                    Index;\r
 \r
-  CurrentTpl = gBS->RaiseTPL (EFI_TPL_HIGH_LEVEL);\r
+  CurrentTpl = gBS->RaiseTPL (TPL_HIGH_LEVEL);\r
 \r
   if (!IsListEmpty (&mRecordsBuffer)) {\r
     Node = GetFirstNode (&mRecordsBuffer);\r
@@ -59,7 +59,7 @@ AcquireRecordBuffer (
 \r
     Record = _CR (Node, DATAHUB_STATUSCODE_RECORD, Node);\r
   } else {\r
-    if (CurrentTpl > EFI_TPL_NOTIFY) {\r
+    if (CurrentTpl > TPL_NOTIFY) {\r
       gBS->RestoreTPL (CurrentTpl);\r
       return NULL;\r
     }\r
@@ -70,7 +70,7 @@ AcquireRecordBuffer (
       return NULL;\r
     }\r
 \r
-    CurrentTpl = gBS->RaiseTPL (EFI_TPL_HIGH_LEVEL);\r
+    CurrentTpl = gBS->RaiseTPL (TPL_HIGH_LEVEL);\r
     for (Index = 1; Index < 16; Index++) {\r
       InsertTailList (&mRecordsBuffer, &Record[Index].Node);\r
     }\r
@@ -86,12 +86,12 @@ AcquireRecordBuffer (
 \r
 \r
 /**\r
-  Retrieve one record from Records FIFO. The record would be removed from FIFO and \r
+  Retrieve one record from Records FIFO. The record would be removed from FIFO and\r
   release to free record buffer.\r
 \r
   @return   !NULL   Point to record, which is ready to be logged.\r
   @return   NULL    the FIFO of record is empty.\r
\r
+\r
 **/\r
 STATIC\r
 DATAHUB_STATUSCODE_RECORD *\r
@@ -103,7 +103,7 @@ RetrieveRecord (
   LIST_ENTRY                  *Node;\r
   EFI_TPL                     CurrentTpl;\r
 \r
-  CurrentTpl = gBS->RaiseTPL (EFI_TPL_HIGH_LEVEL);\r
+  CurrentTpl = gBS->RaiseTPL (TPL_HIGH_LEVEL);\r
 \r
   if (!IsListEmpty (&mRecordsFifo)) {\r
     Node = GetFirstNode (&mRecordsFifo);\r
@@ -122,29 +122,29 @@ RetrieveRecord (
 \r
 /**\r
   Report status code into DataHub.\r
\r
+\r
   @param  CodeType      Indicates the type of status code being reported.  Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below.\r
\r
-  @param  Value         Describes the current status of a hardware or software entity.  \r
-                        This included information about the class and subclass that is used to classify the entity \r
-                        as well as an operation.  For progress codes, the operation is the current activity. \r
-                        For error codes, it is the exception.  For debug codes, it is not defined at this time. \r
-                        Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below.  \r
+\r
+  @param  Value         Describes the current status of a hardware or software entity.\r
+                        This included information about the class and subclass that is used to classify the entity\r
+                        as well as an operation.  For progress codes, the operation is the current activity.\r
+                        For error codes, it is the exception.  For debug codes, it is not defined at this time.\r
+                        Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below.\r
                         Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification.\r
\r
-  @param  Instance      The enumeration of a hardware or software entity within the system.  \r
-                        A system may contain multiple entities that match a class/subclass pairing. \r
-                        The instance differentiates between them.  An instance of 0 indicates that instance information is unavailable, \r
+\r
+  @param  Instance      The enumeration of a hardware or software entity within the system.\r
+                        A system may contain multiple entities that match a class/subclass pairing.\r
+                        The instance differentiates between them.  An instance of 0 indicates that instance information is unavailable,\r
                         not meaningful, or not relevant.  Valid instance numbers start with 1.\r
 \r
 \r
-  @param  CallerId      This optional parameter may be used to identify the caller. \r
-                        This parameter allows the status code driver to apply different rules to different callers. \r
+  @param  CallerId      This optional parameter may be used to identify the caller.\r
+                        This parameter allows the status code driver to apply different rules to different callers.\r
                         Type EFI_GUID is defined in InstallProtocolInterface() in the EFI 1.10 Specification.\r
 \r
 \r
   @param  Data          This optional parameter may be used to pass additional data\r
\r
+\r
   @retval EFI_OUT_OF_RESOURCES   Can not acquire record buffer.\r
   @retval EFI_DEVICE_ERROR       EFI serial device can not work after ExitBootService() is called .\r
   @retval EFI_SUCCESS            Success to cache status code and signal log data event.\r
@@ -212,7 +212,7 @@ DataHubStatusCodeReportWorker (
 \r
       if (Data->Size > EFI_STATUS_CODE_DATA_MAX_SIZE) {\r
         Record->Data.Size = EFI_STATUS_CODE_DATA_MAX_SIZE;\r
-      } \r
+      }\r
       CopyMem (Record->ExtendData, Data + 1, Record->Data.Size);\r
     }\r
   }\r
@@ -276,7 +276,7 @@ LogDataHubEventCallBack (
     //\r
     // Log DataRecord in Data Hub\r
     //\r
-    \r
+\r
     mDataHubProtocol->LogData (\r
                         mDataHubProtocol,\r
                         &gEfiStatusCodeGuid,\r
@@ -293,7 +293,7 @@ LogDataHubEventCallBack (
 /**\r
   Initialize data hubstatus code.\r
   Create a data hub listener.\r
\r
+\r
   @return  The function always return EFI_SUCCESS\r
 \r
 **/\r
@@ -315,8 +315,8 @@ DataHubStatusCodeInitializeWorker (
   // Create a Notify Event to log data in Data Hub\r
   //\r
   Status = gBS->CreateEvent (\r
-                  EFI_EVENT_NOTIFY_SIGNAL,\r
-                  EFI_TPL_CALLBACK,\r
+                  EVT_NOTIFY_SIGNAL,\r
+                  TPL_CALLBACK,\r
                   LogDataHubEventCallBack,\r
                   NULL,\r
                   &mLogDataHubEvent\r