]> git.proxmox.com Git - mirror_edk2.git/blame - SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Dxe.c
SourceLevelDebugPkg: Convert all .uni files to utf-8
[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
4 Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>\r
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
33 VOID *Buf;\r
34 \r
35 Buf = NULL;\r
36 \r
37 if (gBS != NULL) {\r
38 Buf = (VOID *)(UINTN)0xFFFFFFFF;\r
39 gBS->AllocatePages (\r
40 AllocateMaxAddress,\r
41 EfiACPIMemoryNVS,\r
42 EFI_SIZE_TO_PAGES (BufferSize),\r
43 (EFI_PHYSICAL_ADDRESS *) &Buf\r
44 );\r
45 }\r
46\r
47 return Buf;\r
48}\r