/** @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 - 2017, 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
\r
#include <PiPei.h>\r
#include <Library/PeiServicesLib.h>\r
+#include <Ppi/MemoryDiscovered.h>\r
#include "DebugCommunicationLibUsb3Internal.h"\r
\r
/**\r
VOID *Buf;\r
EFI_PHYSICAL_ADDRESS Address;\r
EFI_STATUS Status;\r
- \r
- Buf = NULL; \r
- Status = PeiServicesAllocatePages (EfiACPIMemoryNVS, EFI_SIZE_TO_PAGES (BufferSize), &Address);\r
- if (EFI_ERROR (Status)) {\r
- Buf = NULL;\r
- } else {\r
- Buf = (VOID *)(UINTN) Address;\r
+ VOID *MemoryDiscoveredPpi;\r
+\r
+ Buf = NULL;\r
+\r
+ //\r
+ // Make sure the allocated memory is physical memory.\r
+ //\r
+ Status = PeiServicesLocatePpi (\r
+ &gEfiPeiMemoryDiscoveredPpiGuid,\r
+ 0,\r
+ NULL,\r
+ (VOID **) &MemoryDiscoveredPpi\r
+ );\r
+ if (!EFI_ERROR (Status)) {\r
+ Status = PeiServicesAllocatePages (EfiACPIMemoryNVS, EFI_SIZE_TO_PAGES (BufferSize), &Address);\r
+ if (!EFI_ERROR (Status)) {\r
+ Buf = (VOID *)(UINTN) Address;\r
+ }\r
}\r
return Buf;\r
}\r
## @file\r
# Debug Communication Library instance based on usb3 debug port.\r
#\r
-# Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.<BR>\r
#\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
IntelFrameworkPkg/IntelFrameworkPkg.dec\r
SourceLevelDebugPkg/SourceLevelDebugPkg.dec\r
\r
+[Ppis]\r
+ gEfiPeiMemoryDiscoveredPpiGuid ## CONSUMES\r
+\r
[Pcd]\r
# The memory BAR of ehci host controller, in which usb debug feature is enabled.\r
# Note that the memory BAR address is only used before Pci bus resource allocation.\r