VirtualBox

Changeset 13373

Show
Ignore:
Timestamp:
10/17/08 14:36:57 (3 months ago)
Author:
vboxsync
Message:

Removed the new MMIO functionality. Will do it in a different way.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/include/VBox/iom.h

    r13368 r13373  
    8484                                ) \ 
    8585                            ) 
    86  
    87 /** 
    88  * MMIO type 
    89  */ 
    90 typedef enum IOMMMIOTYPE 
    91 { 
    92     /** 'Normal' MMIO. Reads and writes always fault. */ 
    93     IOMMMIOTYPE_MMIO = 1, 
    94     /** MMIO region backed by memory; protection can be turned off temporarily. */ 
    95     IOMMMIOTYPE_MMIO_WITH_RAM_BACKING, 
    96     /** The usual 32-bit type size hack. */ 
    97     IOMMMIOTYPE_32BIT_HACK = 0x7fffffff 
    98 } IOMMMIOTYPE; 
    9986 
    10087/** 
     
    262249VMMR3DECL(int)  IOMR3IOPortDeregister(PVM pVM, PPDMDEVINS pDevIns, RTIOPORT PortStart, RTUINT cPorts); 
    263250 
    264 VMMR3DECL(int)  IOMR3MMIORegisterR3(PVM pVM, PPDMDEVINS pDevIns, IOMMMIOTYPE enmMMIOType, RTGCPHYS GCPhysStart, RTUINT cbRange, RTHCPTR pvUser, 
     251VMMR3DECL(int)  IOMR3MMIORegisterR3(PVM pVM, PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, RTHCPTR pvUser, 
    265252                                    R3PTRTYPE(PFNIOMMMIOWRITE) pfnWriteCallback, 
    266253                                    R3PTRTYPE(PFNIOMMMIOREAD)  pfnReadCallback, 
  • trunk/include/VBox/pdmdev.h

    r13371 r13373  
    27672767    DECLR3CALLBACKMEMBER(int, pfnUnregisterVMMDevHeap,(PPDMDEVINS pDevIns, RTGCPHYS GCPhys)); 
    27682768 
    2769     /** 
    2770      * Register a Memory Mapped I/O (MMIO) region with backing memory (or use existing memory if part of guest ram) 
    2771      * 
    2772      * These callbacks are of course for the host context (HC). 
    2773      * Register HC handlers before guest context (GC) handlers! There must be a 
    2774      * HC handler for every GC handler! 
    2775      * 
    2776      * @returns VBox status. 
    2777      * @param   pDevIns             The device instance to register the MMIO with. 
    2778      * @param   enmMMIOType         MMIO Type 
    2779      * @param   GCPhysStart         First physical address in the range. 
    2780      * @param   cbRange             The size of the range (in bytes). 
    2781      * @param   pvUser              User argument. 
    2782      * @param   pfnWrite            Pointer to function which is gonna handle Write operations. 
    2783      * @param   pfnRead             Pointer to function which is gonna handle Read operations. 
    2784      * @param   pfnFill             Pointer to function which is gonna handle Fill/memset operations. (optional) 
    2785      * @param   pszDesc             Pointer to description string. This must not be freed. 
    2786      */ 
    2787     DECLR3CALLBACKMEMBER(int, pfnMMIORegisterEx,(PPDMDEVINS pDevIns, IOMMMIOTYPE enmMMIOType, RTGCPHYS GCPhysStart, RTUINT cbRange, RTHCPTR pvUser, 
    2788                                                  PFNIOMMMIOWRITE pfnWrite, PFNIOMMMIOREAD pfnRead, PFNIOMMMIOFILL pfnFill, 
    2789                                                  const char *pszDesc)); 
    2790  
    27912769    /** @} */ 
    27922770 
     
    32663244 
    32673245/** 
    3268  * @copydoc PDMDEVHLPR3::pfnMMIORegisterEx 
    3269  */ 
    3270 DECLINLINE(int) PDMDevHlpMMIORegisterEx(PPDMDEVINS pDevIns, IOMMMIOTYPE enmMMIOType, RTGCPHYS GCPhysStart, RTUINT cbRange, RTHCPTR pvUser, 
    3271                                         PFNIOMMMIOWRITE pfnWrite, PFNIOMMMIOREAD pfnRead, PFNIOMMMIOFILL pfnFill, 
    3272                                         const char *pszDesc) 
    3273 { 
    3274     return pDevIns->pDevHlpR3->pfnMMIORegisterEx(pDevIns, enmMMIOType, GCPhysStart, cbRange, pvUser, pfnWrite, pfnRead, pfnFill, pszDesc); 
    3275 } 
    3276  
    3277 /** 
    32783246 * @copydoc PDMDEVHLPR3::pfnMMIORegisterGC 
    32793247 */ 
  • trunk/src/VBox/VMM/IOM.cpp

    r13371 r13373  
    13511351 * @param   pVM                 VM handle. 
    13521352 * @param   pDevIns             PDM device instance owning the MMIO range. 
    1353  * @param   enmMMIOType         MMIO Type 
    13541353 * @param   GCPhysStart         First physical address in the range. 
    13551354 * @param   cbRange             The size of the range (in bytes). 
     
    13601359 * @param   pszDesc             Pointer to description string. This must not be freed. 
    13611360 */ 
    1362 VMMR3DECL(int)  IOMR3MMIORegisterR3(PVM pVM, PPDMDEVINS pDevIns, IOMMMIOTYPE enmMMIOType, RTGCPHYS GCPhysStart, RTUINT cbRange, RTHCPTR pvUser, 
     1361VMMR3DECL(int)  IOMR3MMIORegisterR3(PVM pVM, PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, RTHCPTR pvUser, 
    13631362                                    R3PTRTYPE(PFNIOMMMIOWRITE) pfnWriteCallback, R3PTRTYPE(PFNIOMMMIOREAD) pfnReadCallback, 
    13641363                                    R3PTRTYPE(PFNIOMMMIOFILL) pfnFillCallback, const char *pszDesc) 
     
    13991398        pRange->GCPhys              = GCPhysStart; 
    14001399        pRange->cb                  = cbRange; 
    1401         pRange->enmType             = enmMMIOType; 
    14021400        pRange->pszDesc             = pszDesc; 
    14031401 
     
    14231421         * Try register it with PGM and then insert it into the tree. 
    14241422         */ 
    1425         if (pRange->enmType == IOMMMIOTYPE_MMIO) 
    1426         { 
    1427             rc = PGMR3PhysMMIORegister(pVM, GCPhysStart, cbRange, 
    1428                                        IOMR3MMIOHandler, pRange, 
    1429                                        pVM->iom.s.pfnMMIOHandlerR0, MMHyperR3ToR0(pVM, pRange), 
    1430                                        pVM->iom.s.pfnMMIOHandlerRC, MMHyperR3ToRC(pVM, pRange), pszDesc); 
    1431         } 
    1432         else 
    1433         { 
    1434             /** @todo Currently assumes it's for existing memory *only*! */ 
    1435             rc = PGMHandlerPhysicalRegisterEx(pVM, PGMPHYSHANDLERTYPE_PHYSICAL_ALL, GCPhysStart, GCPhysStart + (cbRange - 1), 
    1436                                               IOMR3MMIOHandler, pRange, 
    1437                                               pVM->iom.s.pfnMMIOHandlerR0, MMHyperR3ToR0(pVM, pRange), 
    1438                                               pVM->iom.s.pfnMMIOHandlerRC, MMHyperR3ToRC(pVM, pRange), pszDesc); 
    1439         } 
     1423        rc = PGMR3PhysMMIORegister(pVM, GCPhysStart, cbRange, 
     1424                                    IOMR3MMIOHandler, pRange, 
     1425                                    pVM->iom.s.pfnMMIOHandlerR0, MMHyperR3ToR0(pVM, pRange), 
     1426                                    pVM->iom.s.pfnMMIOHandlerRC, MMHyperR3ToRC(pVM, pRange), pszDesc); 
    14401427 
    14411428        if (RT_SUCCESS(rc)) 
     
    16241611 
    16251612        /* remove it from PGM */ 
    1626         if (pRange->enmType == IOMMMIOTYPE_MMIO) 
    1627             rc = PGMR3PhysMMIODeregister(pVM, GCPhys, pRange->cb); 
    1628         else 
    1629             rc = PGMHandlerPhysicalDeregister(pVM, GCPhys); 
     1613        rc = PGMR3PhysMMIODeregister(pVM, GCPhys, pRange->cb); 
    16301614 
    16311615        /* advance and free. */ 
  • trunk/src/VBox/VMM/IOMInternal.h

    r13371 r13373  
    5050    /** Size of the range. */ 
    5151    uint32_t                    cb; 
    52     /** MMIO type. */ 
    53     IOMMMIOTYPE                 enmType; 
     52    uint32_t                    uAlignmnet; 
    5453 
    5554    /** Pointer to user argument - R3. */ 
  • trunk/src/VBox/VMM/PDMDevHlp.cpp

    r13368 r13373  
    211211             pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, GCPhysStart, cbRange, pvUser, pfnWrite, pfnRead, pfnFill, pszDesc, pszDesc)); 
    212212 
    213     int rc = IOMR3MMIORegisterR3(pDevIns->Internal.s.pVMR3, pDevIns, IOMMMIOTYPE_MMIO, GCPhysStart, cbRange, pvUser, pfnWrite, pfnRead, pfnFill, pszDesc); 
    214  
    215     LogFlow(("pdmR3DevHlp_MMIORegister: caller='%s'/%d: returns %Vrc\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, rc)); 
    216     return rc; 
    217 
    218  
    219 /** 
    220  * @copydoc PDMDEVHLPR3::pfnMMIORegisterEx 
    221  */ 
    222 static DECLCALLBACK(int) pdmR3DevHlp_MMIORegisterEx(PPDMDEVINS pDevIns, IOMMMIOTYPE enmMMIOType, RTGCPHYS GCPhysStart, RTUINT cbRange, RTHCPTR pvUser, 
    223                                                     PFNIOMMMIOWRITE pfnWrite, PFNIOMMMIOREAD pfnRead, PFNIOMMMIOFILL pfnFill, 
    224                                                     const char *pszDesc) 
    225 
    226     PDMDEV_ASSERT_DEVINS(pDevIns); 
    227     VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3); 
    228     LogFlow(("pdmR3DevHlp_MMIORegister: caller='%s'/%d: GCPhysStart=%VGp cbRange=%#x pvUser=%p pfnWrite=%p pfnRead=%p pfnFill=%p pszDesc=%p:{%s}\n", 
    229              pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, GCPhysStart, cbRange, pvUser, pfnWrite, pfnRead, pfnFill, pszDesc, pszDesc)); 
    230  
    231     int rc = IOMR3MMIORegisterR3(pDevIns->Internal.s.pVMR3, pDevIns, enmMMIOType, GCPhysStart, cbRange, pvUser, pfnWrite, pfnRead, pfnFill, pszDesc); 
     213    int rc = IOMR3MMIORegisterR3(pDevIns->Internal.s.pVMR3, pDevIns, GCPhysStart, cbRange, pvUser, pfnWrite, pfnRead, pfnFill, pszDesc); 
    232214 
    233215    LogFlow(("pdmR3DevHlp_MMIORegister: caller='%s'/%d: returns %Vrc\n", pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, rc)); 
     
    27152697    pdmR3DevHlp_RegisterVMMDevHeap, 
    27162698    pdmR3DevHlp_UnregisterVMMDevHeap, 
    2717     pdmR3DevHlp_MMIORegisterEx, 
    27182699    PDM_DEVHLP_VERSION /* the end */ 
    27192700}; 
     
    31863167    pdmR3DevHlp_Untrusted_RegisterVMMDevHeap, 
    31873168    pdmR3DevHlp_Untrusted_UnregisterVMMDevHeap, 
    3188     pdmR3DevHlp_MMIORegisterEx, 
    31893169    PDM_DEVHLP_VERSION /* the end */ 
    31903170}; 

© 2008 Sun Microsystems, Inc.
ContactPrivacy policy