From 2cb6eabe0b358fe0d4e4dd602f84b5f5d3e39a6c Mon Sep 17 00:00:00 2001 From: Elvin Li Date: Wed, 22 Oct 2014 05:01:58 +0000 Subject: Add DebugCommunicationLibUsb3 for USB3.0 source level debug support. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Elvin Li Reviewed-by: Ruiyu Ni Reviewed-by: Feng Tian Reviewed-by: Jeff Fan git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16224 6f19259b-4bc3-4df7-8a09-765794883524 --- .../DebugCommunicationLibUsb3Dxe.c | 48 ++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Dxe.c (limited to 'SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Dxe.c') diff --git a/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Dxe.c b/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Dxe.c new file mode 100644 index 0000000000..c232323df8 --- /dev/null +++ b/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Dxe.c @@ -0,0 +1,48 @@ +/** @file + Debug Port Library implementation based on usb3 debug port. + + Copyright (c) 2014, Intel Corporation. All rights reserved.
+ This program and the accompanying materials + are licensed and made available under the terms and conditions of the BSD License + which accompanies this distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php. + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +**/ + +#include +#include +#include +#include "DebugCommunicationLibUsb3Internal.h" + +/** + Allocate aligned memory for XHC's usage. + + @param BufferSize The size, in bytes, of the Buffer. + + @return A pointer to the allocated buffer or NULL if allocation fails. + +**/ +VOID* +AllocateAlignBuffer ( + IN UINTN BufferSize + ) +{ + VOID *Buf; + + Buf = NULL; + + if (gBS != NULL) { + Buf = (VOID *)(UINTN)0xFFFFFFFF; + gBS->AllocatePages ( + AllocateMaxAddress, + EfiACPIMemoryNVS, + EFI_SIZE_TO_PAGES (BufferSize), + (EFI_PHYSICAL_ADDRESS *) &Buf + ); + } + + return Buf; +} -- cgit v1.2.3