From 3d20524af09243e3b2e3e832d1c62975e84a5dcd Mon Sep 17 00:00:00 2001 From: Star Zeng Date: Mon, 8 Aug 2016 18:20:58 +0800 Subject: MdeModulePkg PiDxeS3BootScriptLib: Support multiple PCI segment Support multiple PCI segment for PCI_CONFIG2 opcodes. PiDxeS3BootScriptLib needs to be updated to consume PciSegmentLib instead of PciLib. That means platforms need to add PciSegmentLib declaration like below in platform dsc if the PciSegmentLib was not declared in platform dsc before. PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf For platforms only have one segment, MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf is recommended to be used and declared in platform dsc for PiDxeS3BootScriptLib to have equivalent functionality with before. Cc: Jiewen Yao Cc: Michael D Kinney Cc: Amy Chan Cc: Laszlo Ersek Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng Reviewed-by: Jiewen Yao Reviewed-by: Michael Kinney Tested-by: Laszlo Ersek --- .../PiDxeS3BootScriptLib/InternalBootScriptLib.h | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'MdeModulePkg/Library/PiDxeS3BootScriptLib/InternalBootScriptLib.h') diff --git a/MdeModulePkg/Library/PiDxeS3BootScriptLib/InternalBootScriptLib.h b/MdeModulePkg/Library/PiDxeS3BootScriptLib/InternalBootScriptLib.h index 9b150480db..ffbf5d2688 100644 --- a/MdeModulePkg/Library/PiDxeS3BootScriptLib/InternalBootScriptLib.h +++ b/MdeModulePkg/Library/PiDxeS3BootScriptLib/InternalBootScriptLib.h @@ -2,7 +2,7 @@ Support for S3 boot script lib. This file defined some internal macro and internal data structure - Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.
+ Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include #include @@ -45,13 +45,15 @@ #define MAX_IO_ADDRESS 0xFFFF // -// Macro to convert a UEFI PCI address to a PCI Library PCI address +// Macro to convert a UEFI PCI address + segment to a PCI Segment Library PCI address // -#define PCI_ADDRESS_ENCODE(A) (UINTN)PCI_LIB_ADDRESS( \ - ((((UINTN)(A))& 0xff000000) >> 24), ((((UINTN)(A)) &0x00ff0000) >> 16), ((((UINTN)(A)) & 0xff00) >> 8), ((RShiftU64 ((A), 32) & 0xfff) | ((A)& 0xff)) \ - ) - - +#define PCI_ADDRESS_ENCODE(S, A) PCI_SEGMENT_LIB_ADDRESS( \ + S, \ + ((((UINTN)(A)) & 0xff000000) >> 24), \ + ((((UINTN)(A)) & 0x00ff0000) >> 16), \ + ((((UINTN)(A)) & 0xff00) >> 8), \ + ((RShiftU64 ((A), 32) & 0xfff) | ((A) & 0xff)) \ + ) typedef union { UINT8 volatile *Buf; -- cgit v1.2.3