Index: trunk/src/VBox/Devices/Bus/DevPCI.cpp
===================================================================
--- trunk/src/VBox/Devices/Bus/DevPCI.cpp	(revision 64422)
+++ trunk/src/VBox/Devices/Bus/DevPCI.cpp	(revision 64423)
@@ -3,12 +3,9 @@
  * DevPCI - PCI BUS Device.
  *
- * @remarks New code is currently added to DevPciMerge1.cpp.h, the goal is
- *          to end up with a large common code base for the two PCI bus
- *          implementations.  The merge file will soon be compiled separately
- *          and not included, so it shall not be used as a template with
- *          \#ifdefs for different PCI bus configs, but rather use config
- *          flags in the structures to select paths & feature sets.
- *
- *          When moving code, always prefer the ICH9 version, not this!
+ * @remarks New code shall be added to DevPciIch9.cpp as that will become
+ *          the common PCI bus code soon.  Don't fix code in both DevPCI.cpp
+ *          and DevPciIch9.cpp when it's possible to just make the latter
+ *          version common.   Common code uses the 'devpci' prefix, is
+ *          prototyped in DevPciInternal.h, and is defined in DevPciIch9.cpp.
  */
 
@@ -1821,24 +1818,4 @@
 /* -=-=-=-=-=- PDMDEVREG  -=-=-=-=-=- */
 
-/**
- * @interface_method_impl{PDMDEVREG,pfnRelocate}
- */
-static DECLCALLBACK(void) pciR3Relocate(PPDMDEVINS pDevIns, RTGCINTPTR offDelta)
-{
-    PDEVPCIROOT pGlobals = PDMINS_2_DATA(pDevIns, PDEVPCIROOT);
-    PDEVPCIBUS     pBus     = &pGlobals->PciBus;
-    pGlobals->pDevInsRC = PDMDEVINS_2_RCPTR(pDevIns);
-
-    pBus->pPciHlpRC = pBus->pPciHlpR3->pfnGetRCHelpers(pDevIns);
-    pBus->pDevInsRC = PDMDEVINS_2_RCPTR(pDevIns);
-
-    /* Relocate RC pointers for the attached pci devices. */
-    for (uint32_t i = 0; i < RT_ELEMENTS(pBus->apDevices); i++)
-    {
-        if (pBus->apDevices[i])
-            pBus->apDevices[i]->Int.s.pBusRC += offDelta;
-    }
-}
-
 
 /**
@@ -2041,5 +2018,5 @@
     NULL,
     /* pfnRelocate */
-    pciR3Relocate,
+    devpciR3RootRelocate,
     /* pfnMemSetup */
     NULL,
@@ -2212,21 +2189,4 @@
 
 /**
- * @interface_method_impl{PDMDEVREG,pfnRelocate}
- */
-static DECLCALLBACK(void) pcibridgeR3Relocate(PPDMDEVINS pDevIns, RTGCINTPTR offDelta)
-{
-    PDEVPCIBUS pBus = PDMINS_2_DATA(pDevIns, PDEVPCIBUS);
-    pBus->pDevInsRC = PDMDEVINS_2_RCPTR(pDevIns);
-
-    /* Relocate RC pointers for the attached pci devices. */
-    for (uint32_t i = 0; i < RT_ELEMENTS(pBus->apDevices); i++)
-    {
-        if (pBus->apDevices[i])
-            pBus->apDevices[i]->Int.s.pBusRC += offDelta;
-    }
-}
-
-
-/**
  * @interface_method_impl{PDMDEVREG,pfnConstruct}
  */
@@ -2376,5 +2336,5 @@
     NULL,
     /* pfnRelocate */
-    pcibridgeR3Relocate,
+    devpciR3BusRelocate,
     /* pfnMemSetup */
     NULL,
Index: trunk/src/VBox/Devices/Bus/DevPciIch9.cpp
===================================================================
--- trunk/src/VBox/Devices/Bus/DevPciIch9.cpp	(revision 64422)
+++ trunk/src/VBox/Devices/Bus/DevPciIch9.cpp	(revision 64423)
@@ -3,12 +3,10 @@
  * DevPCI - ICH9 southbridge PCI bus emulation device.
  *
- * @remarks New code is currently added to DevPciMerge1.cpp.h, the goal is
- *          to end up with a large common code base for the two PCI bus
- *          implementations.  The merge file will soon be compiled separately
- *          and not included, so it shall not be used as a template with
- *          \#ifdefs for different PCI bus configs, but rather use config
- *          flags in the structures to select paths & feature sets.
+ * @remarks We'll be slowly promoting the code in this file to common PCI bus
+ *          code.   Function without 'static' and using 'devpci' as prefix is
+ *          also used by DevPCI.cpp and have a prototype in DevPciInternal.h.
  *
- *          When moving code, always prefer the ICH9 version (this file)!
+ *          For the time being the DevPciMerge1.cpp.h file will remain separate,
+ *          due to 5.1.  We can merge it into this one later in the dev cycle.
  */
 
@@ -2554,31 +2552,41 @@
 }
 
-static void ich9pciRelocateDevice(PPDMPCIDEV pDev, RTGCINTPTR offDelta)
-{
-    if (pDev)
-    {
-        pDev->Int.s.pBusRC += offDelta;
-        if (pDev->Int.s.pMsixPageRC)
-            pDev->Int.s.pMsixPageRC += offDelta;
-    }
-}
 
 /**
- * @copydoc FNPDMDEVRELOCATE
- */
-static DECLCALLBACK(void) ich9pciRelocate(PPDMDEVINS pDevIns, RTGCINTPTR offDelta)
-{
-    PDEVPCIROOT pGlobals = PDMINS_2_DATA(pDevIns, PDEVPCIROOT);
-    PDEVPCIBUS     pBus     = &pGlobals->PciBus;
-    pGlobals->pDevInsRC = PDMDEVINS_2_RCPTR(pDevIns);
-
+ * @interface_method_impl{PDMDEVREG,pfnRelocate}
+ */
+DECLCALLBACK(void) devpciR3BusRelocate(PPDMDEVINS pDevIns, RTGCINTPTR offDelta)
+{
+    PDEVPCIBUS pBus = PDMINS_2_DATA(pDevIns, PDEVPCIBUS);
+
+    pBus->pDevInsRC = PDMDEVINS_2_RCPTR(pDevIns);
     pBus->pPciHlpRC = pBus->pPciHlpR3->pfnGetRCHelpers(pDevIns);
-    pBus->pDevInsRC = PDMDEVINS_2_RCPTR(pDevIns);
 
     /* Relocate RC pointers for the attached pci devices. */
     for (uint32_t i = 0; i < RT_ELEMENTS(pBus->apDevices); i++)
-        ich9pciRelocateDevice(pBus->apDevices[i], offDelta);
-
-}
+    {
+        PPDMPCIDEV pDev = pBus->apDevices[i];
+        if (pDev)
+        {
+            pDev->Int.s.pBusRC += offDelta;
+            if (pDev->Int.s.pMsixPageRC)
+                pDev->Int.s.pMsixPageRC += offDelta;
+        }
+    }
+}
+
+
+/**
+ * @interface_method_impl{PDMDEVREG,pfnRelocate}
+ */
+DECLCALLBACK(void) devpciR3RootRelocate(PPDMDEVINS pDevIns, RTGCINTPTR offDelta)
+{
+    PDEVPCIROOT pGlobals = PDMINS_2_DATA(pDevIns, PDEVPCIROOT);
+    pGlobals->pDevInsRC = PDMDEVINS_2_RCPTR(pDevIns);
+
+    AssertCompileMemberOffset(DEVPCIROOT, PciBus, 0);
+    devpciR3BusRelocate(pDevIns, offDelta);
+}
+
 
 /**
@@ -2729,16 +2737,4 @@
 
 
-/**
- * @copydoc FNPDMDEVRELOCATE
- */
-static DECLCALLBACK(void) ich9pcibridgeRelocate(PPDMDEVINS pDevIns, RTGCINTPTR offDelta)
-{
-    PDEVPCIBUS pBus = PDMINS_2_DATA(pDevIns, PDEVPCIBUS);
-    pBus->pDevInsRC = PDMDEVINS_2_RCPTR(pDevIns);
-
-    /* Relocate RC pointers for the attached pci devices. */
-    for (uint32_t i = 0; i < RT_ELEMENTS(pBus->apDevices); i++)
-        ich9pciRelocateDevice(pBus->apDevices[i], offDelta);
-}
 
 /**
@@ -2770,5 +2766,5 @@
     NULL,
     /* pfnRelocate */
-    ich9pciRelocate,
+    devpciR3RootRelocate,
     /* pfnMemSetup */
     NULL,
@@ -2826,5 +2822,5 @@
     NULL,
     /* pfnRelocate */
-    ich9pcibridgeRelocate,
+    devpciR3BusRelocate,
     /* pfnMemSetup */
     NULL,
Index: trunk/src/VBox/Devices/Bus/DevPciInternal.h
===================================================================
--- trunk/src/VBox/Devices/Bus/DevPciInternal.h	(revision 64422)
+++ trunk/src/VBox/Devices/Bus/DevPciInternal.h	(revision 64423)
@@ -181,4 +181,7 @@
 
 
+DECLCALLBACK(void) devpciR3RootRelocate(PPDMDEVINS pDevIns, RTGCINTPTR offDelta);
+DECLCALLBACK(void) devpciR3BusRelocate(PPDMDEVINS pDevIns, RTGCINTPTR offDelta);
+
 #endif
 
Index: trunk/src/VBox/Devices/Bus/DevPciMerge1.cpp.h
===================================================================
--- trunk/src/VBox/Devices/Bus/DevPciMerge1.cpp.h	(revision 64422)
+++ trunk/src/VBox/Devices/Bus/DevPciMerge1.cpp.h	(revision 64423)
@@ -1,9 +1,9 @@
 /* $Id$ */
 /** @file
- * DevPci - Common code that is included by both DevPci and DevPciIch9.
- *
- * @note All the code in this file is written by us!
- * @note No #ifdefs, use instant data booleans/flags/whatever.  Goal is to
- *       completely merge these files!
+ * DevPci - Early attempt at common code for DevPci and DevPciIch9.
+ *
+ * @note    Don't add more, add code to DevPciIch9.cpp instead.
+ * @note    We'll keep this file like this for a little while longer
+ *          because of 5.1.
  */
 
