\r
#define PCI_HOST_BRIDGE_FROM_THIS(a) CR (a, PCI_HOST_BRIDGE_INSTANCE, ResAlloc, PCI_HOST_BRIDGE_SIGNATURE)\r
\r
+//\r
+// Macros to translate device address to host address and vice versa. According\r
+// to UEFI 2.7, device address = host address + translation offset.\r
+//\r
+#define TO_HOST_ADDRESS(DeviceAddress,TranslationOffset) ((DeviceAddress) - (TranslationOffset))\r
+#define TO_DEVICE_ADDRESS(HostAddress,TranslationOffset) ((HostAddress) + (TranslationOffset))\r
+\r
//\r
// Driver Entry Point\r
//\r
IN PCI_HOST_BRIDGE_INSTANCE *HostBridge\r
);\r
\r
+/**\r
+ This routine gets translation offset from a root bridge instance by resource type.\r
+\r
+ @param RootBridge The Root Bridge Instance for the resources.\r
+ @param ResourceType The Resource Type of the translation offset.\r
+\r
+ @retval The Translation Offset of the specified resource.\r
+**/\r
+UINT64\r
+GetTranslationByResourceType (\r
+ IN PCI_ROOT_BRIDGE_INSTANCE *RootBridge,\r
+ IN PCI_RESOURCE_TYPE ResourceType\r
+ );\r
+\r
extern EFI_METRONOME_ARCH_PROTOCOL *mMetronome;\r
extern EFI_CPU_IO2_PROTOCOL *mCpuIo;\r
#endif\r