Index: /trunk/src/VBox/Devices/Input/PS2M.cpp
===================================================================
--- /trunk/src/VBox/Devices/Input/PS2M.cpp	(revision 68099)
+++ /trunk/src/VBox/Devices/Input/PS2M.cpp	(revision 68100)
@@ -105,5 +105,4 @@
 #define IN_PS2M
 #include "PS2Dev.h"
-
 
 /*********************************************************************************************************************************
@@ -296,4 +295,11 @@
 #ifndef VBOX_DEVICE_STRUCT_TESTCASE
 
+
+/*********************************************************************************************************************************
+*   Test code function declarations                                                                                              *
+*********************************************************************************************************************************/
+#if defined(RT_STRICT) && defined(IN_RING3)
+static void ps2mTestAccumulation(void);
+#endif
 
 /*********************************************************************************************************************************
@@ -998,8 +1004,266 @@
 }
 
+/* -=-=-=-=-=- Mouse: IMousePort  -=-=-=-=-=- */
+
+/**
+ * @interface_method_impl{PDMIMOUSEPORT,pfnPutEvent}
+ */
+static DECLCALLBACK(int) ps2mPutEvent(PPDMIMOUSEPORT pInterface, int32_t dx, int32_t dy,
+                                      int32_t dz, int32_t dw, uint32_t fButtons)
+{
+    PPS2M       pThis = RT_FROM_MEMBER(pInterface, PS2M, Mouse.IPort);
+    int rc = PDMCritSectEnter(pThis->pCritSectR3, VERR_SEM_BUSY);
+    AssertReleaseRC(rc);
+
+    LogRelFlowFunc(("dX=%d dY=%d dZ=%d dW=%d buttons=%02X\n", dx, dy, dz, dw, fButtons));
+    /* NB: The PS/2 Y axis direction is inverted relative to ours. */
+    ps2mPutEventWorker(pThis, dx, -dy, dz, dw, fButtons);
+
+    PDMCritSectLeave(pThis->pCritSectR3);
+    return VINF_SUCCESS;
+}
+
+/**
+ * @interface_method_impl{PDMIMOUSEPORT,pfnPutEventAbs}
+ */
+static DECLCALLBACK(int) ps2mPutEventAbs(PPDMIMOUSEPORT pInterface, uint32_t x, uint32_t y,
+                                         int32_t dz, int32_t dw, uint32_t fButtons)
+{
+    AssertFailedReturn(VERR_NOT_SUPPORTED);
+    NOREF(pInterface); NOREF(x); NOREF(y); NOREF(dz); NOREF(dw); NOREF(fButtons);
+}
+
+/**
+ * @interface_method_impl{PDMIMOUSEPORT,pfnPutEventMultiTouch}
+ */
+static DECLCALLBACK(int) ps2mPutEventMT(PPDMIMOUSEPORT pInterface, uint8_t cContacts,
+                                        const uint64_t *pau64Contacts, uint32_t u32ScanTime)
+{
+    AssertFailedReturn(VERR_NOT_SUPPORTED);
+    NOREF(pInterface); NOREF(cContacts); NOREF(pau64Contacts); NOREF(u32ScanTime);
+}
+
+
+
+/**
+ * Attach command.
+ *
+ * This is called to let the device attach to a driver for a
+ * specified LUN.
+ *
+ * This is like plugging in the mouse after turning on the
+ * system.
+ *
+ * @returns VBox status code.
+ * @param   pThis       The PS/2 auxiliary device instance data.
+ * @param   pDevIns     The device instance.
+ * @param   iLUN        The logical unit which is being detached.
+ * @param   fFlags      Flags, combination of the PDMDEVATT_FLAGS_* \#defines.
+ */
+int PS2MAttach(PPS2M pThis, PPDMDEVINS pDevIns, unsigned iLUN, uint32_t fFlags)
+{
+    int         rc;
+
+    /* The LUN must be 1, i.e. mouse. */
+    Assert(iLUN == 1);
+    AssertMsgReturn(fFlags & PDM_TACH_FLAGS_NOT_HOT_PLUG,
+                    ("PS/2 mouse does not support hotplugging\n"),
+                    VERR_INVALID_PARAMETER);
+
+    LogFlowFunc(("iLUN=%d\n", iLUN));
+
+    rc = PDMDevHlpDriverAttach(pDevIns, iLUN, &pThis->Mouse.IBase, &pThis->Mouse.pDrvBase, "Mouse Port");
+    if (RT_SUCCESS(rc))
+    {
+        pThis->Mouse.pDrv = PDMIBASE_QUERY_INTERFACE(pThis->Mouse.pDrvBase, PDMIMOUSECONNECTOR);
+        if (!pThis->Mouse.pDrv)
+        {
+            AssertLogRelMsgFailed(("LUN #1 doesn't have a mouse interface! rc=%Rrc\n", rc));
+            rc = VERR_PDM_MISSING_INTERFACE;
+        }
+    }
+    else if (rc == VERR_PDM_NO_ATTACHED_DRIVER)
+    {
+        Log(("%s/%d: warning: no driver attached to LUN #1!\n", pDevIns->pReg->szName, pDevIns->iInstance));
+        rc = VINF_SUCCESS;
+    }
+    else
+        AssertLogRelMsgFailed(("Failed to attach LUN #1! rc=%Rrc\n", rc));
+
+    return rc;
+}
+
+void PS2MSaveState(PPS2M pThis, PSSMHANDLE pSSM)
+{
+    LogFlowFunc(("Saving PS2M state\n"));
+
+    /* Save the core auxiliary device state. */
+    SSMR3PutU8(pSSM, pThis->u8State);
+    SSMR3PutU8(pSSM, pThis->u8SampleRate);
+    SSMR3PutU8(pSSM, pThis->u8Resolution);
+    SSMR3PutU8(pSSM, pThis->u8CurrCmd);
+    SSMR3PutU8(pSSM, pThis->enmMode);
+    SSMR3PutU8(pSSM, pThis->enmProtocol);
+    SSMR3PutU8(pSSM, pThis->enmKnockState);
+
+    /* Save the command and event queues. */
+    ps2kSaveQueue(pSSM, (GeneriQ *)&pThis->cmdQ);
+    ps2kSaveQueue(pSSM, (GeneriQ *)&pThis->evtQ);
+
+    /* Save the command delay timer. Note that the rate throttling
+     * timer is *not* saved.
+     */
+    TMR3TimerSave(pThis->CTX_SUFF(pDelayTimer), pSSM);
+}
+
+int PS2MLoadState(PPS2M pThis, PSSMHANDLE pSSM, uint32_t uVersion)
+{
+    uint8_t     u8;
+    int         rc;
+
+    NOREF(uVersion);
+    LogFlowFunc(("Loading PS2M state version %u\n", uVersion));
+
+    /* Load the basic auxiliary device state. */
+    SSMR3GetU8(pSSM, &pThis->u8State);
+    SSMR3GetU8(pSSM, &pThis->u8SampleRate);
+    SSMR3GetU8(pSSM, &pThis->u8Resolution);
+    SSMR3GetU8(pSSM, &pThis->u8CurrCmd);
+    SSMR3GetU8(pSSM, &u8);
+    pThis->enmMode       = (PS2M_MODE)u8;
+    SSMR3GetU8(pSSM, &u8);
+    pThis->enmProtocol   = (PS2M_PROTO)u8;
+    SSMR3GetU8(pSSM, &u8);
+    pThis->enmKnockState = (PS2M_KNOCK_STATE)u8;
+
+    /* Load the command and event queues. */
+    rc = ps2kLoadQueue(pSSM, (GeneriQ *)&pThis->cmdQ);
+    AssertRCReturn(rc, rc);
+    rc = ps2kLoadQueue(pSSM, (GeneriQ *)&pThis->evtQ);
+    AssertRCReturn(rc, rc);
+
+    /* Load the command delay timer, just in case. */
+    rc = TMR3TimerLoad(pThis->CTX_SUFF(pDelayTimer), pSSM);
+    AssertRCReturn(rc, rc);
+
+    /* Recalculate the throttling delay. */
+    ps2mSetRate(pThis, pThis->u8SampleRate);
+
+    ps2mSetDriverState(pThis, !!(pThis->u8State & AUX_STATE_ENABLED));
+
+    return rc;
+}
+
+void PS2MFixupState(PPS2M pThis, uint8_t u8State, uint8_t u8Rate, uint8_t u8Proto)
+{
+    LogFlowFunc(("Fixing up old PS2M state version\n"));
+
+    /* Load the basic auxiliary device state. */
+    pThis->u8State      = u8State;
+    pThis->u8SampleRate = u8Rate ? u8Rate : 40; /* In case it wasn't saved right. */
+    pThis->enmProtocol  = (PS2M_PROTO)u8Proto;
+
+    /* Recalculate the throttling delay. */
+    ps2mSetRate(pThis, pThis->u8SampleRate);
+
+    ps2mSetDriverState(pThis, !!(pThis->u8State & AUX_STATE_ENABLED));
+}
+
+void PS2MReset(PPS2M pThis)
+{
+    LogFlowFunc(("Resetting PS2M\n"));
+
+    pThis->u8CurrCmd         = 0;
+
+    /* Clear the queues. */
+    ps2kClearQueue((GeneriQ *)&pThis->cmdQ);
+    ps2mSetDefaults(pThis);     /* Also clears event queue. */
+
+    /* Activate the PS/2 mouse by default. */
+//    if (pThis->Mouse.pDrv)
+//        pThis->Mouse.pDrv->pfnSetActive(pThis->Mouse.pDrv, true);
+}
+
+void PS2MRelocate(PPS2M pThis, RTGCINTPTR offDelta, PPDMDEVINS pDevIns)
+{
+    RT_NOREF2(pDevIns, offDelta);
+    LogFlowFunc(("Relocating PS2M\n"));
+    pThis->pDelayTimerRC    = TMTimerRCPtr(pThis->pDelayTimerR3);
+    pThis->pThrottleTimerRC = TMTimerRCPtr(pThis->pThrottleTimerR3);
+}
+
+int PS2MConstruct(PPS2M pThis, PPDMDEVINS pDevIns, void *pParent, int iInstance)
+{
+    RT_NOREF1(iInstance);
+
+    LogFlowFunc(("iInstance=%d\n", iInstance));
+
 #ifdef RT_STRICT
+    ps2mTestAccumulation();
+#endif
+
+    pThis->pParent = pParent;
+
+    /* Initialize the queues. */
+    pThis->evtQ.cSize = AUX_EVT_QUEUE_SIZE;
+    pThis->cmdQ.cSize = AUX_CMD_QUEUE_SIZE;
+
+    pThis->Mouse.IBase.pfnQueryInterface     = ps2mQueryInterface;
+    pThis->Mouse.IPort.pfnPutEvent           = ps2mPutEvent;
+    pThis->Mouse.IPort.pfnPutEventAbs        = ps2mPutEventAbs;
+    pThis->Mouse.IPort.pfnPutEventMultiTouch = ps2mPutEventMT;
+
+    /*
+     * Initialize the critical section pointer(s).
+     */
+    pThis->pCritSectR3 = pDevIns->pCritSectRoR3;
+
+    /*
+     * Create the input rate throttling timer. Does not use virtual time!
+     */
+    PTMTIMER pTimer;
+    int rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_REAL, ps2mThrottleTimer, pThis,
+                                    TMTIMER_FLAGS_DEFAULT_CRIT_SECT, "PS2M Throttle Timer", &pTimer);
+    if (RT_FAILURE(rc))
+        return rc;
+
+    pThis->pThrottleTimerR3 = pTimer;
+    pThis->pThrottleTimerR0 = TMTimerR0Ptr(pTimer);
+    pThis->pThrottleTimerRC = TMTimerRCPtr(pTimer);
+
+    /*
+     * Create the command delay timer.
+     */
+    rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL, ps2mDelayTimer, pThis,
+                                TMTIMER_FLAGS_DEFAULT_CRIT_SECT, "PS2M Delay Timer", &pTimer);
+    if (RT_FAILURE(rc))
+        return rc;
+
+    pThis->pDelayTimerR3 = pTimer;
+    pThis->pDelayTimerR0 = TMTimerR0Ptr(pTimer);
+    pThis->pDelayTimerRC = TMTimerRCPtr(pTimer);
+
+    /*
+     * Register debugger info callbacks.
+     */
+    PDMDevHlpDBGFInfoRegister(pDevIns, "ps2m", "Display PS/2 mouse state.", ps2mInfoState);
+
+    /// @todo Where should we do this?
+    ps2mSetDriverState(pThis, true);
+    pThis->u8State = 0;
+    pThis->enmMode = AUX_MODE_STD;
+
+    return rc;
+}
+
+#endif
+
+#if defined(RT_STRICT) && defined(IN_RING3)
+/* -=-=-=-=-=- Test code  -=-=-=-=-=- */
+
 /** Test the event accumulation mechanism which we use to delay events going
- * to the guest to one per 50ms.  This test depends on ps2mPutEventWorker() not
- * touching the timer if This.fThrottleActive is true. */
+ * to the guest to one per 10ms (the default PS/2 mouse event rate).  This
+ * test depends on ps2mPutEventWorker() not touching the timer if
+ * This.fThrottleActive is true. */
 /** @todo if we add any more tests it might be worth using a table of test
  * operations and checks. */
@@ -1016,5 +1280,5 @@
     This.fThrottleActive = true;
     /* Certain Windows touch pad drivers report a double tap as a press, then
-     * a release-press-release all within a single 50ms interval.  Simulate
+     * a release-press-release all within a single 10ms interval.  Simulate
      * this to check that it is handled right. */
     ps2mPutEventWorker(&This, 0, 0, 0, 0, 1);
@@ -1058,260 +1322,5 @@
     Assert(rc != VINF_SUCCESS);
 }
-#endif /* RT_STRICT */
-
-/* -=-=-=-=-=- Mouse: IMousePort  -=-=-=-=-=- */
-
-/**
- * @interface_method_impl{PDMIMOUSEPORT,pfnPutEvent}
- */
-static DECLCALLBACK(int) ps2mPutEvent(PPDMIMOUSEPORT pInterface, int32_t dx, int32_t dy,
-                                      int32_t dz, int32_t dw, uint32_t fButtons)
-{
-    PPS2M       pThis = RT_FROM_MEMBER(pInterface, PS2M, Mouse.IPort);
-    int rc = PDMCritSectEnter(pThis->pCritSectR3, VERR_SEM_BUSY);
-    AssertReleaseRC(rc);
-
-    LogRelFlowFunc(("dX=%d dY=%d dZ=%d dW=%d buttons=%02X\n", dx, dy, dz, dw, fButtons));
-    /* NB: The PS/2 Y axis direction is inverted relative to ours. */
-    ps2mPutEventWorker(pThis, dx, -dy, dz, dw, fButtons);
-
-    PDMCritSectLeave(pThis->pCritSectR3);
-    return VINF_SUCCESS;
-}
-
-/**
- * @interface_method_impl{PDMIMOUSEPORT,pfnPutEventAbs}
- */
-static DECLCALLBACK(int) ps2mPutEventAbs(PPDMIMOUSEPORT pInterface, uint32_t x, uint32_t y,
-                                         int32_t dz, int32_t dw, uint32_t fButtons)
-{
-    AssertFailedReturn(VERR_NOT_SUPPORTED);
-    NOREF(pInterface); NOREF(x); NOREF(y); NOREF(dz); NOREF(dw); NOREF(fButtons);
-}
-
-/**
- * @interface_method_impl{PDMIMOUSEPORT,pfnPutEventMultiTouch}
- */
-static DECLCALLBACK(int) ps2mPutEventMT(PPDMIMOUSEPORT pInterface, uint8_t cContacts,
-                                        const uint64_t *pau64Contacts, uint32_t u32ScanTime)
-{
-    AssertFailedReturn(VERR_NOT_SUPPORTED);
-    NOREF(pInterface); NOREF(cContacts); NOREF(pau64Contacts); NOREF(u32ScanTime);
-}
-
-
-
-/**
- * Attach command.
- *
- * This is called to let the device attach to a driver for a
- * specified LUN.
- *
- * This is like plugging in the mouse after turning on the
- * system.
- *
- * @returns VBox status code.
- * @param   pThis       The PS/2 auxiliary device instance data.
- * @param   pDevIns     The device instance.
- * @param   iLUN        The logical unit which is being detached.
- * @param   fFlags      Flags, combination of the PDMDEVATT_FLAGS_* \#defines.
- */
-int PS2MAttach(PPS2M pThis, PPDMDEVINS pDevIns, unsigned iLUN, uint32_t fFlags)
-{
-    int         rc;
-
-    /* The LUN must be 1, i.e. mouse. */
-    Assert(iLUN == 1);
-    AssertMsgReturn(fFlags & PDM_TACH_FLAGS_NOT_HOT_PLUG,
-                    ("PS/2 mouse does not support hotplugging\n"),
-                    VERR_INVALID_PARAMETER);
-
-    LogFlowFunc(("iLUN=%d\n", iLUN));
-
-    rc = PDMDevHlpDriverAttach(pDevIns, iLUN, &pThis->Mouse.IBase, &pThis->Mouse.pDrvBase, "Mouse Port");
-    if (RT_SUCCESS(rc))
-    {
-        pThis->Mouse.pDrv = PDMIBASE_QUERY_INTERFACE(pThis->Mouse.pDrvBase, PDMIMOUSECONNECTOR);
-        if (!pThis->Mouse.pDrv)
-        {
-            AssertLogRelMsgFailed(("LUN #1 doesn't have a mouse interface! rc=%Rrc\n", rc));
-            rc = VERR_PDM_MISSING_INTERFACE;
-        }
-    }
-    else if (rc == VERR_PDM_NO_ATTACHED_DRIVER)
-    {
-        Log(("%s/%d: warning: no driver attached to LUN #1!\n", pDevIns->pReg->szName, pDevIns->iInstance));
-        rc = VINF_SUCCESS;
-    }
-    else
-        AssertLogRelMsgFailed(("Failed to attach LUN #1! rc=%Rrc\n", rc));
-
-    return rc;
-}
-
-void PS2MSaveState(PPS2M pThis, PSSMHANDLE pSSM)
-{
-    LogFlowFunc(("Saving PS2M state\n"));
-
-    /* Save the core auxiliary device state. */
-    SSMR3PutU8(pSSM, pThis->u8State);
-    SSMR3PutU8(pSSM, pThis->u8SampleRate);
-    SSMR3PutU8(pSSM, pThis->u8Resolution);
-    SSMR3PutU8(pSSM, pThis->u8CurrCmd);
-    SSMR3PutU8(pSSM, pThis->enmMode);
-    SSMR3PutU8(pSSM, pThis->enmProtocol);
-    SSMR3PutU8(pSSM, pThis->enmKnockState);
-
-    /* Save the command and event queues. */
-    ps2kSaveQueue(pSSM, (GeneriQ *)&pThis->cmdQ);
-    ps2kSaveQueue(pSSM, (GeneriQ *)&pThis->evtQ);
-
-    /* Save the command delay timer. Note that the rate throttling
-     * timer is *not* saved.
-     */
-    TMR3TimerSave(pThis->CTX_SUFF(pDelayTimer), pSSM);
-}
-
-int PS2MLoadState(PPS2M pThis, PSSMHANDLE pSSM, uint32_t uVersion)
-{
-    uint8_t     u8;
-    int         rc;
-
-    NOREF(uVersion);
-    LogFlowFunc(("Loading PS2M state version %u\n", uVersion));
-
-    /* Load the basic auxiliary device state. */
-    SSMR3GetU8(pSSM, &pThis->u8State);
-    SSMR3GetU8(pSSM, &pThis->u8SampleRate);
-    SSMR3GetU8(pSSM, &pThis->u8Resolution);
-    SSMR3GetU8(pSSM, &pThis->u8CurrCmd);
-    SSMR3GetU8(pSSM, &u8);
-    pThis->enmMode       = (PS2M_MODE)u8;
-    SSMR3GetU8(pSSM, &u8);
-    pThis->enmProtocol   = (PS2M_PROTO)u8;
-    SSMR3GetU8(pSSM, &u8);
-    pThis->enmKnockState = (PS2M_KNOCK_STATE)u8;
-
-    /* Load the command and event queues. */
-    rc = ps2kLoadQueue(pSSM, (GeneriQ *)&pThis->cmdQ);
-    AssertRCReturn(rc, rc);
-    rc = ps2kLoadQueue(pSSM, (GeneriQ *)&pThis->evtQ);
-    AssertRCReturn(rc, rc);
-
-    /* Load the command delay timer, just in case. */
-    rc = TMR3TimerLoad(pThis->CTX_SUFF(pDelayTimer), pSSM);
-    AssertRCReturn(rc, rc);
-
-    /* Recalculate the throttling delay. */
-    ps2mSetRate(pThis, pThis->u8SampleRate);
-
-    ps2mSetDriverState(pThis, !!(pThis->u8State & AUX_STATE_ENABLED));
-
-    return rc;
-}
-
-void PS2MFixupState(PPS2M pThis, uint8_t u8State, uint8_t u8Rate, uint8_t u8Proto)
-{
-    LogFlowFunc(("Fixing up old PS2M state version\n"));
-
-    /* Load the basic auxiliary device state. */
-    pThis->u8State      = u8State;
-    pThis->u8SampleRate = u8Rate ? u8Rate : 40; /* In case it wasn't saved right. */
-    pThis->enmProtocol  = (PS2M_PROTO)u8Proto;
-
-    /* Recalculate the throttling delay. */
-    ps2mSetRate(pThis, pThis->u8SampleRate);
-
-    ps2mSetDriverState(pThis, !!(pThis->u8State & AUX_STATE_ENABLED));
-}
-
-void PS2MReset(PPS2M pThis)
-{
-    LogFlowFunc(("Resetting PS2M\n"));
-
-    pThis->u8CurrCmd         = 0;
-
-    /* Clear the queues. */
-    ps2kClearQueue((GeneriQ *)&pThis->cmdQ);
-    ps2mSetDefaults(pThis);     /* Also clears event queue. */
-
-    /* Activate the PS/2 mouse by default. */
-//    if (pThis->Mouse.pDrv)
-//        pThis->Mouse.pDrv->pfnSetActive(pThis->Mouse.pDrv, true);
-}
-
-void PS2MRelocate(PPS2M pThis, RTGCINTPTR offDelta, PPDMDEVINS pDevIns)
-{
-    RT_NOREF2(pDevIns, offDelta);
-    LogFlowFunc(("Relocating PS2M\n"));
-    pThis->pDelayTimerRC    = TMTimerRCPtr(pThis->pDelayTimerR3);
-    pThis->pThrottleTimerRC = TMTimerRCPtr(pThis->pThrottleTimerR3);
-}
-
-int PS2MConstruct(PPS2M pThis, PPDMDEVINS pDevIns, void *pParent, int iInstance)
-{
-    RT_NOREF1(iInstance);
-
-    LogFlowFunc(("iInstance=%d\n", iInstance));
-
-#ifdef RT_STRICT
-    ps2mTestAccumulation();
-#endif
-
-    pThis->pParent = pParent;
-
-    /* Initialize the queues. */
-    pThis->evtQ.cSize = AUX_EVT_QUEUE_SIZE;
-    pThis->cmdQ.cSize = AUX_CMD_QUEUE_SIZE;
-
-    pThis->Mouse.IBase.pfnQueryInterface     = ps2mQueryInterface;
-    pThis->Mouse.IPort.pfnPutEvent           = ps2mPutEvent;
-    pThis->Mouse.IPort.pfnPutEventAbs        = ps2mPutEventAbs;
-    pThis->Mouse.IPort.pfnPutEventMultiTouch = ps2mPutEventMT;
-
-    /*
-     * Initialize the critical section pointer(s).
-     */
-    pThis->pCritSectR3 = pDevIns->pCritSectRoR3;
-
-    /*
-     * Create the input rate throttling timer. Does not use virtual time!
-     */
-    PTMTIMER pTimer;
-    int rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_REAL, ps2mThrottleTimer, pThis,
-                                    TMTIMER_FLAGS_DEFAULT_CRIT_SECT, "PS2M Throttle Timer", &pTimer);
-    if (RT_FAILURE(rc))
-        return rc;
-
-    pThis->pThrottleTimerR3 = pTimer;
-    pThis->pThrottleTimerR0 = TMTimerR0Ptr(pTimer);
-    pThis->pThrottleTimerRC = TMTimerRCPtr(pTimer);
-
-    /*
-     * Create the command delay timer.
-     */
-    rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL, ps2mDelayTimer, pThis,
-                                TMTIMER_FLAGS_DEFAULT_CRIT_SECT, "PS2M Delay Timer", &pTimer);
-    if (RT_FAILURE(rc))
-        return rc;
-
-    pThis->pDelayTimerR3 = pTimer;
-    pThis->pDelayTimerR0 = TMTimerR0Ptr(pTimer);
-    pThis->pDelayTimerRC = TMTimerRCPtr(pTimer);
-
-    /*
-     * Register debugger info callbacks.
-     */
-    PDMDevHlpDBGFInfoRegister(pDevIns, "ps2m", "Display PS/2 mouse state.", ps2mInfoState);
-
-    /// @todo Where should we do this?
-    ps2mSetDriverState(pThis, true);
-    pThis->u8State = 0;
-    pThis->enmMode = AUX_MODE_STD;
-
-    return rc;
-}
-
-#endif
+#endif /* RT_STRICT && IN_RING3 */
 
 #endif /* !VBOX_DEVICE_STRUCT_TESTCASE */
