VirtualBox

Changeset 10538 in vbox


Ignore:
Timestamp:
Jul 11, 2008 5:53:49 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
33226
Message:

Fixed ring 3 mmio handling (unused previously).

Location:
trunk/src/VBox/VMM
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/IOM.cpp

    r10473 r10538  
    14591459         */
    14601460        rc = PGMR3PhysMMIORegister(pVM, GCPhysStart, cbRange,
    1461                                    /*IOMR3MMIOHandler*/ NULL, pRange,
     1461                                   IOMR3MMIOHandler, pRange,
    14621462                                   pVM->iom.s.pfnMMIOHandlerR0, MMHyperR3ToR0(pVM, pRange),
    14631463                                   pVM->iom.s.pfnMMIOHandlerGC, MMHyperR3ToGC(pVM, pRange), pszDesc);
  • trunk/src/VBox/VMM/IOMInternal.h

    r10473 r10538  
    438438IOMDECL(int) IOMMMIOHandler(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, RTGCPHYS GCPhysFault, void *pvUser);
    439439
     440#ifdef IN_RING3
     441/**
     442 * \#PF Handler callback for MMIO ranges.
     443 *
     444 * @returns VINF_SUCCESS if the handler have carried out the operation.
     445 * @returns VINF_PGM_HANDLER_DO_DEFAULT if the caller should carry out the access operation.
     446 * @param   pVM             VM Handle.
     447 * @param   GCPhys          The physical address the guest is writing to.
     448 * @param   pvPhys          The HC mapping of that address.
     449 * @param   pvBuf           What the guest is reading/writing.
     450 * @param   cbBuf           How much it's reading/writing.
     451 * @param   enmAccessType   The access type.
     452 * @param   pvUser      Pointer to the MMIO range entry.
     453 */
     454DECLCALLBACK(int) IOMR3MMIOHandler(PVM pVM, RTGCPHYS GCPhys, void *pvPhys, void *pvBuf, size_t cbBuf, PGMACCESSTYPE enmAccessType, void *pvUser);
     455#endif
     456
    440457/**
    441458 * Gets the I/O port range for the specified I/O port in the current context.
  • trunk/src/VBox/VMM/VMMAll/IOMAllMMIO.cpp

    r10473 r10538  
    12021202
    12031203
     1204#ifdef IN_RING3
     1205/**
     1206 * \#PF Handler callback for MMIO ranges.
     1207 *
     1208 * @returns VINF_SUCCESS if the handler have carried out the operation.
     1209 * @returns VINF_PGM_HANDLER_DO_DEFAULT if the caller should carry out the access operation.
     1210 * @param   pVM             VM Handle.
     1211 * @param   GCPhys          The physical address the guest is writing to.
     1212 * @param   pvPhys          The HC mapping of that address.
     1213 * @param   pvBuf           What the guest is reading/writing.
     1214 * @param   cbBuf           How much it's reading/writing.
     1215 * @param   enmAccessType   The access type.
     1216 * @param   pvUser          Pointer to the MMIO range entry.
     1217 */
     1218DECLCALLBACK(int) IOMR3MMIOHandler(PVM pVM, RTGCPHYS GCPhysFault, void *pvPhys, void *pvBuf, size_t cbBuf, PGMACCESSTYPE enmAccessType, void *pvUser)
     1219{
     1220    int           rc;
     1221    PIOMMMIORANGE pRange = (PIOMMMIORANGE)pvUser;
     1222
     1223    Assert(pRange);
     1224    Assert(pRange == iomMMIOGetRange(&pVM->iom.s, GCPhysFault));
     1225
     1226    if (enmAccessType == PGMACCESSTYPE_READ)
     1227        rc = iomMMIODoRead(pVM, pRange, GCPhysFault, pvBuf, cbBuf);
     1228    else
     1229        rc = iomMMIODoWrite(pVM, pRange, GCPhysFault, pvBuf, cbBuf);
     1230
     1231    AssertRC(rc);
     1232    return rc;
     1233}
     1234#endif /* IN_RING3 */
     1235
     1236
    12041237/**
    12051238 * Reads a MMIO register.
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