]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EmbeddedPkg/Ebl/EfiDevice.c
Fix more InitializeDebugAgent API change bugs. GDB stub was not turned on in example...
[mirror_edk2.git] / EmbeddedPkg / Ebl / EfiDevice.c
index 4d4cd3f5b7e935cf12067bc37953f730588cc009..2f9a6067267cc4e950000d17ac53bd1f2444f589 100644 (file)
@@ -1,10 +1,10 @@
 /** @file\r
   EBL commands for EFI and PI Devices\r
 \r
-  Copyright (c) 2007, Intel Corporation<BR>\r
-  Portions copyright (c) 2008-2009, Apple Inc. All rights reserved.\r
+  Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
+  Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
 \r
-  All rights reserved. This program and the accompanying materials\r
+  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
@@ -111,24 +111,24 @@ EblPrintBlkIoInfo (
           EfiClose (FsFile);\r
           break;\r
         }\r
+        EfiClose (FsFile);\r
       }\r
-      EfiClose (FsFile);\r
     }\r
   }\r
 \r
   // Print out useful Block IO media properties\r
-  if (File->FsBlockIoMedia.RemovableMedia) {\r
+  if (File->FsBlockIoMedia->RemovableMedia) {\r
     AsciiPrint ("Removable ");\r
   }\r
-  if (!File->FsBlockIoMedia.MediaPresent) {\r
-    AsciiPrint ("No Media ");\r
-  }\r
-  if (File->FsBlockIoMedia.LogicalPartition) {\r
-    AsciiPrint ("Partition ");\r
+  if (!File->FsBlockIoMedia->MediaPresent) {\r
+    AsciiPrint ("No Media\n");\r
+  } else {\r
+    if (File->FsBlockIoMedia->LogicalPartition) {\r
+      AsciiPrint ("Partition ");\r
+    }\r
+    DeviceSize = MultU64x32 (File->FsBlockIoMedia->LastBlock + 1, File->FsBlockIoMedia->BlockSize);\r
+    AsciiPrint ("Size = 0x%lX\n", DeviceSize);\r
   }\r
-  DeviceSize = MultU64x32 (File->FsBlockIoMedia.LastBlock + 1, File->FsBlockIoMedia.BlockSize);\r
-  AsciiPrint ("Size = 0x%lX\n", DeviceSize);\r
-\r
   EfiClose (File);\r
 }\r
 \r
@@ -212,10 +212,11 @@ EblDeviceCmd (
   UINTN         Max;\r
 \r
   CurrentRow = 0;\r
-  \r
+\r
   // Need to call here to make sure Device Counts are valid\r
   EblUpdateDeviceLists ();\r
 \r
+  // Now we can print out the info...\r
   Max = EfiGetDeviceCounts (EfiOpenFirmwareVolume);\r
   if (Max != 0) {\r
     AsciiPrint ("Firmware Volume Devices:\n");\r
@@ -730,7 +731,7 @@ EblFileCopyCmd (
   UINTN         Size;\r
   UINTN         Offset;\r
   UINTN         Chunk = FILE_COPY_CHUNK;\r
-  \r
+\r
   if (Argc < 3) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
@@ -759,13 +760,13 @@ EblFileCopyCmd (
     \r
     Status = EfiRead(Source, Buffer, &Chunk);\r
     if (EFI_ERROR(Status)) {\r
-      AsciiPrint("Read file error\n");\r
+      AsciiPrint("Read file error %r\n", Status);\r
       goto Exit;\r
     }\r
 \r
     Status = EfiWrite(Destination, Buffer, &Chunk);\r
     if (EFI_ERROR(Status)) {\r
-      AsciiPrint("Write file error\n");\r
+      AsciiPrint("Write file error %r\n", Status);\r
       goto Exit;\r
     }    \r
   }\r
@@ -776,17 +777,18 @@ EblFileCopyCmd (
     \r
     Status = EfiRead(Source, Buffer, &Chunk);\r
     if (EFI_ERROR(Status)) {\r
-      AsciiPrint("Read file error\n");\r
+      AsciiPrint("Read file error %r\n", Status);\r
       goto Exit;\r
     }\r
 \r
     Status = EfiWrite(Destination, Buffer, &Chunk);\r
     if (EFI_ERROR(Status)) {\r
-      AsciiPrint("Write file error\n");\r
+      AsciiPrint("Write file error %r\n", Status);\r
       goto Exit;\r
     }    \r
   }\r
 \r
+\r
 Exit:\r
   if (Source != NULL) {\r
     Status = EfiClose(Source);\r
@@ -794,7 +796,6 @@ Exit:
       AsciiPrint("Source close error %r\n", Status);\r
     }\r
   }\r
-  \r
   if (Destination != NULL) {\r
     Status = EfiClose(Destination);\r
     if (EFI_ERROR(Status)) {\r