Index: /trunk/src/VBox/Devices/Samples/DevPlayground.cpp
===================================================================
--- /trunk/src/VBox/Devices/Samples/DevPlayground.cpp	(revision 87306)
+++ /trunk/src/VBox/Devices/Samples/DevPlayground.cpp	(revision 87307)
@@ -63,4 +63,6 @@
     /** The MMIO region \#2 handle. */
     IOMMMIOHANDLE   hMmio2;
+    /** Backing storage. */
+    uint8_t         abBacking[4096];
 } VBOXPLAYGROUNDDEVICEFUNCTION;
 /** Pointer to a PCI function of the playground device. */
@@ -86,22 +88,46 @@
 *********************************************************************************************************************************/
 
+/**
+ * @callback_method_impl{FNIOMMMIONEWREAD}
+ */
 static DECLCALLBACK(VBOXSTRICTRC) devPlaygroundMMIORead(PPDMDEVINS pDevIns, void *pvUser, RTGCPHYS off, void *pv, unsigned cb)
 {
+    PVBOXPLAYGROUNDDEVICEFUNCTION pFun = (PVBOXPLAYGROUNDDEVICEFUNCTION)pvUser;
     NOREF(pDevIns);
-    NOREF(pvUser);
-    NOREF(off);
-    NOREF(pv);
-    NOREF(cb);
-    return VINF_SUCCESS;
-}
-
-
+
+#ifdef LOG_ENABLED
+    unsigned const cbLog  = cb;
+    RTGCPHYS       offLog = off;
+#endif
+    uint8_t *pbDst = (uint8_t *)pv;
+    while (cb-- > 0)
+    {
+        *pbDst = pFun->abBacking[off % RT_ELEMENTS(pFun->abBacking)];
+        pbDst++;
+        off++;
+    }
+
+    Log(("DevPlayGr/[%u]: READ  off=%RGv cb=%u: %.*Rhxs\n", pFun->iFun, offLog, cbLog, cbLog, pv));
+    return VINF_SUCCESS;
+}
+
+
+/**
+ * @callback_method_impl{FNIOMMMIONEWWRITE}
+ */
 static DECLCALLBACK(VBOXSTRICTRC) devPlaygroundMMIOWrite(PPDMDEVINS pDevIns, void *pvUser, RTGCPHYS off, void const *pv, unsigned cb)
 {
+    PVBOXPLAYGROUNDDEVICEFUNCTION pFun = (PVBOXPLAYGROUNDDEVICEFUNCTION)pvUser;
     NOREF(pDevIns);
-    NOREF(pvUser);
-    NOREF(off);
-    NOREF(pv);
-    NOREF(cb);
+    Log(("DevPlayGr/[%u]: WRITE off=%RGv cb=%u: %.*Rhxs\n", pFun->iFun, off, cb, cb, pv));
+
+    uint8_t const *pbSrc = (uint8_t const *)pv;
+    while (cb-- > 0)
+    {
+        pFun->abBacking[off % RT_ELEMENTS(pFun->abBacking)] = *pbSrc;
+        pbSrc++;
+        off++;
+    }
+
     return VINF_SUCCESS;
 }
@@ -143,5 +169,5 @@
     }
 #else
-RT_NOREF(pSSM, pHlp);
+    pHlp->pfnSSMPutStrZ(pSSM, "playground");
 #endif
 
@@ -292,5 +318,5 @@
         RTStrPrintf(pFun->szMmio0, sizeof(pFun->szMmio0), "PG-F%d-BAR0", iPciFun);
         rc = PDMDevHlpMmioCreate(pDevIns, cbFirst, pPciDev, 0 /*iPciRegion*/,
-                                 devPlaygroundMMIOWrite, devPlaygroundMMIORead, NULL /*pvUser*/,
+                                 devPlaygroundMMIOWrite, devPlaygroundMMIORead, pFun,
                                  IOMMMIO_FLAGS_READ_PASSTHRU | IOMMMIO_FLAGS_WRITE_PASSTHRU, pFun->szMmio0, &pFun->hMmio0);
         AssertLogRelRCReturn(rc, rc);
@@ -306,5 +332,5 @@
         RTStrPrintf(pFun->szMmio2, sizeof(pFun->szMmio2), "PG-F%d-BAR2", iPciFun);
         rc = PDMDevHlpMmioCreate(pDevIns, cbSecond, pPciDev, 2 << 16 /*iPciRegion*/,
-                                 devPlaygroundMMIOWrite, devPlaygroundMMIORead, NULL /*pvUser*/,
+                                 devPlaygroundMMIOWrite, devPlaygroundMMIORead, pFun,
                                  IOMMMIO_FLAGS_READ_PASSTHRU | IOMMMIO_FLAGS_WRITE_PASSTHRU, pFun->szMmio2, &pFun->hMmio2);
         AssertLogRelRCReturn(rc, rc);
