Index: trunk/src/VBox/VMM/PDMDevHlp.cpp
===================================================================
--- trunk/src/VBox/VMM/PDMDevHlp.cpp	(revision 12981)
+++ trunk/src/VBox/VMM/PDMDevHlp.cpp	(revision 12982)
@@ -47,6 +47,6 @@
 *   Defined Constants And Macros                                               *
 *******************************************************************************/
-/*
- * Allow physical read and writes from any thread
+/** Allow physical read and writes from any thread.
+ * (pdmR3DevHlp_PhysRead and pdmR3DevHlp_PhysWrite.)
  */
 #define PDM_PHYS_READWRITE_FROM_ANY_THREAD
Index: trunk/src/VBox/VMM/PDMDevMiscHlp.cpp
===================================================================
--- trunk/src/VBox/VMM/PDMDevMiscHlp.cpp	(revision 12981)
+++ trunk/src/VBox/VMM/PDMDevMiscHlp.cpp	(revision 12982)
@@ -50,8 +50,9 @@
     LogFlow(("pdmR3PicHlp_SetInterruptFF: caller='%s'/%d: VM_FF_INTERRUPT_PIC %d -> 1\n",
              pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, VMCPU_FF_ISSET(pVM, 0, VM_FF_INTERRUPT_PIC)));
+
     /* for PIC we always deliver to CPU 0, MP use APIC */
     VMCPU_FF_SET(pVM, 0, VM_FF_INTERRUPT_PIC);
     REMR3NotifyInterruptSet(pVM);
-    VMR3NotifyFF(pVM, true);
+    VMR3NotifyFF(pVM, true); /** @todo SMP: notify the right cpu. */
 }
 
@@ -63,4 +64,5 @@
     LogFlow(("pdmR3PicHlp_ClearInterruptFF: caller='%s'/%d: VM_FF_INTERRUPT_PIC %d -> 0\n",
              pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, VMCPU_FF_ISSET(pDevIns->Internal.s.pVMR3, 0, VM_FF_INTERRUPT_PIC)));
+
     /* for PIC we always deliver to CPU 0, MP use APIC */
     VMCPU_FF_CLEAR(pDevIns->Internal.s.pVMR3, 0, VM_FF_INTERRUPT_PIC);
@@ -144,9 +146,10 @@
     PDMDEV_ASSERT_DEVINS(pDevIns);
     PVM pVM = pDevIns->Internal.s.pVMR3;
-    LogFlow(("pdmR3ApicHlp_SetInterruptFF: caller='%s'/%d: VM_FF_INTERRUPT %d -> 1\n",
-             pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, VMCPU_FF_ISSET(pVM, idCpu, VM_FF_INTERRUPT_APIC)));
+    LogFlow(("pdmR3ApicHlp_SetInterruptFF: caller='%s'/%d: VM_FF_INTERRUPT(%d) %d -> 1\n",
+             pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, idCpu, VMCPU_FF_ISSET(pVM, idCpu, VM_FF_INTERRUPT_APIC)));
+
     VMCPU_FF_SET(pVM, idCpu, VM_FF_INTERRUPT_APIC);
     REMR3NotifyInterruptSet(pVM);
-    VMR3NotifyFF(pVM, true);
+    VMR3NotifyFF(pVM, true);  /** @todo SMP: notify the right cpu. */
 }
 
@@ -156,6 +159,7 @@
 {
     PDMDEV_ASSERT_DEVINS(pDevIns);
-    LogFlow(("pdmR3ApicHlp_ClearInterruptFF: caller='%s'/%d: VM_FF_INTERRUPT %d -> 0\n",
-             pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, VMCPU_FF_ISSET(pDevIns->Internal.s.pVMR3, idCpu, VM_FF_INTERRUPT_APIC)));
+    LogFlow(("pdmR3ApicHlp_ClearInterruptFF: caller='%s'/%d: VM_FF_INTERRUPT(%d) %d -> 0\n",
+             pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, idCpu, VMCPU_FF_ISSET(pDevIns->Internal.s.pVMR3, idCpu, VM_FF_INTERRUPT_APIC)));
+
     VMCPU_FF_CLEAR(pDevIns->Internal.s.pVMR3, idCpu, VM_FF_INTERRUPT_APIC);
     REMR3NotifyInterruptClear(pDevIns->Internal.s.pVMR3);
@@ -192,4 +196,5 @@
 {
     PDMDEV_ASSERT_DEVINS(pDevIns);
+    LogFlow(("pdmR3ApicHlp_Lock: caller='%s'/%d: rc=%Rrc\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, rc));
     return pdmLockEx(pDevIns->Internal.s.pVMR3, rc);
 }
@@ -200,4 +205,5 @@
 {
     PDMDEV_ASSERT_DEVINS(pDevIns);
+    LogFlow(("pdmR3ApicHlp_Unlock: caller='%s'/%d:\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance));
     pdmUnlock(pDevIns->Internal.s.pVMR3);
 }
@@ -285,4 +291,5 @@
 {
     PDMDEV_ASSERT_DEVINS(pDevIns);
+    LogFlow(("pdmR3IoApicHlp_Lock: caller='%s'/%d: rc=%Rrc\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, rc));
     return pdmLockEx(pDevIns->Internal.s.pVMR3, rc);
 }
@@ -293,4 +300,5 @@
 {
     PDMDEV_ASSERT_DEVINS(pDevIns);
+    LogFlow(("pdmR3IoApicHlp_Unlock: caller='%s'/%d:\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance));
     pdmUnlock(pDevIns->Internal.s.pVMR3);
 }
@@ -383,4 +391,5 @@
 {
     PDMDEV_ASSERT_DEVINS(pDevIns);
+    LogFlow(("pdmR3PciHlp_Lock: caller='%s'/%d: rc=%Rrc\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, rc));
     return pdmLockEx(pDevIns->Internal.s.pVMR3, rc);
 }
@@ -391,4 +400,5 @@
 {
     PDMDEV_ASSERT_DEVINS(pDevIns);
+    LogFlow(("pdmR3PciHlp_Unlock: caller='%s'/%d:\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance));
     pdmUnlock(pDevIns->Internal.s.pVMR3);
 }
Index: trunk/src/VBox/VMM/PDMDevice.cpp
===================================================================
--- trunk/src/VBox/VMM/PDMDevice.cpp	(revision 12981)
+++ trunk/src/VBox/VMM/PDMDevice.cpp	(revision 12982)
@@ -65,5 +65,8 @@
     /** VM Handle. */
     PVM             pVM;
-} PDMDEVREGCBINT, *PPDMDEVREGCBINT;
+} PDMDEVREGCBINT;
+/** Pointer to a PDMDEVREGCBINT structure. */
+typedef PDMDEVREGCBINT *PPDMDEVREGCBINT;
+/** Pointer to a const PDMDEVREGCBINT structure. */
 typedef const PDMDEVREGCBINT *PCPDMDEVREGCBINT;
 
@@ -72,18 +75,9 @@
 *   Internal Functions                                                         *
 *******************************************************************************/
-__BEGIN_DECLS
 static DECLCALLBACK(int)    pdmR3DevReg_Register(PPDMDEVREGCB pCallbacks, PCPDMDEVREG pDevReg);
 static DECLCALLBACK(void *) pdmR3DevReg_MMHeapAlloc(PPDMDEVREGCB pCallbacks, size_t cb);
-
-static int pdmR3DevLoadModules(PVM pVM);
-static int pdmR3DevLoad(PVM pVM, PPDMDEVREGCBINT pRegCB, const char *pszFilename, const char *pszName);
-
-
-/*
- * Allow physical read and writes from any thread
- */
-#define PDM_PHYS_READWRITE_FROM_ANY_THREAD
-
-__END_DECLS
+static int                  pdmR3DevLoadModules(PVM pVM);
+static int                  pdmR3DevLoad(PVM pVM, PPDMDEVREGCBINT pRegCB, const char *pszFilename, const char *pszName);
+
 
 
@@ -594,5 +588,4 @@
 
 
-
 /**
  * Registers a device with the current VM instance.
