]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiDpLib/DpTrace.c
ShellPkg/UefiDpLib: Support execution break
[mirror_edk2.git] / ShellPkg / Library / UefiDpLib / DpTrace.c
index 22b83d0917dfc2267a53dcff64f0a59ca2835b70..c1074d5b7a0465e39718196ca33095cf5e60067e 100644 (file)
@@ -136,8 +136,11 @@ GatherStatistics(
   @param[in]    Limit       The number of records to print.  Zero is ALL.\r
   @param[in]    ExcludeFlag TRUE to exclude individual Cumulative items from display.\r
   \r
+  @retval EFI_SUCCESS           The operation was successful.\r
+  @retval EFI_ABORTED           The user aborts the operation.\r
+  @return Others                from a call to gBS->LocateHandleBuffer().\r
 **/\r
-VOID\r
+EFI_STATUS\r
 DumpAllTrace(\r
   IN UINTN             Limit,\r
   IN BOOLEAN           ExcludeFlag\r
@@ -257,12 +260,18 @@ DumpAllTrace(
           ElapsedTime\r
         );\r
       }\r
+      if (ShellGetExecutionBreakFlag ()) {\r
+        Status = EFI_ABORTED;\r
+        break;\r
+      }\r
     }\r
   }\r
   if (HandleBuffer != NULL) {\r
     FreePool (HandleBuffer);\r
   }\r
   SHELL_FREE_NON_NULL (IncFlag);\r
+\r
+  return Status;\r
 }\r
 \r
 /** \r
@@ -281,9 +290,11 @@ DumpAllTrace(
   \r
   @param[in]    Limit       The number of records to print.  Zero is ALL.\r
   @param[in]    ExcludeFlag TRUE to exclude individual Cumulative items from display.\r
-  \r
+\r
+  @retval EFI_SUCCESS           The operation was successful.\r
+  @retval EFI_ABORTED           The user aborts the operation.\r
 **/\r
-VOID\r
+EFI_STATUS\r
 DumpRawTrace(\r
   IN UINTN          Limit,\r
   IN BOOLEAN        ExcludeFlag\r
@@ -298,6 +309,9 @@ DumpRawTrace(
 \r
   EFI_STRING    StringPtr;\r
   EFI_STRING    StringPtrUnknown;\r
+  EFI_STATUS    Status;\r
+\r
+  Status = EFI_SUCCESS;\r
 \r
   StringPtrUnknown = HiiGetString (gDpHiiHandle, STRING_TOKEN (STR_ALIT_UNKNOWN), NULL);  \r
   StringPtr = HiiGetString (gDpHiiHandle, STRING_TOKEN (STR_DP_SECTION_RAWTRACE), NULL);\r
@@ -361,7 +375,12 @@ DumpRawTrace(
         Measurement.Module\r
       );\r
     }\r
+    if (ShellGetExecutionBreakFlag ()) {\r
+      Status = EFI_ABORTED;\r
+      break;\r
+    }\r
   }\r
+  return Status;\r
 }\r
 \r
 /** \r
@@ -510,7 +529,9 @@ ProcessPhases(
   \r
   @param[in]    ExcludeFlag   TRUE to exclude individual Cumulative items from display.\r
   \r
-  @return       Status from a call to gBS->LocateHandle().\r
+  @retval EFI_SUCCESS             The operation was successful.\r
+  @retval EFI_ABORTED             The user aborts the operation.\r
+  @return Others                  from a call to gBS->LocateHandleBuffer().\r
 **/\r
 EFI_STATUS\r
 ProcessHandles(\r
@@ -606,6 +627,10 @@ ProcessHandles(
           );\r
         }\r
       }\r
+      if (ShellGetExecutionBreakFlag ()) {\r
+        Status = EFI_ABORTED;\r
+        break;\r
+      }\r
     }\r
   }\r
   if (HandleBuffer != NULL) {\r
@@ -619,8 +644,10 @@ ProcessHandles(
   \r
   Only prints complete PEIM records\r
   \r
+  @retval EFI_SUCCESS           The operation was successful.\r
+  @retval EFI_ABORTED           The user aborts the operation.\r
 **/\r
-VOID\r
+EFI_STATUS\r
 ProcessPeims(\r
   VOID\r
 )\r
@@ -632,6 +659,9 @@ ProcessPeims(
   UINTN                     LogEntryKey;\r
   UINTN                     TIndex;\r
   EFI_STRING                StringPtrUnknown;\r
+  EFI_STATUS                Status;\r
+\r
+  Status = EFI_SUCCESS;\r
 \r
   StringPtrUnknown = HiiGetString (gDpHiiHandle, STRING_TOKEN (STR_ALIT_UNKNOWN), NULL);  \r
   StringPtr = HiiGetString (gDpHiiHandle, STRING_TOKEN (STR_DP_SECTION_PEIMS), NULL);\r
@@ -685,7 +715,12 @@ ProcessPeims(
         );\r
       }\r
     }\r
+    if (ShellGetExecutionBreakFlag ()) {\r
+      Status = EFI_ABORTED;\r
+      break;\r
+    }\r
   }\r
+  return Status;\r
 }\r
 \r
 /** \r
@@ -696,8 +731,10 @@ ProcessPeims(
   Increment TIndex for every record, even skipped ones, so that we have an\r
   indication of every measurement record taken.\r
   \r
+  @retval EFI_SUCCESS           The operation was successful.\r
+  @retval EFI_ABORTED           The user aborts the operation.\r
 **/\r
-VOID\r
+EFI_STATUS\r
 ProcessGlobal(\r
   VOID\r
 )\r
@@ -709,6 +746,9 @@ ProcessGlobal(
   UINTN                     LogEntryKey;\r
   UINTN                     Index;        // Index, or number, of the measurement record being processed\r
   EFI_STRING                StringPtrUnknown;\r
+  EFI_STATUS                Status;\r
+\r
+  Status = EFI_SUCCESS;\r
 \r
   StringPtrUnknown = HiiGetString (gDpHiiHandle, STRING_TOKEN (STR_ALIT_UNKNOWN), NULL);  \r
   StringPtr = HiiGetString (gDpHiiHandle, STRING_TOKEN (STR_DP_SECTION_GENERAL), NULL);\r
@@ -766,8 +806,13 @@ ProcessGlobal(
         }\r
       }\r
     }\r
+    if (ShellGetExecutionBreakFlag ()) {\r
+      Status = EFI_ABORTED;\r
+      break;\r
+    }\r
     Index++;\r
   }\r
+  return Status;  //*HP_ISS_EDK2_CONTRIUTION\r
 }\r
 \r
 /** \r