summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Library/PiDxeS3BootScriptLib/InternalBootScriptLib.h
diff options
context:
space:
mode:
authorStar Zeng <star.zeng@intel.com>2016-08-08 13:20:58 +0300
committerStar Zeng <star.zeng@intel.com>2016-09-05 13:15:46 +0300
commit3d20524af09243e3b2e3e832d1c62975e84a5dcd (patch)
treebe10568b17fdb25604aab1beb9952eacfe90533c /MdeModulePkg/Library/PiDxeS3BootScriptLib/InternalBootScriptLib.h
parent3a03e95edaa617625feaf575f58a24d2add990ba (diff)
downloadedk2-3d20524af09243e3b2e3e832d1c62975e84a5dcd.tar.xz
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 <jiewen.yao@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Amy Chan <amy.chan@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com> Tested-by: Laszlo Ersek <lersek@redhat.com>
Diffstat (limited to 'MdeModulePkg/Library/PiDxeS3BootScriptLib/InternalBootScriptLib.h')
-rw-r--r--MdeModulePkg/Library/PiDxeS3BootScriptLib/InternalBootScriptLib.h18
1 files changed, 10 insertions, 8 deletions
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.<BR>
+ Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions
@@ -33,7 +33,7 @@
#include <Library/PcdLib.h>
#include <Library/SmbusLib.h>
#include <Library/IoLib.h>
-#include <Library/PciLib.h>
+#include <Library/PciSegmentLib.h>
#include <Library/DebugLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/TimerLib.h>
@@ -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;