]> git.proxmox.com Git - mirror_edk2.git/blame - SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Dxe.c
Revert "DebugUsb3: Support IOMMU"
[mirror_edk2.git] / SourceLevelDebugPkg / Library / DebugCommunicationLibUsb3 / DebugCommunicationLibUsb3Dxe.c
CommitLineData
2cb6eabe
EL
1/** @file\r
2 Debug Port Library implementation based on usb3 debug port.\r
3\r
1f279e7a 4 Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.<BR>\r
2cb6eabe
EL
5 This program and the accompanying materials\r
6 are licensed and made available under the terms and conditions of the BSD License\r
7 which accompanies this distribution. The full text of the license may be found at\r
8 http://opensource.org/licenses/bsd-license.php.\r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
15#include <Base.h>\r
16#include <PiDxe.h>\r
17#include <Library/UefiBootServicesTableLib.h>\r
18#include "DebugCommunicationLibUsb3Internal.h"\r
19\r
20/**\r
21 Allocate aligned memory for XHC's usage.\r
22\r
23 @param BufferSize The size, in bytes, of the Buffer.\r
24 \r
25 @return A pointer to the allocated buffer or NULL if allocation fails.\r
26\r
27**/\r
28VOID*\r
29AllocateAlignBuffer (\r
30 IN UINTN BufferSize\r
31 )\r
32{\r
95055567
ED
33 EFI_PHYSICAL_ADDRESS TmpAddr;\r
34 EFI_STATUS Status;\r
35 VOID *Buf;\r
2cb6eabe
EL
36 \r
37 Buf = NULL;\r
38 \r
39 if (gBS != NULL) {\r
95055567
ED
40 TmpAddr = 0xFFFFFFFF;\r
41 Status = gBS->AllocatePages (\r
42 AllocateMaxAddress,\r
43 EfiACPIMemoryNVS,\r
44 EFI_SIZE_TO_PAGES (BufferSize),\r
45 &TmpAddr\r
46 );\r
47 if (!EFI_ERROR (Status)) {\r
48 Buf = (VOID *) (UINTN) TmpAddr;\r
49 }\r
2cb6eabe
EL
50 }\r
51\r
52 return Buf;\r
53}\r