VirtualBox

Changeset 4615 in vbox


Ignore:
Timestamp:
Sep 7, 2007 7:25:16 PM (17 years ago)
Author:
vboxsync
Message:

REM(R3)NotifyHandlerPhysicalModify no longer needs a pvHC pointer, made it a flag instead.

Location:
trunk
Files:
6 edited

Legend:

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

    r4388 r4615  
    7979 * @param   cb              Size of the handler range.
    8080 * @param   fHasHCHandler   Set if the handler have a HC callback function.
    81  * @param   pvHCPtr         The HC virtual address corresponding to GCPhys if available.
    82  */
    83 REMDECL(void) REMNotifyHandlerPhysicalModify(PVM pVM, PGMPHYSHANDLERTYPE enmType, RTGCPHYS GCPhysOld, RTGCPHYS GCPhysNew, RTGCPHYS cb, bool fHasHCHandler, RTHCPTR pvHCPtr);
     81 * @param   fRestoreAsRAM   Whether the to restore it as normal RAM or as unassigned memory.
     82 */
     83REMDECL(void) REMNotifyHandlerPhysicalModify(PVM pVM, PGMPHYSHANDLERTYPE enmType, RTGCPHYS GCPhysOld, RTGCPHYS GCPhysNew, RTGCPHYS cb, bool fHasHCHandler, bool fRestoreAsRAM);
    8484
    8585#endif /* IN_RING0 || IN_GC */
     
    344344 * @param   cb              Size of the handler range.
    345345 * @param   fHasHCHandler   Set if the handler have a HC callback function.
    346  * @param   pvHCPtr         The HC virtual address corresponding to GCPhys if available.
    347  */
    348 REMR3DECL(void) REMR3NotifyHandlerPhysicalModify(PVM pVM, PGMPHYSHANDLERTYPE enmType, RTGCPHYS GCPhysOld, RTGCPHYS GCPhysNew, RTGCPHYS cb, bool fHasHCHandler, void *pvHCPtr);
     346 * @param   fRestoreAsRAM   Whether the to restore it as normal RAM or as unassigned memory.
     347 */
     348REMR3DECL(void) REMR3NotifyHandlerPhysicalModify(PVM pVM, PGMPHYSHANDLERTYPE enmType, RTGCPHYS GCPhysOld, RTGCPHYS GCPhysNew, RTGCPHYS cb, bool fHasHCHandler, bool fRestoreAsRAM);
    349349
    350350/**
  • trunk/src/VBox/VMM/REMInternal.h

    r4071 r4615  
    9292        struct
    9393        {
    94             RTHCPTR             pvHCPtr;
    9594            RTGCPHYS            GCPhysOld;
    9695            RTGCPHYS            GCPhysNew;
     
    9897            PGMPHYSHANDLERTYPE  enmType;
    9998            bool                fHasHCHandler;
     99            bool                fRestoreAsRAM;
    100100        } PhysicalModify;
    101101        uint64_t                padding[3 + (HC_ARCH_BITS == 64)];
  • trunk/src/VBox/VMM/VMMAll/PGMAllHandler.cpp

    r4071 r4615  
    495495         */
    496496        pgmHandlerPhysicalResetRamFlags(pVM, pCur);
    497         RTHCPTR pvRange = 0;
    498         if (pCur->pfnHandlerR3 && pCur->enmType != PGMPHYSHANDLERTYPE_MMIO)
    499             PGMRamGCPhys2HCPtr(&pVM->pgm.s, GCPhysCurrent, &pvRange); /* ASSUMES it doesn't change pvRange on failure. */
     497        const bool fRestoreAsRAM = pCur->pfnHandlerR3
     498                                && pCur->enmType != PGMPHYSHANDLERTYPE_MMIO; /** @todo this isn't entirely correct. */
    500499
    501500        /*
     
    534533#ifndef IN_RING3
    535534                    REMNotifyHandlerPhysicalModify(pVM, pCur->enmType, GCPhysCurrent, GCPhys,
    536                                                    pCur->Core.KeyLast - GCPhys + 1, !!pCur->pfnHandlerR3, pvRange);
     535                                                   pCur->Core.KeyLast - GCPhys + 1, !!pCur->pfnHandlerR3, fRestoreAsRAM);
    537536#else
    538537                    REMR3NotifyHandlerPhysicalModify(pVM, pCur->enmType, GCPhysCurrent, GCPhys,
    539                                                      pCur->Core.KeyLast - GCPhys + 1, !!pCur->pfnHandlerR3, pvRange);
     538                                                     pCur->Core.KeyLast - GCPhys + 1, !!pCur->pfnHandlerR3, fRestoreAsRAM);
    540539#endif
    541540                    pgmUnlock(pVM);
     
    544543                    return VINF_SUCCESS;
    545544                }
     545
    546546                AssertMsgFailed(("Conflict! GCPhys=%VGp GCPhysLast=%VGp\n", GCPhys, GCPhysLast));
    547547                rc = VERR_PGM_HANDLER_PHYSICAL_CONFLICT;
  • trunk/src/VBox/VMM/VMMAll/REMAll.cpp

    r4268 r4615  
    129129 * @param   cb              Size of the handler range.
    130130 * @param   fHasHCHandler   Set if the handler have a HC callback function.
    131  * @param   pvHCPtr         The HC virtual address corresponding to GCPhys if available.
     131 * @param   fRestoreAsRAM   Whether the to restore it as normal RAM or as unassigned memory.
    132132 */
    133 REMDECL(void) REMNotifyHandlerPhysicalModify(PVM pVM, PGMPHYSHANDLERTYPE enmType, RTGCPHYS GCPhysOld, RTGCPHYS GCPhysNew, RTGCPHYS cb, bool fHasHCHandler, RTHCPTR pvHCPtr)
     133REMDECL(void) REMNotifyHandlerPhysicalModify(PVM pVM, PGMPHYSHANDLERTYPE enmType, RTGCPHYS GCPhysOld, RTGCPHYS GCPhysNew, RTGCPHYS cb, bool fHasHCHandler, bool fRestoreAsRAM)
    134134{
    135135    if (pVM->rem.s.cHandlerNotifications >= ELEMENTS(pVM->rem.s.aHandlerNotifications))
     
    142142    pRec->u.PhysicalModify.cb = cb;
    143143    pRec->u.PhysicalModify.fHasHCHandler = fHasHCHandler;
    144     pRec->u.PhysicalModify.pvHCPtr = pvHCPtr;
     144    pRec->u.PhysicalModify.fRestoreAsRAM = fRestoreAsRAM;
    145145}
    146146
  • trunk/src/recompiler/VBoxREMWrapper.cpp

    r4407 r4615  
    339339static DECLCALLBACKPTR(void, pfnREMR3NotifyPhysReserve)(PVM, RTGCPHYS, RTUINT);
    340340static DECLCALLBACKPTR(void, pfnREMR3NotifyPhysRomRegister)(PVM, RTGCPHYS, RTUINT, void *, bool);
    341 static DECLCALLBACKPTR(void, pfnREMR3NotifyHandlerPhysicalModify)(PVM, PGMPHYSHANDLERTYPE, RTGCPHYS, RTGCPHYS, RTGCPHYS, bool, void *);
     341static DECLCALLBACKPTR(void, pfnREMR3NotifyHandlerPhysicalModify)(PVM, PGMPHYSHANDLERTYPE, RTGCPHYS, RTGCPHYS, RTGCPHYS, bool, bool);
    342342static DECLCALLBACKPTR(void, pfnREMR3NotifyHandlerPhysicalRegister)(PVM, PGMPHYSHANDLERTYPE, RTGCPHYS, RTGCPHYS, bool);
    343343static DECLCALLBACKPTR(void, pfnREMR3NotifyHandlerPhysicalDeregister)(PVM, PGMPHYSHANDLERTYPE, RTGCPHYS, RTGCPHYS, bool, void *);
     
    421421    { REMPARMDESC_FLAGS_GCPHYS,     sizeof(RTGCPHYS), NULL },
    422422    { REMPARMDESC_FLAGS_INT,        sizeof(bool), NULL },
    423     { REMPARMDESC_FLAGS_INT,        sizeof(void *), NULL }
     423    { REMPARMDESC_FLAGS_INT,        sizeof(bool), NULL }
    424424};
    425425static const REMPARMDESC g_aArgsNotifyHandlerPhysicalRegister[] =
     
    20162016}
    20172017
    2018 REMR3DECL(void) REMR3NotifyHandlerPhysicalModify(PVM pVM, PGMPHYSHANDLERTYPE enmType, RTGCPHYS GCPhysOld, RTGCPHYS GCPhysNew, RTGCPHYS cb, bool fHasHCHandler, void *pvHCPtr)
     2018REMR3DECL(void) REMR3NotifyHandlerPhysicalModify(PVM pVM, PGMPHYSHANDLERTYPE enmType, RTGCPHYS GCPhysOld, RTGCPHYS GCPhysNew, RTGCPHYS cb, bool fHasHCHandler, bool fRestoreAsRAM)
    20192019{
    20202020#ifndef USE_REM_STUBS
    20212021    Assert(VALID_PTR(pfnREMR3NotifyHandlerPhysicalModify));
    2022     pfnREMR3NotifyHandlerPhysicalModify(pVM, enmType, GCPhysOld, GCPhysNew, cb, fHasHCHandler, pvHCPtr);
     2022    pfnREMR3NotifyHandlerPhysicalModify(pVM, enmType, GCPhysOld, GCPhysNew, cb, fHasHCHandler, fRestoreAsRAM);
    20232023#endif
    20242024}
  • trunk/src/recompiler/VBoxRecompiler.c

    r4535 r4615  
    23782378                                                 pRec->u.PhysicalModify.cb,
    23792379                                                 pRec->u.PhysicalModify.fHasHCHandler,
    2380                                                  pRec->u.PhysicalModify.pvHCPtr);
     2380                                                 pRec->u.PhysicalModify.fRestoreAsRAM);
    23812381                break;
    23822382
     
    27052705 * @param   cb              Size of the handler range.
    27062706 * @param   fHasHCHandler   Set if the handler has a HC callback function.
    2707  * @param   pvHCPtr         The HC virtual address corresponding to GCPhys if available.
    2708  */
    2709 REMR3DECL(void) REMR3NotifyHandlerPhysicalModify(PVM pVM, PGMPHYSHANDLERTYPE enmType, RTGCPHYS GCPhysOld, RTGCPHYS GCPhysNew, RTGCPHYS cb, bool fHasHCHandler, void *pvHCPtr)
    2710 {
    2711     Log(("REMR3NotifyHandlerPhysicalModify: enmType=%d GCPhysOld=%VGp GCPhysNew=%VGp cb=%d fHasHCHandler=%d pvHCPtr=%p\n",
    2712           enmType, GCPhysOld, GCPhysNew, cb, fHasHCHandler, pvHCPtr));
     2707 * @param   fRestoreAsRAM   Whether the to restore it as normal RAM or as unassigned memory.
     2708 */
     2709REMR3DECL(void) REMR3NotifyHandlerPhysicalModify(PVM pVM, PGMPHYSHANDLERTYPE enmType, RTGCPHYS GCPhysOld, RTGCPHYS GCPhysNew, RTGCPHYS cb, bool fHasHCHandler, bool fRestoreAsRAM)
     2710{
     2711    Log(("REMR3NotifyHandlerPhysicalModify: enmType=%d GCPhysOld=%VGp GCPhysNew=%VGp cb=%d fHasHCHandler=%RTbool fRestoreAsRAM=%RTbool\n",
     2712          enmType, GCPhysOld, GCPhysNew, cb, fHasHCHandler, fRestoreAsRAM));
    27132713    VM_ASSERT_EMT(pVM);
    27142714    AssertReleaseMsg(enmType != PGMPHYSHANDLERTYPE_MMIO, ("enmType=%d\n", enmType));
     
    27252725         * Reset the old page.
    27262726         */
    2727         if (!pvHCPtr)
     2727        if (!fRestoreAsRAM)
    27282728            cpu_register_physical_memory(GCPhysOld, cb, IO_MEM_UNASSIGNED);
    27292729        else
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