]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Universal/DataHubDxe/DataHub.c
Reviewed the code comments in the Include/Protocol directory for typos, grammar issue...
[mirror_edk2.git] / IntelFrameworkModulePkg / Universal / DataHubDxe / DataHub.c
index ac86f74edfc4cd31d50e4955e335c7215f2b9538..a2e991a28876d59cf7cfffce6ccd86acb23bf19b 100644 (file)
@@ -26,17 +26,22 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 CONST EFI_GUID gZeroGuid  = { 0, 0, 0, { 0, 0, 0, 0, 0, 0, 0, 0 } };\r
 \r
+//\r
+// Module Global:\r
+//  Since this driver will only ever produce one instance of the Logging Hub\r
+//  protocol you are not required to dynamically allocate the PrivateData.\r
+//\r
+DATA_HUB_INSTANCE mPrivateData;\r
+\r
 //\r
 // Worker functions private to this file\r
 //\r
-STATIC\r
 DATA_HUB_FILTER_DRIVER  *\r
 FindFilterDriverByEvent (\r
   IN  LIST_ENTRY      *Head,\r
   IN  EFI_EVENT       Event\r
   );\r
 \r
-STATIC\r
 EFI_DATA_RECORD_HEADER  *\r
 GetNextDataRecord (\r
   IN  LIST_ENTRY          *Head,\r
@@ -59,7 +64,6 @@ GetNextDataRecord (
   @retval EFI_OUT_OF_RESOURCES  - If data was not logged due to lack of system \r
                                   resources.\r
 **/\r
-STATIC\r
 EFI_STATUS\r
 EFIAPI\r
 DataHubLogData (\r
@@ -193,7 +197,6 @@ DataHubLogData (
   @retval EFI_OUT_OF_RESOURCES    - Record was not returned due to lack of system resources.\r
 \r
 **/\r
-STATIC\r
 EFI_STATUS\r
 EFIAPI\r
 DataHubGetNextRecord (\r
@@ -240,19 +243,22 @@ DataHubGetNextRecord (
       // Use the MTC from the Filter Driver.\r
       //\r
       FilterMonotonicCount = FilterDriver->GetNextMonotonicCount;\r
+       \r
+      //\r
+      // The GetNextMonotonicCount field remembers the last value from the previous time.\r
+      // But we already processed this vaule, so we need to find the next one.\r
+      //\r
+      *Record = GetNextDataRecord (&Private->DataListHead, ClassFilter, &FilterMonotonicCount);\r
       if (FilterMonotonicCount != 0) {\r
+        *MonotonicCount = FilterMonotonicCount;\r
+      }\r
+      \r
+      if ((FilterDriver->GetNextMonotonicCount != 0) && (FilterMonotonicCount == 0)) {\r
         //\r
-        // The GetNextMonotonicCount field remembers the last value from the previous time.\r
-        // But we already processed this vaule, so we need to find the next one.\r
+        // If there is no new record to get exit now.\r
         //\r
-        *Record         = GetNextDataRecord (&Private->DataListHead, ClassFilter, &FilterMonotonicCount);\r
-        *MonotonicCount = FilterMonotonicCount;\r
-        if (FilterMonotonicCount == 0) {\r
-          //\r
-          // If there is no new record to get exit now.\r
-          //\r
-          return EFI_NOT_FOUND;\r
-        }\r
+        *MonotonicCount = 0;\r
+        return EFI_NOT_FOUND;\r
       }\r
     }\r
   }\r
@@ -314,7 +320,6 @@ DataHubGetNextRecord (
                             system resources.\r
 \r
 **/\r
-STATIC\r
 EFI_STATUS\r
 EFIAPI\r
 DataHubRegisterFilterDriver (\r
@@ -393,7 +398,6 @@ DataHubRegisterFilterDriver (
   @retval EFI_NOT_FOUND - If FilterEvent does not exist\r
 \r
 **/\r
-STATIC\r
 EFI_STATUS\r
 EFIAPI\r
 DataHubUnregisterFilterDriver (\r
@@ -441,7 +445,6 @@ DataHubUnregisterFilterDriver (
   @retval NULL - If Event is not in the list\r
 \r
 **/\r
-STATIC\r
 DATA_HUB_FILTER_DRIVER *\r
 FindFilterDriverByEvent (\r
   IN  LIST_ENTRY      *Head,\r
@@ -479,7 +482,6 @@ FindFilterDriverByEvent (
   @retval NULL - If no data record exists.\r
 \r
 **/\r
-STATIC\r
 EFI_DATA_RECORD_HEADER *\r
 GetNextDataRecord (\r
   IN  LIST_ENTRY          *Head,\r
@@ -539,12 +541,6 @@ GetNextDataRecord (
 \r
   return Record;\r
 }\r
-//\r
-// Module Global:\r
-//  Since this driver will only ever produce one instance of the Logging Hub\r
-//  protocol you are not required to dynamically allocate the PrivateData.\r
-//\r
-DATA_HUB_INSTANCE mPrivateData;\r
 \r
 /**\r
 \r