]> git.proxmox.com Git - mirror_edk2.git/blobdiff - SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Dxe.c
Revert "DebugUsb3: Support IOMMU"
[mirror_edk2.git] / SourceLevelDebugPkg / Library / DebugCommunicationLibUsb3 / DebugCommunicationLibUsb3Dxe.c
index c232323df878d14c559359e4370a85e065841264..c4a8a476829957b5e16c741f31db96e5ecf5cdd8 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Debug Port Library implementation based on usb3 debug port.\r
 \r
-  Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2014 - 2016, 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
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -30,18 +30,23 @@ AllocateAlignBuffer (
   IN UINTN                    BufferSize\r
   )\r
 {\r
-  VOID      *Buf;\r
+  EFI_PHYSICAL_ADDRESS    TmpAddr;\r
+  EFI_STATUS              Status;\r
+  VOID                    *Buf;\r
   \r
   Buf = NULL;\r
   \r
   if (gBS != NULL) {\r
-    Buf = (VOID *)(UINTN)0xFFFFFFFF;\r
-    gBS->AllocatePages (\r
-           AllocateMaxAddress,\r
-           EfiACPIMemoryNVS,\r
-           EFI_SIZE_TO_PAGES (BufferSize),\r
-           (EFI_PHYSICAL_ADDRESS *) &Buf\r
-           );\r
+    TmpAddr = 0xFFFFFFFF;\r
+    Status = gBS->AllocatePages (\r
+               AllocateMaxAddress,\r
+               EfiACPIMemoryNVS,\r
+               EFI_SIZE_TO_PAGES (BufferSize),\r
+               &TmpAddr\r
+               );\r
+    if (!EFI_ERROR (Status)) {\r
+      Buf = (VOID *) (UINTN) TmpAddr;\r
+    }\r
   }\r
 \r
   return Buf;\r