VirtualBox

Changeset 81627 in vbox


Ignore:
Timestamp:
Nov 1, 2019 9:07:06 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
134384
Message:

VMMDev: Converted to the new PDM device style. [fixes] bugref:9218

Location:
trunk/src/VBox/Devices/VMMDev
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/VMMDev/VMMDev.cpp

    r81625 r81627  
    25422542    return PGMR3SharedModuleGetPageState(PDMDevHlpGetVM(pDevIns), pReq->GCPtrPage, &pReq->fShared, &pReq->uPageFlags);
    25432543# else
    2544     RT_NOREF(pThis);
     2544    RT_NOREF(pDevIns);
    25452545    return VERR_NOT_IMPLEMENTED;
    25462546# endif
     
    43984398     * Clean up the testing device.
    43994399     */
    4400     vmmdevTestingTerminate(pDevIns);
     4400    vmmdevR3TestingTerminate(pDevIns);
    44014401#endif
    44024402
     
    46884688     * Initialize testing.
    46894689     */
    4690     rc = vmmdevTestingInitialize(pDevIns);
     4690    rc = vmmdevR3TestingInitialize(pDevIns);
    46914691    if (RT_FAILURE(rc))
    46924692        return rc;
     
    48314831    rc = PDMDevHlpIoPortSetUpContext(pDevIns, pThis->hIoPortFast, vmmdevFastRequestHandler, vmmdevFastRequestIrqAck, NULL);
    48324832    AssertRCReturn(rc, rc);
     4833
     4834# ifndef VBOX_WITHOUT_TESTING_FEATURES
     4835    /*
     4836     * Initialize testing.
     4837     */
     4838    rc = vmmdevRZTestingInitialize(pDevIns);
     4839    AssertRCReturn(rc, rc);
     4840# endif
    48334841
    48344842    return VINF_SUCCESS;
  • trunk/src/VBox/Devices/VMMDev/VMMDevTesting.cpp

    r81625 r81627  
    685685 * @param   pDevIns             The VMMDev device instance.
    686686 */
    687 void vmmdevTestingTerminate(PPDMDEVINS pDevIns)
     687void vmmdevR3TestingTerminate(PPDMDEVINS pDevIns)
    688688{
    689689    PVMMDEV   pThis   = PDMDEVINS_2_DATA(pDevIns, PVMMDEV);
     
    707707 * @param   pDevIns             The VMMDev device instance.
    708708 */
    709 int vmmdevTestingInitialize(PPDMDEVINS pDevIns)
     709int vmmdevR3TestingInitialize(PPDMDEVINS pDevIns)
    710710{
    711711    PVMMDEV     pThis   = PDMDEVINS_2_DATA(pDevIns, PVMMDEV);
     
    749749}
    750750
    751 #endif /* IN_RING3 */
     751#else  /* !IN_RING3 */
     752
     753/**
     754 * Does the ring-0/raw-mode initialization of the testing part if enabled.
     755 *
     756 * @returns VBox status code.
     757 * @param   pDevIns             The VMMDev device instance.
     758 */
     759int vmmdevRZTestingInitialize(PPDMDEVINS pDevIns)
     760{
     761    PVMMDEV     pThis   = PDMDEVINS_2_DATA(pDevIns, PVMMDEV);
     762    int         rc;
     763
     764    if (!pThis->fTestingEnabled)
     765        return VINF_SUCCESS;
     766
     767    if (pThis->fTestingMMIO)
     768    {
     769        rc = PDMDevHlpMmioSetUpContext(pDevIns, pThis->hMmioTesting, vmmdevTestingMmioWrite, vmmdevTestingMmioRead, NULL);
     770        AssertRCReturn(rc, rc);
     771    }
     772
     773    rc = PDMDevHlpIoPortSetUpContext(pDevIns, pThis->hIoPortTesting, vmmdevTestingIoWrite, vmmdevTestingIoRead, NULL);
     774    AssertRCReturn(rc, rc);
     775
     776    return VINF_SUCCESS;
     777}
     778
     779#endif /* !IN_RING3 */
    752780#endif /* !VBOX_WITHOUT_TESTING_FEATURES */
    753781
  • trunk/src/VBox/Devices/VMMDev/VMMDevTesting.h

    r76565 r81627  
    2727RT_C_DECLS_BEGIN
    2828
    29 int  vmmdevTestingInitialize(PPDMDEVINS pDevIns);
    30 void vmmdevTestingTerminate(PPDMDEVINS pDevIns);
     29int  vmmdevR3TestingInitialize(PPDMDEVINS pDevIns);
     30void vmmdevR3TestingTerminate(PPDMDEVINS pDevIns);
     31int  vmmdevRZTestingInitialize(PPDMDEVINS pDevIns);
    3132
    3233RT_C_DECLS_END
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette