VirtualBox

Changeset 25893 in vbox


Ignore:
Timestamp:
Jan 18, 2010 2:08:39 PM (15 years ago)
Author:
vboxsync
Message:

PDMDrv,*: multi context drivers, part 2.

Location:
trunk
Files:
39 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/pdmdev.h

    r25891 r25893  
    8686 * Device relocation callback.
    8787 *
    88  * When this callback is called the device instance data, and if the
    89  * device have a GC component, is being relocated, or/and the selectors
    90  * have been changed. The device must use the chance to perform the
    91  * necessary pointer relocations and data updates.
     88 * This is called when the instance data has been relocated in raw-mode context
     89 * (RC).  It is also called when the RC hypervisor selects changes.  The device
     90 * must fixup all necessary pointers and re-query all interfaces to other RC
     91 * devices and drivers.
    9292 *
    93  * Before the GC code is executed the first time, this function will be
    94  * called with a 0 delta so GC pointer calculations can be one in one place.
     93 * Before the RC code is executed the first time, this function will be called
     94 * with a 0 delta so RC pointer calculations can be one in one place.
    9595 *
    9696 * @param   pDevIns     Pointer to the device instance.
     
    102102/** Pointer to a FNPDMDEVRELOCATE() function. */
    103103typedef FNPDMDEVRELOCATE *PFNPDMDEVRELOCATE;
    104 
    105104
    106105/**
     
    238237
    239238
    240 /** PDM Device Registration Structure,
    241  * This structure is used when registering a device from
    242  * VBoxInitDevices() in HC Ring-3. PDM will continue use till
    243  * the VM is terminated.
     239/**
     240 * PDM Device Registration Structure.
     241 *
     242 * This structure is used when registering a device from VBoxInitDevices() in HC
     243 * Ring-3.  PDM will continue use till the VM is terminated.
    244244 */
    245245typedef struct PDMDEVREG
     
    260260
    261261    /** Flags, combination of the PDM_DEVREG_FLAGS_* \#defines. */
    262     RTUINT              fFlags;
     262    uint32_t            fFlags;
    263263    /** Device class(es), combination of the PDM_DEVREG_CLASS_* \#defines. */
    264     RTUINT              fClass;
     264    uint32_t            fClass;
    265265    /** Maximum number of instances (per VM). */
    266     RTUINT              cMaxInstances;
     266    uint32_t            cMaxInstances;
    267267    /** Size of the instance data. */
    268     RTUINT              cbInstance;
     268    uint32_t            cbInstance;
    269269
    270270    /** Construct instance - required. */
  • trunk/include/VBox/pdmdrv.h

    r25891 r25893  
    9292
    9393/**
     94 * Driver relocation callback.
     95 *
     96 * This is called when the instance data has been relocated in raw-mode context
     97 * (RC).  It is also called when the RC hypervisor selects changes.  The driver
     98 * must fixup all necessary pointers and re-query all interfaces to other RC
     99 * devices and drivers.
     100 *
     101 * Before the RC code is executed the first time, this function will be called
     102 * with a 0 delta so RC pointer calculations can be one in one place.
     103 *
     104 * @param   pDrvIns     Pointer to the driver instance.
     105 * @param   offDelta    The relocation delta relative to the old location.
     106 *
     107 * @remark  A relocation CANNOT fail.
     108 */
     109typedef DECLCALLBACK(void) FNPDMDRVRELOCATE(PPDMDRVINS pDrvIns, RTGCINTPTR offDelta);
     110/** Pointer to a FNPDMDRVRELOCATE() function. */
     111typedef FNPDMDRVRELOCATE *PFNPDMDRVRELOCATE;
     112
     113/**
    94114 * Driver I/O Control interface.
    95115 *
     
    107127 * @param   pcbOut      Where to store the actual size of the output data.
    108128 */
    109 typedef DECLCALLBACK(int) FNPDMDRVIOCTL(PPDMDRVINS pDrvIns, RTUINT uFunction,
    110                                         void *pvIn, RTUINT cbIn,
    111                                         void *pvOut, RTUINT cbOut, PRTUINT pcbOut);
     129typedef DECLCALLBACK(int) FNPDMDRVIOCTL(PPDMDRVINS pDrvIns, uint32_t uFunction,
     130                                        void *pvIn, uint32_t cbIn,
     131                                        void *pvOut, uint32_t cbOut, uint32_t *pcbOut);
    112132/** Pointer to a FNPDMDRVIOCTL() function. */
    113133typedef FNPDMDRVIOCTL *PFNPDMDRVIOCTL;
     
    195215
    196216
    197 /** PDM Driver Registration Structure,
    198  * This structure is used when registering a driver from
    199  * VBoxInitDrivers() (HC Ring-3). PDM will continue use till
    200  * the VM is terminated.
     217/**
     218 * PDM Driver Registration Structure.
     219 *
     220 * This structure is used when registering a driver from VBoxInitDrivers() (in
     221 * host ring-3 context).  PDM will continue use till the VM is terminated.
    201222 */
    202223typedef struct PDMDRVREG
     
    206227    /** Driver name. */
    207228    char                szDriverName[32];
     229    /** Name of the raw-mode context module (no path).
     230     * Only evalutated if PDM_DRVREG_FLAGS_RC is set. */
     231    char                szRCMod[32];
     232    /** Name of the ring-0 module (no path).
     233     * Only evalutated if PDM_DRVREG_FLAGS_R0 is set. */
     234    char                szR0Mod[32];
    208235    /** The description of the driver. The UTF-8 string pointed to shall, like this structure,
    209236     * remain unchanged from registration till VM destruction. */
     
    211238
    212239    /** Flags, combination of the PDM_DRVREG_FLAGS_* \#defines. */
    213     RTUINT              fFlags;
     240    uint32_t            fFlags;
    214241    /** Driver class(es), combination of the PDM_DRVREG_CLASS_* \#defines. */
    215     RTUINT              fClass;
     242    uint32_t            fClass;
    216243    /** Maximum number of instances (per VM). */
    217     RTUINT              cMaxInstances;
     244    uint32_t            cMaxInstances;
    218245    /** Size of the instance data. */
    219     RTUINT              cbInstance;
     246    uint32_t            cbInstance;
    220247
    221248    /** Construct instance - required. */
     
    223250    /** Destruct instance - optional. */
    224251    PFNPDMDRVDESTRUCT   pfnDestruct;
     252    /** Relocation command - optional. */
     253    PFNPDMDRVRELOCATE   pfnRelocate;
    225254    /** I/O control - optional. */
    226255    PFNPDMDRVIOCTL      pfnIOCtl;
     
    250279
    251280/** Current DRVREG version number. */
    252 #define PDM_DRVREG_VERSION  UINT32_C(0x80030000)
     281#define PDM_DRVREG_VERSION                      UINT32_C(0x80030000)
    253282
    254283/** PDM Driver Flags.
     
    599628     * @thread  The emulation thread.
    600629     */
    601     DECLR3CALLBACKMEMBER(int, pfnPDMQueueCreate,(PPDMDRVINS pDrvIns, RTUINT cbItem, RTUINT cItems, uint32_t cMilliesInterval,
     630    DECLR3CALLBACKMEMBER(int, pfnPDMQueueCreate,(PPDMDRVINS pDrvIns, uint32_t cbItem, uint32_t cItems, uint32_t cMilliesInterval,
    602631                                                 PFNPDMQUEUEDRV pfnCallback, const char *pszName, PPDMQUEUE *ppQueue));
    603632
     
    9721001 * @copydoc PDMDRVHLP::pfnPDMQueueCreate
    9731002 */
    974 DECLINLINE(int) PDMDrvHlpPDMQueueCreate(PPDMDRVINS pDrvIns, RTUINT cbItem, RTUINT cItems, uint32_t cMilliesInterval,
     1003DECLINLINE(int) PDMDrvHlpPDMQueueCreate(PPDMDRVINS pDrvIns, uint32_t cbItem, uint32_t cItems, uint32_t cMilliesInterval,
    9751004                                        PFNPDMQUEUEDRV pfnCallback, const char *pszName, PPDMQUEUE *ppQueue)
    9761005{
  • trunk/src/VBox/Devices/Audio/audio.c

    r25891 r25893  
    20562056    /* szDriverName */
    20572057    "AUDIO",
     2058    /* szRCMod */
     2059    "",
     2060    /* szR0Mod */
     2061    "",
    20582062    /* pszDescription */
    20592063    "AUDIO Driver",
     
    20702074    /* pfnDestruct */
    20712075    drvAudioDestruct,
     2076    /* pfnRelocate */
     2077    NULL,
    20722078    /* pfnIOCtl */
    20732079    NULL,
  • trunk/src/VBox/Devices/Input/DrvKeyboardQueue.cpp

    r22277 r25893  
    334334    /* szDriverName */
    335335    "KeyboardQueue",
     336    /* szRCMod */
     337    "",
     338    /* szR0Mod */
     339    "",
    336340    /* pszDescription */
    337341    "Keyboard queue driver to plug in between the key source and the device to do queueing and inter-thread transport.",
     
    346350    /* pfnConstruct */
    347351    drvKbdQueueConstruct,
     352    /* pfnRelocate */
     353    NULL,
    348354    /* pfnDestruct */
    349355    NULL,
  • trunk/src/VBox/Devices/Input/DrvMouseQueue.cpp

    r22810 r25893  
    228228
    229229/**
    230  * Construct a mouse driver instance. 
    231  * 
     230 * Construct a mouse driver instance.
     231 *
    232232 * @copydoc FNPDMDRVCONSTRUCT
    233233 */
     
    322322    /* szDriverName */
    323323    "MouseQueue",
     324    /* szRCMod */
     325    "",
     326    /* szR0Mod */
     327    "",
    324328    /* pszDescription */
    325329    "Mouse queue driver to plug in between the key source and the device to do queueing and inter-thread transport.",
     
    334338    /* pfnConstruct */
    335339    drvMouseQueueConstruct,
     340    /* pfnRelocate */
     341    NULL,
    336342    /* pfnDestruct */
    337343    NULL,
  • trunk/src/VBox/Devices/Network/DrvIntNet.cpp

    r25891 r25893  
    11371137    /* szDriverName */
    11381138    "IntNet",
     1139    /* szRCMod */
     1140    "",
     1141    /* szR0Mod */
     1142    "",
    11391143    /* pszDescription */
    11401144    "Internal Networking Transport Driver",
     
    11511155    /* pfnDestruct */
    11521156    drvIntNetDestruct,
     1157    /* pfnRelocate */
     1158    NULL,
    11531159    /* pfnIOCtl */
    11541160    NULL,
  • trunk/src/VBox/Devices/Network/DrvNAT.cpp

    r25799 r25893  
    241241    {
    242242        RTReqProcess(pThis->pRecvReqQueue, 0);
    243         if (ASMAtomicReadU32(&pThis->cPkt) == 0) 
     243        if (ASMAtomicReadU32(&pThis->cPkt) == 0)
    244244            RTSemEventWait(pThis->EventRecv, RT_INDEFINITE_WAIT);
    245245    }
     
    268268    {
    269269        RTReqProcess(pThis->pUrgRecvReqQueue, 0);
    270         if (ASMAtomicReadU32(&pThis->cUrgPkt) == 0) 
     270        if (ASMAtomicReadU32(&pThis->cUrgPkt) == 0)
    271271        {
    272272            int rc = RTSemEventWait(pThis->EventUrgRecv, RT_INDEFINITE_WAIT);
     
    295295        AssertRC(rc);
    296296    }
    297     else if (   RT_FAILURE(rc) 
     297    else if (   RT_FAILURE(rc)
    298298             && (  rc == VERR_TIMEOUT
    299299                && rc == VERR_INTERRUPTED))
    300300    {
    301301        AssertRC(rc);
    302     } 
     302    }
    303303
    304304    rc = RTCritSectLeave(&pThis->csDevAccess);
     
    306306
    307307    slirp_ext_m_free(pThis->pNATState, pvArg);
    308     if (ASMAtomicDecU32(&pThis->cUrgPkt) == 0) 
     308    if (ASMAtomicDecU32(&pThis->cUrgPkt) == 0)
    309309    {
    310310        drvNATRecvWakeup(pThis->pDrvIns, pThis->pRecvThread);
     
    324324    {
    325325        rc = RTSemEventWait(pThis->EventRecv, RT_INDEFINITE_WAIT);
    326         if (   RT_FAILURE(rc) 
     326        if (   RT_FAILURE(rc)
    327327            && ( rc == VERR_TIMEOUT
    328328                 || rc == VERR_INTERRUPTED))
    329             goto done_unlocked; 
     329            goto done_unlocked;
    330330    }
    331331
     
    337337        rc = pThis->pPort->pfnReceive(pThis->pPort, pu8Buf, cb);
    338338        AssertRC(rc);
    339     } 
    340     else if (   RT_FAILURE(rc) 
     339    }
     340    else if (   RT_FAILURE(rc)
    341341             && (  rc != VERR_TIMEOUT
    342342                && rc != VERR_INTERRUPTED))
     
    11481148            rc = RTSemEventCreate(&pThis->EventUrgRecv);
    11491149            rc = RTCritSectInit(&pThis->csDevAccess);
    1150             rc = PDMDrvHlpTMTimerCreate(pThis->pDrvIns, TMCLOCK_REAL/*enmClock*/, drvNATSlowTimer, 
     1150            rc = PDMDrvHlpTMTimerCreate(pThis->pDrvIns, TMCLOCK_REAL/*enmClock*/, drvNATSlowTimer,
    11511151                    pThis, TMTIMER_FLAGS_NO_CRIT_SECT/*flags*/, "NATSlowTmr", &pThis->pTmrSlow);
    1152             rc = PDMDrvHlpTMTimerCreate(pThis->pDrvIns, TMCLOCK_REAL/*enmClock*/, drvNATFastTimer, 
     1152            rc = PDMDrvHlpTMTimerCreate(pThis->pDrvIns, TMCLOCK_REAL/*enmClock*/, drvNATFastTimer,
    11531153                    pThis, TMTIMER_FLAGS_NO_CRIT_SECT/*flags*/, "NATFastTmr", &pThis->pTmrFast);
    11541154
     
    12111211    /* szDriverName */
    12121212    "NAT",
     1213    /* szRCMod */
     1214    "",
     1215    /* szR0Mod */
     1216    "",
    12131217    /* pszDescription */
    12141218    "NAT Network Transport Driver",
     
    12251229    /* pfnDestruct */
    12261230    drvNATDestruct,
     1231    /* pfnRelocate */
     1232    NULL,
    12271233    /* pfnIOCtl */
    12281234    NULL,
  • trunk/src/VBox/Devices/Network/DrvNetSniffer.cpp

    r25728 r25893  
    490490    /* szDriverName */
    491491    "NetSniffer",
     492    /* szRCMod */
     493    "",
     494    /* szR0Mod */
     495    "",
    492496    /* pszDescription */
    493497    "Network Sniffer Filter Driver",
     
    504508    /* pfnDestruct */
    505509    drvNetSnifferDestruct,
     510    /* pfnRelocate */
     511    NULL,
    506512    /* pfnIOCtl */
    507513    NULL,
  • trunk/src/VBox/Devices/Network/DrvTAP.cpp

    r25823 r25893  
    10671067    /* szDriverName */
    10681068    "HostInterface",
     1069    /* szRCMod */
     1070    "",
     1071    /* szR0Mod */
     1072    "",
    10691073    /* pszDescription */
    10701074    "TAP Network Transport Driver",
     
    10811085    /* pfnDestruct */
    10821086    drvTAPDestruct,
     1087    /* pfnRelocate */
     1088    NULL,
    10831089    /* pfnIOCtl */
    10841090    NULL,
  • trunk/src/VBox/Devices/PC/DrvACPI.cpp

    r22277 r25893  
    749749     * Check that no-one is attached to us.
    750750     */
    751     AssertMsgReturn(PDMDrvHlpNoAttach(pDrvIns) == VERR_PDM_NO_ATTACHED_DRIVER, 
     751    AssertMsgReturn(PDMDrvHlpNoAttach(pDrvIns) == VERR_PDM_NO_ATTACHED_DRIVER,
    752752                    ("Configuration error: Not possible to attach anything to this driver!\n"),
    753753                    VERR_PDM_DRVINS_NO_ATTACH);
     
    777777    /* szDriverName */
    778778    "ACPIHost",
     779    /* szRCMod */
     780    "",
     781    /* szR0Mod */
     782    "",
    779783    /* pszDescription */
    780784    "ACPI Host Driver",
     
    791795    /* pfnDestruct */
    792796    drvACPIDestruct,
     797    /* pfnRelocate */
     798    NULL,
    793799    /* pfnIOCtl */
    794800    NULL,
     
    804810    NULL,
    805811    /* pfnDetach */
    806     NULL, 
     812    NULL,
    807813    /* pfnPowerOff */
    808     NULL, 
     814    NULL,
    809815    /* pfnSoftReset */
    810816    NULL,
  • trunk/src/VBox/Devices/PC/DrvAcpiCpu.cpp

    r25817 r25893  
    8989     * Check that no-one is attached to us.
    9090     */
    91     AssertMsgReturn(PDMDrvHlpNoAttach(pDrvIns) == VERR_PDM_NO_ATTACHED_DRIVER, 
     91    AssertMsgReturn(PDMDrvHlpNoAttach(pDrvIns) == VERR_PDM_NO_ATTACHED_DRIVER,
    9292                    ("Configuration error: Not possible to attach anything to this driver!\n"),
    9393                    VERR_PDM_DRVINS_NO_ATTACH);
     
    105105    /* szDriverName */
    106106    "ACPICpu",
     107    /* szRCMod */
     108    "",
     109    /* szR0Mod */
     110    "",
    107111    /* pszDescription */
    108112    "ACPI CPU Driver",
     
    119123    /* pfnDestruct */
    120124    drvACPICpuDestruct,
     125    /* pfnRelocate */
     126    NULL,
    121127    /* pfnIOCtl */
    122128    NULL,
     
    132138    NULL,
    133139    /* pfnDetach */
    134     NULL, 
     140    NULL,
    135141    /* pfnPowerOff */
    136     NULL, 
     142    NULL,
    137143    /* pfnSoftReset */
    138144    NULL,
  • trunk/src/VBox/Devices/Parallel/DrvHostParallel.cpp

    r25823 r25893  
    406406    /* szDriverName */
    407407    "HostParallel",
     408    /* szRCMod */
     409    "",
     410    /* szR0Mod */
     411    "",
    408412    /* pszDescription */
    409413    "Parallel host driver.",
     
    420424    /* pfnDestruct */
    421425    drvHostParallelDestruct,
     426    /* pfnRelocate */
     427    NULL,
    422428    /* pfnIOCtl */
    423429    NULL,
  • trunk/src/VBox/Devices/Serial/DrvChar.cpp

    r23745 r25893  
    304304/**
    305305 * Construct a char driver instance.
    306  * 
     306 *
    307307 * @copydoc FNPDMDRVCONSTRUCT
    308308 */
     
    343343        return PDMDrvHlpVMSetError(pDrvIns, VERR_PDM_MISSING_INTERFACE_BELOW, RT_SRC_POS, N_("Char#%d has no stream interface below"), pDrvIns->iInstance);
    344344
    345     /* 
     345    /*
    346346     * Don't start the receive thread if the driver doesn't support reading
    347347     */
     
    414414    /* szDriverName */
    415415    "Char",
     416    /* szRCMod */
     417    "",
     418    /* szR0Mod */
     419    "",
    416420    /* pszDescription */
    417421    "Generic char driver.",
     
    428432    /* pfnDestruct */
    429433    drvCharDestruct,
     434    /* pfnRelocate */
     435    NULL,
    430436    /* pfnIOCtl */
    431437    NULL,
     
    441447    NULL,
    442448    /* pfnDetach */
    443     NULL, 
     449    NULL,
    444450    /* pfnPowerOff */
    445     NULL, 
     451    NULL,
    446452    /* pfnSoftReset */
    447453    NULL,
  • trunk/src/VBox/Devices/Serial/DrvHostSerial.cpp

    r25823 r25893  
    14681468    /* szDriverName */
    14691469    "Host Serial",
    1470     /* pszDescription */
     1470        /* szRCMod */
     1471    "",
     1472    /* szR0Mod */
     1473    "",
     1474/* pszDescription */
    14711475    "Host serial driver.",
    14721476    /* fFlags */
     
    14821486    /* pfnDestruct */
    14831487    drvHostSerialDestruct,
     1488    /* pfnRelocate */
     1489    NULL,
    14841490    /* pfnIOCtl */
    14851491    NULL,
  • trunk/src/VBox/Devices/Serial/DrvNamedPipe.cpp

    r22277 r25893  
    617617    /* szDriverName */
    618618    "NamedPipe",
     619    /* szRCMod */
     620    "",
     621    /* szR0Mod */
     622    "",
    619623    /* pszDescription */
    620624    "Named Pipe stream driver.",
     
    631635    /* pfnDestruct */
    632636    drvNamedPipeDestruct,
     637    /* pfnRelocate */
     638    NULL,
    633639    /* pfnIOCtl */
    634640    NULL,
  • trunk/src/VBox/Devices/Serial/DrvRawFile.cpp

    r24382 r25893  
    219219    /* szDriverName */
    220220    "RawFile",
     221    /* szRCMod */
     222    "",
     223    /* szR0Mod */
     224    "",
    221225    /* pszDescription */
    222226    "RawFile stream driver.",
     
    233237    /* pfnDestruct */
    234238    drvRawFileDestruct,
     239    /* pfnRelocate */
     240    NULL,
    235241    /* pfnIOCtl */
    236242    NULL,
  • trunk/src/VBox/Devices/Storage/DrvBlock.cpp

    r25891 r25893  
    903903    /* szDriverName */
    904904    "Block",
     905    /* szRCMod */
     906    "",
     907    /* szR0Mod */
     908    "",
    905909    /* pszDescription */
    906910    "Generic block driver.",
     
    916920    drvblockConstruct,
    917921    /* pfnDestruct */
     922    NULL,
     923    /* pfnRelocate */
    918924    NULL,
    919925    /* pfnIOCtl */
  • trunk/src/VBox/Devices/Storage/DrvHostDVD.cpp

    r24015 r25893  
    830830    /* szDriverName */
    831831    "HostDVD",
     832    /* szRCMod */
     833    "",
     834    /* szR0Mod */
     835    "",
    832836    /* pszDescription */
    833837    "Host DVD Block Driver.",
     
    844848    /* pfnDestruct */
    845849    drvHostDvdDestruct,
     850    /* pfnRelocate */
     851    NULL,
    846852    /* pfnIOCtl */
    847853    NULL,
  • trunk/src/VBox/Devices/Storage/DrvHostFloppy.cpp

    r22277 r25893  
    204204    /* szDriverName */
    205205    "HostFloppy",
     206    /* szRCMod */
     207    "",
     208    /* szR0Mod */
     209    "",
    206210    /* pszDescription */
    207211    "Host Floppy Block Driver.",
     
    218222    /* pfnDestruct */
    219223    DRVHostBaseDestruct,
     224    /* pfnRelocate */
     225    NULL,
    220226    /* pfnIOCtl */
    221227    NULL,
     
    231237    NULL,
    232238    /* pfnDetach */
    233     NULL, 
     239    NULL,
    234240    /* pfnPowerOff */
    235     NULL, 
     241    NULL,
    236242    /* pfnSoftReset */
    237243    NULL,
  • trunk/src/VBox/Devices/Storage/DrvMediaISO.cpp

    r22277 r25893  
    319319    /* szDriverName */
    320320    "MediaISO",
     321    /* szRCMod */
     322    "",
     323    /* szR0Mod */
     324    "",
    321325    /* pszDescription */
    322326    "ISO media access driver.",
     
    333337    /* pfnDestruct */
    334338    drvMediaISODestruct,
     339    /* pfnRelocate */
     340    NULL,
    335341    /* pfnIOCtl */
    336342    NULL,
     
    346352    NULL,
    347353    /* pfnDetach */
    348     NULL, 
     354    NULL,
    349355    /* pfnPowerOff */
    350     NULL, 
     356    NULL,
    351357    /* pfnSoftReset */
    352358    NULL,
  • trunk/src/VBox/Devices/Storage/DrvRawImage.cpp

    r22277 r25893  
    9292/**
    9393 * Construct a raw image driver instance.
    94  * 
     94 *
    9595 * @copydoc FNPDMDRVCONSTRUCT
    96  */ 
     96 */
    9797static DECLCALLBACK(int) drvRawImageConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfgHandle, uint32_t fFlags)
    9898{
     
    369369    /* szDriverName */
    370370    "RawImage",
     371    /* szRCMod */
     372    "",
     373    /* szR0Mod */
     374    "",
    371375    /* pszDescription */
    372376    "Raw image access driver.",
     
    383387    /* pfnDestruct */
    384388    drvRawImageDestruct,
     389    /* pfnRelocate */
     390    NULL,
    385391    /* pfnIOCtl */
    386392    NULL,
     
    396402    NULL,
    397403    /* pfnDetach */
    398     NULL, 
     404    NULL,
    399405    /* pfnPowerOff */
    400     NULL, 
     406    NULL,
    401407    /* pfnSoftReset */
    402408    NULL,
  • trunk/src/VBox/Devices/Storage/DrvSCSI.cpp

    r24751 r25893  
    10281028    /* szDriverName */
    10291029    "SCSI",
     1030    /* szRCMod */
     1031    "",
     1032    /* szR0Mod */
     1033    "",
    10301034    /* pszDescription */
    10311035    "Generic SCSI driver.",
     
    10421046    /* pfnDestruct */
    10431047    drvscsiDestruct,
     1048    /* pfnRelocate */
     1049    NULL,
    10441050    /* pfnIOCtl */
    10451051    NULL,
  • trunk/src/VBox/Devices/Storage/DrvSCSIHost.cpp

    r23973 r25893  
    500500    /* szDriverName */
    501501    "SCSIHost",
     502    /* szRCMod */
     503    "",
     504    /* szR0Mod */
     505    "",
    502506    /* pszDescription */
    503507    "Host SCSI driver.",
     
    514518    /* pfnDestruct */
    515519    drvscsihostDestruct,
     520    /* pfnRelocate */
     521    NULL,
    516522    /* pfnIOCtl */
    517523    NULL,
  • trunk/src/VBox/Devices/Storage/DrvVD.cpp

    r25891 r25893  
    13181318    /* szDriverName */
    13191319    "VD",
     1320    /* szRCMod */
     1321    "",
     1322    /* szR0Mod */
     1323    "",
    13201324    /* pszDescription */
    13211325    "Generic VBox disk media driver.",
     
    13321336    /* pfnDestruct */
    13331337    drvvdDestruct,
     1338    /* pfnRelocate */
     1339    NULL,
    13341340    /* pfnIOCtl */
    13351341    NULL,
  • trunk/src/VBox/Frontends/VBoxBFE/DisplayImpl.cpp

    r25771 r25893  
    12491249    /* szDriverName */
    12501250    "MainDisplay",
     1251    /* szRCMod */
     1252    "",
     1253    /* szR0Mod */
     1254    "",
    12511255    /* pszDescription */
    12521256    "Main display driver (Main as in the API).",
     
    12621266    VMDisplay::drvConstruct,
    12631267    /* pfnDestruct */
     1268    NULL,
     1269    /* pfnRelocate */
    12641270    NULL,
    12651271    /* pfnIOCtl */
  • trunk/src/VBox/Frontends/VBoxBFE/KeyboardImpl.cpp

    r22277 r25893  
    220220    if (!CFGMR3AreValuesValid(pCfgHandle, "Object\0"))
    221221        return VERR_PDM_DRVINS_UNKNOWN_CFG_VALUES;
    222     AssertMsgReturn(PDMDrvHlpNoAttach(pDrvIns) == VERR_PDM_NO_ATTACHED_DRIVER, 
     222    AssertMsgReturn(PDMDrvHlpNoAttach(pDrvIns) == VERR_PDM_NO_ATTACHED_DRIVER,
    223223                    ("Configuration error: Not possible to attach anything to this driver!\n"),
    224224                    VERR_PDM_DRVINS_NO_ATTACH);
     
    267267    /* szDriverName */
    268268    "MainKeyboard",
     269    /* szRCMod */
     270    "",
     271    /* szR0Mod */
     272    "",
    269273    /* pszDescription */
    270274    "Main keyboard driver (Main as in the API).",
     
    281285    /* pfnDestruct */
    282286    Keyboard::drvDestruct,
     287    /* pfnRelocate */
     288    NULL,
    283289    /* pfnIOCtl */
    284290    NULL,
     
    294300    NULL,
    295301    /* pfnDetach */
    296     NULL, 
     302    NULL,
    297303    /* pfnPowerOff */
    298     NULL, 
     304    NULL,
    299305    /* pfnSoftReset */
    300306    NULL,
  • trunk/src/VBox/Frontends/VBoxBFE/MouseImpl.cpp

    r25771 r25893  
    274274    /* szDriverName */
    275275    "MainMouse",
     276    /* szRCMod */
     277    "",
     278    /* szR0Mod */
     279    "",
    276280    /* pszDescription */
    277281    "Main mouse driver (Main as in the API).",
     
    288292    /* pfnDestruct */
    289293    Mouse::drvDestruct,
     294    /* pfnRelocate */
     295    NULL,
    290296    /* pfnIOCtl */
    291297    NULL,
  • trunk/src/VBox/Frontends/VBoxBFE/StatusImpl.cpp

    r22277 r25893  
    141141    if (!CFGMR3AreValuesValid(pCfgHandle, "papLeds\0First\0Last\0"))
    142142        return VERR_PDM_DRVINS_UNKNOWN_CFG_VALUES;
    143     AssertMsgReturn(PDMDrvHlpNoAttach(pDrvIns) == VERR_PDM_NO_ATTACHED_DRIVER, 
     143    AssertMsgReturn(PDMDrvHlpNoAttach(pDrvIns) == VERR_PDM_NO_ATTACHED_DRIVER,
    144144                    ("Configuration error: Not possible to attach anything to this driver!\n"),
    145145                    VERR_PDM_DRVINS_NO_ATTACH);
     
    211211    /* szDriverName */
    212212    "MainStatus",
     213    /* szRCMod */
     214    "",
     215    /* szR0Mod */
     216    "",
    213217    /* pszDescription */
    214218    "Main status driver (Main as in the API).",
     
    225229    /* pfnDestruct */
    226230    VMStatus::drvDestruct,
     231    /* pfnRelocate */
     232    NULL,
    227233    /* pfnIOCtl */
    228234    NULL,
     
    238244    NULL,
    239245    /* pfnDetach */
    240     NULL, 
     246    NULL,
    241247    /* pfnPowerOff */
    242     NULL, 
     248    NULL,
    243249    /* pfnSoftReset */
    244250    NULL,
  • trunk/src/VBox/Frontends/VBoxBFE/VMMDevInterface.cpp

    r22793 r25893  
    500500    /* szDriverName */
    501501    "HGCM",
     502    /* szRCMod */
     503    "",
     504    /* szR0Mod */
     505    "",
    502506    /* pszDescription */
    503507    "Main VMMDev driver (Main as in the API).",
     
    514518    /* pfnDestruct */
    515519    VMMDev::drvDestruct,
     520    /* pfnRelocate */
     521    NULL,
    516522    /* pfnIOCtl */
    517523    NULL,
  • trunk/src/VBox/Main/AudioSnifferInterface.cpp

    r22277 r25893  
    157157
    158158/**
    159  * Construct a AudioSniffer driver instance. 
    160  * 
     159 * Construct a AudioSniffer driver instance.
     160 *
    161161 * @copydoc FNPDMDRVCONSTRUCT
    162162 */
     
    172172    if (!CFGMR3AreValuesValid(pCfgHandle, "Object\0"))
    173173        return VERR_PDM_DRVINS_UNKNOWN_CFG_VALUES;
    174     AssertMsgReturn(PDMDrvHlpNoAttach(pDrvIns) == VERR_PDM_NO_ATTACHED_DRIVER, 
     174    AssertMsgReturn(PDMDrvHlpNoAttach(pDrvIns) == VERR_PDM_NO_ATTACHED_DRIVER,
    175175                    ("Configuration error: Not possible to attach anything to this driver!\n"),
    176176                    VERR_PDM_DRVINS_NO_ATTACH);
     
    221221    /* szDriverName */
    222222    "MainAudioSniffer",
     223    /* szRCMod */
     224    "",
     225    /* szR0Mod */
     226    "",
    223227    /* pszDescription */
    224228    "Main Audio Sniffer driver (Main as in the API).",
     
    235239    /* pfnDestruct */
    236240    AudioSniffer::drvDestruct,
     241    /* pfnRelocate */
     242    NULL,
    237243    /* pfnIOCtl */
    238244    NULL,
     
    248254    NULL,
    249255    /* pfnDetach */
    250     NULL, 
     256    NULL,
    251257    /* pfnPowerOff */
    252     NULL, 
     258    NULL,
    253259    /* pfnSoftReset */
    254260    NULL,
  • trunk/src/VBox/Main/ConsoleImpl.cpp

    r25860 r25893  
    79767976    /* szDriverName */
    79777977    "MainStatus",
     7978    /* szRCMod */
     7979    "",
     7980    /* szR0Mod */
     7981    "",
    79787982    /* pszDescription */
    79797983    "Main status driver (Main as in the API).",
     
    79907994    /* pfnDestruct */
    79917995    Console::drvStatus_Destruct,
     7996    /* pfnRelocate */
     7997    NULL,
    79927998    /* pfnIOCtl */
    79937999    NULL,
  • trunk/src/VBox/Main/DisplayImpl.cpp

    r25860 r25893  
    35083508    /* szDriverName */
    35093509    "MainDisplay",
     3510    /* szRCMod */
     3511    "",
     3512    /* szR0Mod */
     3513    "",
    35103514    /* pszDescription */
    35113515    "Main display driver (Main as in the API).",
     
    35223526    /* pfnDestruct */
    35233527    Display::drvDestruct,
     3528    /* pfnRelocate */
     3529    NULL,
    35243530    /* pfnIOCtl */
    35253531    NULL,
  • trunk/src/VBox/Main/KeyboardImpl.cpp

    r25860 r25893  
    332332    /* szDriverName */
    333333    "MainKeyboard",
     334    /* szRCMod */
     335    "",
     336    /* szR0Mod */
     337    "",
    334338    /* pszDescription */
    335339    "Main keyboard driver (Main as in the API).",
     
    346350    /* pfnDestruct */
    347351    Keyboard::drvDestruct,
     352    /* pfnRelocate */
     353    NULL,
    348354    /* pfnIOCtl */
    349355    NULL,
  • trunk/src/VBox/Main/MouseImpl.cpp

    r25860 r25893  
    459459    /* szDriverName */
    460460    "MainMouse",
     461    /* szRCMod */
     462    "",
     463    /* szR0Mod */
     464    "",
    461465    /* pszDescription */
    462466    "Main mouse driver (Main as in the API).",
     
    473477    /* pfnDestruct */
    474478    Mouse::drvDestruct,
     479    /* pfnRelocate */
     480    NULL,
    475481    /* pfnIOCtl */
    476482    NULL,
  • trunk/src/VBox/Main/VMMDevInterface.cpp

    r22793 r25893  
    836836    /* szDriverName */
    837837    "HGCM",
     838    /* szRCMod */
     839    "",
     840    /* szR0Mod */
     841    "",
    838842    /* pszDescription */
    839843    "Main VMMDev driver (Main as in the API).",
     
    850854    /* pfnDestruct */
    851855    VMMDev::drvDestruct,
     856    /* pfnRelocate */
     857    NULL,
    852858    /* pfnIOCtl */
    853859    NULL,
  • trunk/src/VBox/Main/include/KeyboardImpl.h

    r23223 r25893  
    107107};
    108108
    109 #endif // ____H_KEYBOARDIMPL
     109#endif // !____H_KEYBOARDIMPL
    110110/* vi: set tabstop=4 shiftwidth=4 expandtab: */
  • trunk/src/VBox/VMM/PDMDevHlp.cpp

    r25891 r25893  
    55
    66/*
    7  * Copyright (C) 2006-2007 Sun Microsystems, Inc.
     7 * Copyright (C) 2006-2010 Sun Microsystems, Inc.
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
  • trunk/src/VBox/VMM/PDMDevice.cpp

    r24730 r25893  
    55
    66/*
    7  * Copyright (C) 2006-2007 Sun Microsystems, Inc.
     7 * Copyright (C) 2006-2010 Sun Microsystems, Inc.
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
  • trunk/src/VBox/VMM/PDMDriver.cpp

    r25891 r25893  
    276276     */
    277277    AssertPtrReturn(pDrvReg, VERR_INVALID_POINTER);
    278     AssertMsgReturn(pDrvReg->u32Version == PDM_DRVREG_VERSION, ("%#x\n", pDrvReg->u32Version), VERR_PDM_UNKNOWN_DRVREG_VERSION);
     278    AssertMsgReturn(pDrvReg->u32Version == PDM_DRVREG_VERSION,
     279                    ("%#x\n", pDrvReg->u32Version),
     280                    VERR_PDM_UNKNOWN_DRVREG_VERSION);
    279281    AssertReturn(pDrvReg->szDriverName[0], VERR_PDM_INVALID_DRIVER_REGISTRATION);
    280282    AssertMsgReturn(memchr(pDrvReg->szDriverName, '\0', sizeof(pDrvReg->szDriverName)),
    281283                    (".*s\n", sizeof(pDrvReg->szDriverName), pDrvReg->szDriverName),
    282284                    VERR_PDM_INVALID_DRIVER_REGISTRATION);
     285    AssertMsgReturn(    !(pDrvReg->fFlags & PDM_DRVREG_FLAGS_R0)
     286                    ||  (   pDrvReg->szR0Mod[0]
     287                         && memchr(pDrvReg->szR0Mod, '\0', sizeof(pDrvReg->szR0Mod))),
     288                    ("%s: %.*s\n", pDrvReg->szDriverName, sizeof(pDrvReg->szR0Mod), pDrvReg->szR0Mod),
     289                    VERR_PDM_INVALID_DRIVER_REGISTRATION);
     290    AssertMsgReturn(    !(pDrvReg->fFlags & PDM_DRVREG_FLAGS_RC)
     291                    ||  (   pDrvReg->szRCMod[0]
     292                         && memchr(pDrvReg->szRCMod, '\0', sizeof(pDrvReg->szRCMod))),
     293                    ("%s: %.*s\n", pDrvReg->szDriverName, sizeof(pDrvReg->szRCMod), pDrvReg->szRCMod),
     294                    VERR_PDM_INVALID_DRIVER_REGISTRATION);
     295    AssertMsgReturn(VALID_PTR(pDrvReg->pszDescription),
     296                    ("%s: %p\n", pDrvReg->szDriverName, pDrvReg->pszDescription),
     297                    VERR_PDM_INVALID_DRIVER_REGISTRATION);
     298    AssertMsgReturn(!(pDrvReg->fFlags & ~(PDM_DRVREG_FLAGS_HOST_BITS_MASK | PDM_DRVREG_FLAGS_R0 | PDM_DRVREG_FLAGS_RC)),
     299                    ("%s: %#x\n", pDrvReg->szDriverName, pDrvReg->fFlags),
     300                    VERR_PDM_INVALID_DRIVER_REGISTRATION);
    283301    AssertMsgReturn((pDrvReg->fFlags & PDM_DRVREG_FLAGS_HOST_BITS_MASK) == PDM_DRVREG_FLAGS_HOST_BITS_DEFAULT,
    284                     ("%s: fFlags=%#x\n", pDrvReg->szDriverName, pDrvReg->fFlags),
     302                    ("%s: %#x\n", pDrvReg->szDriverName, pDrvReg->fFlags),
    285303                    VERR_PDM_INVALID_DRIVER_HOST_BITS);
    286     AssertMsgReturn(pDrvReg->cMaxInstances > 0, ("%s: %#x\n", pDrvReg->szDriverName, pDrvReg->cMaxInstances),
     304    AssertMsgReturn(pDrvReg->cMaxInstances > 0,
     305                    ("%s: %#x\n", pDrvReg->szDriverName, pDrvReg->cMaxInstances),
    287306                    VERR_PDM_INVALID_DRIVER_REGISTRATION);
    288     AssertMsgReturn(pDrvReg->cbInstance <= _1M, ("%s: %#x\n", pDrvReg->szDriverName, pDrvReg->cbInstance),
     307    AssertMsgReturn(pDrvReg->cbInstance <= _1M,
     308                    ("%s: %#x\n", pDrvReg->szDriverName, pDrvReg->cbInstance),
    289309                    VERR_PDM_INVALID_DRIVER_REGISTRATION);
    290     AssertMsgReturn(VALID_PTR(pDrvReg->pfnConstruct), ("%s: %p\n", pDrvReg->szDriverName, pDrvReg->pfnConstruct),
     310    AssertMsgReturn(VALID_PTR(pDrvReg->pfnConstruct),
     311                    ("%s: %p\n", pDrvReg->szDriverName, pDrvReg->pfnConstruct),
    291312                    VERR_PDM_INVALID_DRIVER_REGISTRATION);
    292     AssertMsgReturn(pDrvReg->pfnSoftReset == NULL, ("%s: %p\n", pDrvReg->szDriverName, pDrvReg->pfnSoftReset),
     313    AssertMsgReturn(VALID_PTR(pDrvReg->pfnRelocate) || !(pDrvReg->fFlags & PDM_DRVREG_FLAGS_RC),
     314                    ("%s: %#x\n", pDrvReg->szDriverName, pDrvReg->cbInstance),
    293315                    VERR_PDM_INVALID_DRIVER_REGISTRATION);
    294     AssertMsgReturn(pDrvReg->u32VersionEnd == PDM_DRVREG_VERSION, ("%s: #x\n", pDrvReg->szDriverName, pDrvReg->u32VersionEnd),
     316    AssertMsgReturn(pDrvReg->pfnSoftReset == NULL,
     317                    ("%s: %p\n", pDrvReg->szDriverName, pDrvReg->pfnSoftReset),
     318                    VERR_PDM_INVALID_DRIVER_REGISTRATION);
     319    AssertMsgReturn(pDrvReg->u32VersionEnd == PDM_DRVREG_VERSION,
     320                    ("%s: #x\n", pDrvReg->szDriverName, pDrvReg->u32VersionEnd),
    295321                    VERR_PDM_INVALID_DRIVER_REGISTRATION);
    296322
     
    910936
    911937/** @copydoc PDMDRVHLP::pfnPDMQueueCreate */
    912 static DECLCALLBACK(int) pdmR3DrvHlp_PDMQueueCreate(PPDMDRVINS pDrvIns, RTUINT cbItem, RTUINT cItems, uint32_t cMilliesInterval,
     938static DECLCALLBACK(int) pdmR3DrvHlp_PDMQueueCreate(PPDMDRVINS pDrvIns, uint32_t cbItem, uint32_t cItems, uint32_t cMilliesInterval,
    913939                                                    PFNPDMQUEUEDRV pfnCallback, const char *pszName, PPDMQUEUE *ppQueue)
    914940{
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