]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiShellDriver1CommandsLib/DevTree.c
Add CTRL+C support for ‘devtree’ command.
[mirror_edk2.git] / ShellPkg / Library / UefiShellDriver1CommandsLib / DevTree.c
index 15487703790d2d8f24f8d45a357c29cfbf14ca4c..d950c8d6c51b9ad78773ae5da3058e245c8e70b0 100644 (file)
@@ -1,6 +1,7 @@
 /** @file\r
   Main file for DevTree shell Driver1 function.\r
 \r
+  Copyright (c) 2014, Hewlett-Packard Development Company, L.P.<BR>\r
   Copyright (c) 2010 - 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
@@ -57,6 +58,12 @@ DoDevTreeForHandle(
   ChildCount          = 0;\r
 \r
   ASSERT(TheHandle    != NULL);\r
+  \r
+  if (ShellGetExecutionBreakFlag()) {\r
+    ShellStatus = SHELL_ABORTED;\r
+    return ShellStatus;\r
+  }\r
+  \r
   //\r
   // We want controller handles.  they will not have LoadedImage or DriverBinding (or others...)\r
   //\r
@@ -119,6 +126,9 @@ DoDevTreeForHandle(
   ParseHandleDatabaseForChildControllers(TheHandle, &ChildCount, &ChildHandleBuffer);\r
   for (LoopVar = 0 ; LoopVar < ChildCount && ShellStatus == SHELL_SUCCESS; LoopVar++){\r
     ShellStatus = DoDevTreeForHandle(ChildHandleBuffer[LoopVar], Lang, UseDevPaths, IndentCharCount+2, HiiString);\r
+    if (ShellStatus == SHELL_ABORTED) {\r
+      break;\r
+    }\r
   }\r
 \r
   if (ChildHandleBuffer != NULL) {\r