VirtualBox

Changeset 80531 in vbox for trunk/src/VBox/Devices/Serial


Ignore:
Timestamp:
Sep 1, 2019 11:03:34 PM (5 years ago)
Author:
vboxsync
Message:

VMM,Devices: Some PDM device model refactoring. bugref:9218

Location:
trunk/src/VBox/Devices/Serial
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Serial/DevOxPcie958.cpp

    r80298 r80531  
    598598        && VM_IS_RAW_MODE_ENABLED(pVM))
    599599    {
    600         rc = PDMR3LdrGetSymbolRC(pVM, pDevIns->pReg->szRCMod, "ox958IrqReq", &pfnSerialIrqReqRC);
     600        rc = PDMR3LdrGetSymbolRC(pVM, pDevIns->pReg->pszRCMod, "ox958IrqReq", &pfnSerialIrqReqRC);
    601601        if (RT_FAILURE(rc))
    602602            return rc;
     
    606606    if (fR0Enabled)
    607607    {
    608         rc = PDMR3LdrGetSymbolR0(pVM, pDevIns->pReg->szR0Mod, "ox958IrqReq", &pfnSerialIrqReqR0);
     608        rc = PDMR3LdrGetSymbolR0(pVM, pDevIns->pReg->pszR0Mod, "ox958IrqReq", &pfnSerialIrqReqR0);
    609609        if (RT_FAILURE(rc))
    610610            return rc;
     
    624624}
    625625
     626#endif /* IN_RING3 */
     627
    626628
    627629const PDMDEVREG g_DeviceOxPcie958 =
    628630{
    629     /* u32version */
    630     PDM_DEVREG_VERSION,
    631     /* szName */
    632     "oxpcie958uart",
    633     /* szRCMod */
    634     "VBoxDDRC.rc",
    635     /* szR0Mod */
    636     "VBoxDDR0.r0",
    637     /* pszDescription */
    638     "OXPCIe958 based UART controller.\n",
    639     /* fFlags */
    640     PDM_DEVREG_FLAGS_DEFAULT_BITS | PDM_DEVREG_FLAGS_RC | PDM_DEVREG_FLAGS_R0,
    641     /* fClass */
    642     PDM_DEVREG_CLASS_SERIAL,
    643     /* cMaxInstances */
    644     ~0U,
    645     /* cbInstance */
    646     sizeof(DEVOX958),
    647     /* pfnConstruct */
    648     ox958R3Construct,
    649     /* pfnDestruct */
    650     ox958R3Destruct,
    651     /* pfnRelocate */
    652     ox958R3Relocate,
    653     /* pfnMemSetup */
    654     NULL,
    655     /* pfnPowerOn */
    656     NULL,
    657     /* pfnReset */
    658     ox958R3Reset,
    659     /* pfnSuspend */
    660     NULL,
    661     /* pfnResume */
    662     NULL,
    663     /* pfnAttach */
    664     ox958R3Attach,
    665     /* pfnDetach */
    666     ox958R3Detach,
    667     /* pfnQueryInterface */
    668     NULL,
    669     /* pfnInitComplete */
    670     NULL,
    671     /* pfnPowerOff */
    672     NULL,
    673     /* pfnSoftReset */
    674     NULL,
    675     /* u32VersionEnd */
    676     PDM_DEVREG_VERSION
     631    /* .u32version = */             PDM_DEVREG_VERSION,
     632    /* .uReserved0 = */             0,
     633    /* .szName = */                 "oxpcie958uart",
     634    /* .fFlags = */                 PDM_DEVREG_FLAGS_DEFAULT_BITS | PDM_DEVREG_FLAGS_RC | PDM_DEVREG_FLAGS_R0,
     635    /* .fClass = */                 PDM_DEVREG_CLASS_SERIAL,
     636    /* .cMaxInstances = */          ~0U,
     637    /* .uSharedVersion = */         42,
     638    /* .cbInstanceShared = */       sizeof(DEVOX958),
     639    /* .cbInstanceCC = */           0,
     640    /* .cbInstanceRC = */           0,
     641    /* .uReserved1 = */             0,
     642    /* .pszDescription = */         "OXPCIe958 based UART controller.\n",
     643#if defined(IN_RING3)
     644    /* .pszRCMod = */               "VBoxDDRC.rc",
     645    /* .pszR0Mod = */               "VBoxDDR0.r0",
     646    /* .pfnConstruct = */           ox958R3Construct,
     647    /* .pfnDestruct = */            ox958R3Destruct,
     648    /* .pfnRelocate = */            ox958R3Relocate,
     649    /* .pfnMemSetup = */            NULL,
     650    /* .pfnPowerOn = */             NULL,
     651    /* .pfnReset = */               ox958R3Reset,
     652    /* .pfnSuspend = */             NULL,
     653    /* .pfnResume = */              NULL,
     654    /* .pfnAttach = */              ox958R3Attach,
     655    /* .pfnDetach = */              ox958R3Detach,
     656    /* .pfnQueryInterface = */      NULL,
     657    /* .pfnInitComplete = */        NULL,
     658    /* .pfnPowerOff = */            NULL,
     659    /* .pfnSoftReset = */           NULL,
     660    /* .pfnReserved0 = */           NULL,
     661    /* .pfnReserved1 = */           NULL,
     662    /* .pfnReserved2 = */           NULL,
     663    /* .pfnReserved3 = */           NULL,
     664    /* .pfnReserved4 = */           NULL,
     665    /* .pfnReserved5 = */           NULL,
     666    /* .pfnReserved6 = */           NULL,
     667    /* .pfnReserved7 = */           NULL,
     668#elif defined(IN_RING0)
     669    /* .pfnEarlyConstruct = */      NULL,
     670    /* .pfnConstruct = */           NULL,
     671    /* .pfnDestruct = */            NULL,
     672    /* .pfnFinalDestruct = */       NULL,
     673    /* .pfnRequest = */             NULL,
     674    /* .pfnReserved0 = */           NULL,
     675    /* .pfnReserved1 = */           NULL,
     676    /* .pfnReserved2 = */           NULL,
     677    /* .pfnReserved3 = */           NULL,
     678    /* .pfnReserved4 = */           NULL,
     679    /* .pfnReserved5 = */           NULL,
     680    /* .pfnReserved6 = */           NULL,
     681    /* .pfnReserved7 = */           NULL,
     682#elif defined(IN_RC)
     683    /* .pfnConstruct = */           NULL,
     684    /* .pfnReserved0 = */           NULL,
     685    /* .pfnReserved1 = */           NULL,
     686    /* .pfnReserved2 = */           NULL,
     687    /* .pfnReserved3 = */           NULL,
     688    /* .pfnReserved4 = */           NULL,
     689    /* .pfnReserved5 = */           NULL,
     690    /* .pfnReserved6 = */           NULL,
     691    /* .pfnReserved7 = */           NULL,
     692#else
     693# error "Not in IN_RING3, IN_RING0 or IN_RC!"
     694#endif
     695    /* .u32VersionEnd = */          PDM_DEVREG_VERSION
    677696};
    678697
    679 #endif /* IN_RING3 */
    680698#endif /* !VBOX_DEVICE_STRUCT_TESTCASE */
    681699
  • trunk/src/VBox/Devices/Serial/DevSerial.cpp

    r80298 r80531  
    426426        if (   RT_SUCCESS(rc)
    427427            && VM_IS_RAW_MODE_ENABLED(pVM)) /** @todo this dynamic symbol resolving will be reworked later! */
    428             rc = PDMR3LdrGetSymbolRC(pVM, pDevIns->pReg->szRCMod, "serialIrqReq", &pfnSerialIrqReqRC);
     428            rc = PDMR3LdrGetSymbolRC(pVM, pDevIns->pReg->pszRCMod, "serialIrqReq", &pfnSerialIrqReqRC);
    429429        if (RT_FAILURE(rc))
    430430            return rc;
     
    436436        rc = PDMDevHlpIOPortRegisterR0(pDevIns, uIoBase, 8, 0, "serialIoPortWrite", "serialIoPortRead", NULL, NULL, "SERIAL");
    437437        if (RT_SUCCESS(rc)) /** @todo this dynamic symbol resolving will be reworked later! */
    438             rc = PDMR3LdrGetSymbolR0(pVM, pDevIns->pReg->szR0Mod, "serialIrqReq", &pfnSerialIrqReqR0);
     438            rc = PDMR3LdrGetSymbolR0(pVM, pDevIns->pReg->pszR0Mod, "serialIrqReq", &pfnSerialIrqReqR0);
    439439        if (RT_FAILURE(rc))
    440440            return rc;
     
    461461}
    462462
     463#endif /* IN_RING3 */
    463464
    464465/**
     
    467468const PDMDEVREG g_DeviceSerialPort =
    468469{
    469     /* u32Version */
    470     PDM_DEVREG_VERSION,
    471     /* szName */
    472     "serial",
    473     /* szRCMod */
    474     "VBoxDDRC.rc",
    475     /* szR0Mod */
    476     "VBoxDDR0.r0",
    477     /* pszDescription */
    478     "Serial Communication Port",
    479     /* fFlags */
    480     PDM_DEVREG_FLAGS_DEFAULT_BITS | PDM_DEVREG_FLAGS_RC | PDM_DEVREG_FLAGS_R0,
    481     /* fClass */
    482     PDM_DEVREG_CLASS_SERIAL,
    483     /* cMaxInstances */
    484     UINT32_MAX,
    485     /* cbInstance */
    486     sizeof(DEVSERIAL),
    487     /* pfnConstruct */
    488     serialR3Construct,
    489     /* pfnDestruct */
    490     serialR3Destruct,
    491     /* pfnRelocate */
    492     serialR3Relocate,
    493     /* pfnMemSetup */
    494     NULL,
    495     /* pfnPowerOn */
    496     NULL,
    497     /* pfnReset */
    498     serialR3Reset,
    499     /* pfnSuspend */
    500     NULL,
    501     /* pfnResume */
    502     NULL,
    503     /* pfnAttach */
    504     serialR3Attach,
    505     /* pfnDetach */
    506     serialR3Detach,
    507     /* pfnQueryInterface. */
    508     NULL,
    509     /* pfnInitComplete */
    510     NULL,
    511     /* pfnPowerOff */
    512     NULL,
    513     /* pfnSoftReset */
    514     NULL,
    515     /* u32VersionEnd */
    516     PDM_DEVREG_VERSION
     470    /* .u32Version = */             PDM_DEVREG_VERSION,
     471    /* .uReserved0 = */             0,
     472    /* .szName = */                 "serial",
     473    /* .fFlags = */                 PDM_DEVREG_FLAGS_DEFAULT_BITS | PDM_DEVREG_FLAGS_RC | PDM_DEVREG_FLAGS_R0,
     474    /* .fClass = */                 PDM_DEVREG_CLASS_SERIAL,
     475    /* .cMaxInstances = */          UINT32_MAX,
     476    /* .uSharedVersion = */         42,
     477    /* .cbInstanceShared = */       sizeof(DEVSERIAL),
     478    /* .cbInstanceCC = */           0,
     479    /* .cbInstanceRC = */           0,
     480    /* .uReserved1 = */             0,
     481    /* .pszDescription = */         "Serial Communication Port",
     482#if defined(IN_RING3)
     483    /* .pszRCMod = */               "VBoxDDRC.rc",
     484    /* .pszR0Mod = */               "VBoxDDR0.r0",
     485    /* .pfnConstruct = */           serialR3Construct,
     486    /* .pfnDestruct = */            serialR3Destruct,
     487    /* .pfnRelocate = */            serialR3Relocate,
     488    /* .pfnMemSetup = */            NULL,
     489    /* .pfnPowerOn = */             NULL,
     490    /* .pfnReset = */               serialR3Reset,
     491    /* .pfnSuspend = */             NULL,
     492    /* .pfnResume = */              NULL,
     493    /* .pfnAttach = */              serialR3Attach,
     494    /* .pfnDetach = */              serialR3Detach,
     495    /* .pfnQueryInterface = */      NULL,
     496    /* .pfnInitComplete = */        NULL,
     497    /* .pfnPowerOff = */            NULL,
     498    /* .pfnSoftReset = */           NULL,
     499    /* .pfnReserved0 = */           NULL,
     500    /* .pfnReserved1 = */           NULL,
     501    /* .pfnReserved2 = */           NULL,
     502    /* .pfnReserved3 = */           NULL,
     503    /* .pfnReserved4 = */           NULL,
     504    /* .pfnReserved5 = */           NULL,
     505    /* .pfnReserved6 = */           NULL,
     506    /* .pfnReserved7 = */           NULL,
     507#elif defined(IN_RING0)
     508    /* .pfnEarlyConstruct = */      NULL,
     509    /* .pfnConstruct = */           NULL,
     510    /* .pfnDestruct = */            NULL,
     511    /* .pfnFinalDestruct = */       NULL,
     512    /* .pfnRequest = */             NULL,
     513    /* .pfnReserved0 = */           NULL,
     514    /* .pfnReserved1 = */           NULL,
     515    /* .pfnReserved2 = */           NULL,
     516    /* .pfnReserved3 = */           NULL,
     517    /* .pfnReserved4 = */           NULL,
     518    /* .pfnReserved5 = */           NULL,
     519    /* .pfnReserved6 = */           NULL,
     520    /* .pfnReserved7 = */           NULL,
     521#elif defined(IN_RC)
     522    /* .pfnConstruct = */           NULL,
     523    /* .pfnReserved0 = */           NULL,
     524    /* .pfnReserved1 = */           NULL,
     525    /* .pfnReserved2 = */           NULL,
     526    /* .pfnReserved3 = */           NULL,
     527    /* .pfnReserved4 = */           NULL,
     528    /* .pfnReserved5 = */           NULL,
     529    /* .pfnReserved6 = */           NULL,
     530    /* .pfnReserved7 = */           NULL,
     531#else
     532# error "Not in IN_RING3, IN_RING0 or IN_RC!"
     533#endif
     534    /* .u32VersionEnd = */          PDM_DEVREG_VERSION
    517535};
    518 #endif /* IN_RING3 */
    519536
    520537#endif /* !VBOX_DEVICE_STRUCT_TESTCASE */
     538
Note: See TracChangeset for help on using the changeset viewer.

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