VirtualBox

Changeset 55493 in vbox for trunk/src/recompiler


Ignore:
Timestamp:
Apr 28, 2015 4:51:35 PM (10 years ago)
Author:
vboxsync
Message:

PGM,++: Separated physical access handler callback function pointers from the access handler registrations to reduce footprint and simplify adding a couple of more callbacks.

Location:
trunk/src/recompiler
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/recompiler/VBoxREMWrapper.cpp

    r54737 r55493  
    366366static DECLCALLBACKPTR(void, pfnREMR3NotifyPhysRamDeregister)(PVM, RTGCPHYS, RTUINT);
    367367static DECLCALLBACKPTR(void, pfnREMR3NotifyPhysRomRegister)(PVM, RTGCPHYS, RTUINT, void *, bool);
    368 static DECLCALLBACKPTR(void, pfnREMR3NotifyHandlerPhysicalModify)(PVM, PGMPHYSHANDLERTYPE, RTGCPHYS, RTGCPHYS, RTGCPHYS, bool, bool);
    369 static DECLCALLBACKPTR(void, pfnREMR3NotifyHandlerPhysicalRegister)(PVM, PGMPHYSHANDLERTYPE, RTGCPHYS, RTGCPHYS, bool);
    370 static DECLCALLBACKPTR(void, pfnREMR3NotifyHandlerPhysicalDeregister)(PVM, PGMPHYSHANDLERTYPE, RTGCPHYS, RTGCPHYS, bool, bool);
     368static DECLCALLBACKPTR(void, pfnREMR3NotifyHandlerPhysicalModify)(PVM, PGMPHYSHANDLERKIND, RTGCPHYS, RTGCPHYS, RTGCPHYS, bool, bool);
     369static DECLCALLBACKPTR(void, pfnREMR3NotifyHandlerPhysicalRegister)(PVM, PGMPHYSHANDLERKIND, RTGCPHYS, RTGCPHYS, bool);
     370static DECLCALLBACKPTR(void, pfnREMR3NotifyHandlerPhysicalDeregister)(PVM, PGMPHYSHANDLERKIND, RTGCPHYS, RTGCPHYS, bool, bool);
    371371static DECLCALLBACKPTR(void, pfnREMR3NotifyInterruptSet)(PVM, PVMCPU);
    372372static DECLCALLBACKPTR(void, pfnREMR3NotifyInterruptClear)(PVM, PVMCPU);
     
    484484{
    485485    { REMPARMDESC_FLAGS_INT,        sizeof(PVM),                NULL },
    486     { REMPARMDESC_FLAGS_INT,        sizeof(PGMPHYSHANDLERTYPE), NULL },
     486    { REMPARMDESC_FLAGS_INT,        sizeof(PGMPHYSHANDLERKIND), NULL },
    487487    { REMPARMDESC_FLAGS_GCPHYS,     sizeof(RTGCPHYS),           NULL },
    488488    { REMPARMDESC_FLAGS_GCPHYS,     sizeof(RTGCPHYS),           NULL },
     
    494494{
    495495    { REMPARMDESC_FLAGS_INT,        sizeof(PVM),                NULL },
    496     { REMPARMDESC_FLAGS_INT,        sizeof(PGMPHYSHANDLERTYPE), NULL },
     496    { REMPARMDESC_FLAGS_INT,        sizeof(PGMPHYSHANDLERKIND), NULL },
    497497    { REMPARMDESC_FLAGS_GCPHYS,     sizeof(RTGCPHYS),           NULL },
    498498    { REMPARMDESC_FLAGS_GCPHYS,     sizeof(RTGCPHYS),           NULL },
     
    502502{
    503503    { REMPARMDESC_FLAGS_INT,        sizeof(PVM),                NULL },
    504     { REMPARMDESC_FLAGS_INT,        sizeof(PGMPHYSHANDLERTYPE), NULL },
     504    { REMPARMDESC_FLAGS_INT,        sizeof(PGMPHYSHANDLERKIND), NULL },
    505505    { REMPARMDESC_FLAGS_GCPHYS,     sizeof(RTGCPHYS),           NULL },
    506506    { REMPARMDESC_FLAGS_GCPHYS,     sizeof(RTGCPHYS),           NULL },
     
    23822382}
    23832383
    2384 REMR3DECL(void) REMR3NotifyHandlerPhysicalRegister(PVM pVM, PGMPHYSHANDLERTYPE enmType, RTGCPHYS GCPhys, RTGCPHYS cb, bool fHasHCHandler)
     2384REMR3DECL(void) REMR3NotifyHandlerPhysicalRegister(PVM pVM, PGMPHYSHANDLERKIND enmKind, RTGCPHYS GCPhys, RTGCPHYS cb, bool fHasHCHandler)
    23852385{
    23862386#ifndef USE_REM_STUBS
    23872387    Assert(VALID_PTR(pfnREMR3NotifyHandlerPhysicalRegister));
    2388     pfnREMR3NotifyHandlerPhysicalRegister(pVM, enmType, GCPhys, cb, fHasHCHandler);
    2389 #endif
    2390 }
    2391 
    2392 REMR3DECL(void) REMR3NotifyHandlerPhysicalDeregister(PVM pVM, PGMPHYSHANDLERTYPE enmType, RTGCPHYS GCPhys, RTGCPHYS cb, bool fHasHCHandler, bool fRestoreAsRAM)
     2388    pfnREMR3NotifyHandlerPhysicalRegister(pVM, enmKind, GCPhys, cb, fHasHCHandler);
     2389#endif
     2390}
     2391
     2392REMR3DECL(void) REMR3NotifyHandlerPhysicalDeregister(PVM pVM, PGMPHYSHANDLERKIND enmKind, RTGCPHYS GCPhys, RTGCPHYS cb, bool fHasHCHandler, bool fRestoreAsRAM)
    23932393{
    23942394#ifndef USE_REM_STUBS
    23952395    Assert(VALID_PTR(pfnREMR3NotifyHandlerPhysicalDeregister));
    2396     pfnREMR3NotifyHandlerPhysicalDeregister(pVM, enmType, GCPhys, cb, fHasHCHandler, fRestoreAsRAM);
    2397 #endif
    2398 }
    2399 
    2400 REMR3DECL(void) REMR3NotifyHandlerPhysicalModify(PVM pVM, PGMPHYSHANDLERTYPE enmType, RTGCPHYS GCPhysOld, RTGCPHYS GCPhysNew, RTGCPHYS cb, bool fHasHCHandler, bool fRestoreAsRAM)
     2396    pfnREMR3NotifyHandlerPhysicalDeregister(pVM, enmKind, GCPhys, cb, fHasHCHandler, fRestoreAsRAM);
     2397#endif
     2398}
     2399
     2400REMR3DECL(void) REMR3NotifyHandlerPhysicalModify(PVM pVM, PGMPHYSHANDLERKIND enmKind, RTGCPHYS GCPhysOld, RTGCPHYS GCPhysNew, RTGCPHYS cb, bool fHasHCHandler, bool fRestoreAsRAM)
    24012401{
    24022402#ifndef USE_REM_STUBS
    24032403    Assert(VALID_PTR(pfnREMR3NotifyHandlerPhysicalModify));
    2404     pfnREMR3NotifyHandlerPhysicalModify(pVM, enmType, GCPhysOld, GCPhysNew, cb, fHasHCHandler, fRestoreAsRAM);
     2404    pfnREMR3NotifyHandlerPhysicalModify(pVM, enmKind, GCPhysOld, GCPhysNew, cb, fHasHCHandler, fRestoreAsRAM);
    24052405#endif
    24062406}
  • trunk/src/recompiler/VBoxRecompiler.c

    r55048 r55493  
    116116static void     remR3HandlerWriteU32(void *pvVM, target_phys_addr_t GCPhys, uint32_t u32);
    117117
    118 static void remR3NotifyHandlerPhysicalDeregister(PVM pVM, PGMPHYSHANDLERTYPE enmType, RTGCPHYS GCPhys, RTGCPHYS cb, bool fHasHCHandler, bool fRestoreAsRAM);
    119 static void remR3NotifyHandlerPhysicalRegister(PVM pVM, PGMPHYSHANDLERTYPE enmType, RTGCPHYS GCPhys, RTGCPHYS cb, bool fHasHCHandler);
    120 static void remR3NotifyHandlerPhysicalModify(PVM pVM, PGMPHYSHANDLERTYPE enmType, RTGCPHYS GCPhysOld, RTGCPHYS GCPhysNew, RTGCPHYS cb, bool fHasHCHandler, bool fRestoreAsRAM);
     118static void remR3NotifyHandlerPhysicalDeregister(PVM pVM, PGMPHYSHANDLERKIND enmKind, RTGCPHYS GCPhys, RTGCPHYS cb, bool fHasHCHandler, bool fRestoreAsRAM);
     119static void remR3NotifyHandlerPhysicalRegister(PVM pVM, PGMPHYSHANDLERKIND enmKind, RTGCPHYS GCPhys, RTGCPHYS cb, bool fHasHCHandler);
     120static void remR3NotifyHandlerPhysicalModify(PVM pVM, PGMPHYSHANDLERKIND enmKind, RTGCPHYS GCPhysOld, RTGCPHYS GCPhysNew, RTGCPHYS cb, bool fHasHCHandler, bool fRestoreAsRAM);
     121
    121122
    122123/*******************************************************************************
     
    30903091                case REMHANDLERNOTIFICATIONKIND_PHYSICAL_REGISTER:
    30913092                    remR3NotifyHandlerPhysicalRegister(pVM,
    3092                                                        pCur->u.PhysicalRegister.enmType,
     3093                                                       pCur->u.PhysicalRegister.enmKind,
    30933094                                                       pCur->u.PhysicalRegister.GCPhys,
    30943095                                                       pCur->u.PhysicalRegister.cb,
     
    30983099                case REMHANDLERNOTIFICATIONKIND_PHYSICAL_DEREGISTER:
    30993100                    remR3NotifyHandlerPhysicalDeregister(pVM,
    3100                                                          pCur->u.PhysicalDeregister.enmType,
     3101                                                         pCur->u.PhysicalDeregister.enmKind,
    31013102                                                         pCur->u.PhysicalDeregister.GCPhys,
    31023103                                                         pCur->u.PhysicalDeregister.cb,
     
    31073108                case REMHANDLERNOTIFICATIONKIND_PHYSICAL_MODIFY:
    31083109                    remR3NotifyHandlerPhysicalModify(pVM,
    3109                                                      pCur->u.PhysicalModify.enmType,
     3110                                                     pCur->u.PhysicalModify.enmKind,
    31103111                                                     pCur->u.PhysicalModify.GCPhysOld,
    31113112                                                     pCur->u.PhysicalModify.GCPhysNew,
     
    33113312 *
    33123313 * @param   pVM             VM Handle.
    3313  * @param   enmType         Handler type.
     3314 * @param   enmKind         Kind of access handler.
    33143315 * @param   GCPhys          Handler range address.
    33153316 * @param   cb              Size of the handler range.
     
    33193320 *          Handler memory type to memory which has no HC handler.
    33203321 */
    3321 static void remR3NotifyHandlerPhysicalRegister(PVM pVM, PGMPHYSHANDLERTYPE enmType, RTGCPHYS GCPhys, RTGCPHYS cb, bool fHasHCHandler)
    3322 {
    3323     Log(("REMR3NotifyHandlerPhysicalRegister: enmType=%d GCPhys=%RGp cb=%RGp fHasHCHandler=%d\n",
    3324           enmType, GCPhys, cb, fHasHCHandler));
     3322static void remR3NotifyHandlerPhysicalRegister(PVM pVM, PGMPHYSHANDLERKIND enmKind, RTGCPHYS GCPhys, RTGCPHYS cb,
     3323                                               bool fHasHCHandler)
     3324{
     3325    Log(("REMR3NotifyHandlerPhysicalRegister: enmKind=%d GCPhys=%RGp cb=%RGp fHasHCHandler=%d\n",
     3326         enmKind, GCPhys, cb, fHasHCHandler));
    33253327
    33263328    VM_ASSERT_EMT(pVM);
     
    33323334
    33333335    PDMCritSectEnter(&pVM->rem.s.CritSectRegister, VERR_SEM_BUSY);
    3334     if (enmType == PGMPHYSHANDLERTYPE_MMIO)
     3336    if (enmKind == PGMPHYSHANDLERKIND_MMIO)
    33353337        cpu_register_physical_memory_offset(GCPhys, cb, pVM->rem.s.iMMIOMemType, GCPhys);
    33363338    else if (fHasHCHandler)
     
    33453347 *
    33463348 * @param   pVM             VM Handle.
    3347  * @param   enmType         Handler type.
     3349 * @param   enmKind         Kind of access handler.
    33483350 * @param   GCPhys          Handler range address.
    33493351 * @param   cb              Size of the handler range.
     
    33533355 *          Handler memory type to memory which has no HC handler.
    33543356 */
    3355 REMR3DECL(void) REMR3NotifyHandlerPhysicalRegister(PVM pVM, PGMPHYSHANDLERTYPE enmType, RTGCPHYS GCPhys, RTGCPHYS cb, bool fHasHCHandler)
     3357REMR3DECL(void) REMR3NotifyHandlerPhysicalRegister(PVM pVM, PGMPHYSHANDLERKIND enmKind, RTGCPHYS GCPhys, RTGCPHYS cb,
     3358                                                   bool fHasHCHandler)
    33563359{
    33573360    REMR3ReplayHandlerNotifications(pVM);
    33583361
    3359     remR3NotifyHandlerPhysicalRegister(pVM, enmType, GCPhys, cb, fHasHCHandler);
     3362    remR3NotifyHandlerPhysicalRegister(pVM, enmKind, GCPhys, cb, fHasHCHandler);
    33603363}
    33613364
     
    33643367 *
    33653368 * @param   pVM             VM Handle.
    3366  * @param   enmType         Handler type.
     3369 * @param   enmKind         Kind of access handler.
    33673370 * @param   GCPhys          Handler range address.
    33683371 * @param   cb              Size of the handler range.
     
    33703373 * @param   fRestoreAsRAM   Whether the to restore it as normal RAM or as unassigned memory.
    33713374 */
    3372 static void remR3NotifyHandlerPhysicalDeregister(PVM pVM, PGMPHYSHANDLERTYPE enmType, RTGCPHYS GCPhys, RTGCPHYS cb, bool fHasHCHandler, bool fRestoreAsRAM)
    3373 {
    3374     Log(("REMR3NotifyHandlerPhysicalDeregister: enmType=%d GCPhys=%RGp cb=%RGp fHasHCHandler=%RTbool fRestoreAsRAM=%RTbool RAM=%08x\n",
    3375           enmType, GCPhys, cb, fHasHCHandler, fRestoreAsRAM, MMR3PhysGetRamSize(pVM)));
     3375static void remR3NotifyHandlerPhysicalDeregister(PVM pVM, PGMPHYSHANDLERKIND enmKind, RTGCPHYS GCPhys, RTGCPHYS cb,
     3376                                                 bool fHasHCHandler, bool fRestoreAsRAM)
     3377{
     3378    Log(("REMR3NotifyHandlerPhysicalDeregister: enmKind=%d GCPhys=%RGp cb=%RGp fHasHCHandler=%RTbool fRestoreAsRAM=%RTbool RAM=%08x\n",
     3379         enmKind, GCPhys, cb, fHasHCHandler, fRestoreAsRAM, MMR3PhysGetRamSize(pVM)));
    33763380    VM_ASSERT_EMT(pVM);
    33773381
     
    33813385    PDMCritSectEnter(&pVM->rem.s.CritSectRegister, VERR_SEM_BUSY);
    33823386    /** @todo this isn't right, MMIO can (in theory) be restored as RAM. */
    3383     if (enmType == PGMPHYSHANDLERTYPE_MMIO)
     3387    if (enmKind == PGMPHYSHANDLERKIND_MMIO)
    33843388        cpu_register_physical_memory_offset(GCPhys, cb, IO_MEM_UNASSIGNED, GCPhys);
    33853389    else if (fHasHCHandler)
     
    34063410 *
    34073411 * @param   pVM             VM Handle.
    3408  * @param   enmType         Handler type.
     3412 * @param   enmKind         Kind of access handler.
    34093413 * @param   GCPhys          Handler range address.
    34103414 * @param   cb              Size of the handler range.
     
    34123416 * @param   fRestoreAsRAM   Whether the to restore it as normal RAM or as unassigned memory.
    34133417 */
    3414 REMR3DECL(void) REMR3NotifyHandlerPhysicalDeregister(PVM pVM, PGMPHYSHANDLERTYPE enmType, RTGCPHYS GCPhys, RTGCPHYS cb, bool fHasHCHandler, bool fRestoreAsRAM)
     3418REMR3DECL(void) REMR3NotifyHandlerPhysicalDeregister(PVM pVM, PGMPHYSHANDLERKIND enmKind, RTGCPHYS GCPhys, RTGCPHYS cb, bool fHasHCHandler, bool fRestoreAsRAM)
    34153419{
    34163420    REMR3ReplayHandlerNotifications(pVM);
    3417     remR3NotifyHandlerPhysicalDeregister(pVM, enmType, GCPhys, cb, fHasHCHandler, fRestoreAsRAM);
     3421    remR3NotifyHandlerPhysicalDeregister(pVM, enmKind, GCPhys, cb, fHasHCHandler, fRestoreAsRAM);
    34183422}
    34193423
     
    34233427 *
    34243428 * @param   pVM             VM Handle.
    3425  * @param   enmType         Handler type.
     3429 * @param   enmKind         Kind of access handler.
    34263430 * @param   GCPhysOld       Old handler range address.
    34273431 * @param   GCPhysNew       New handler range address.
     
    34303434 * @param   fRestoreAsRAM   Whether the to restore it as normal RAM or as unassigned memory.
    34313435 */
    3432 static void remR3NotifyHandlerPhysicalModify(PVM pVM, PGMPHYSHANDLERTYPE enmType, RTGCPHYS GCPhysOld, RTGCPHYS GCPhysNew, RTGCPHYS cb, bool fHasHCHandler, bool fRestoreAsRAM)
    3433 {
    3434     Log(("REMR3NotifyHandlerPhysicalModify: enmType=%d GCPhysOld=%RGp GCPhysNew=%RGp cb=%RGp fHasHCHandler=%RTbool fRestoreAsRAM=%RTbool\n",
    3435           enmType, GCPhysOld, GCPhysNew, cb, fHasHCHandler, fRestoreAsRAM));
     3436static void remR3NotifyHandlerPhysicalModify(PVM pVM, PGMPHYSHANDLERKIND enmKind, RTGCPHYS GCPhysOld, RTGCPHYS GCPhysNew, RTGCPHYS cb, bool fHasHCHandler, bool fRestoreAsRAM)
     3437{
     3438    Log(("REMR3NotifyHandlerPhysicalModify: enmKind=%d GCPhysOld=%RGp GCPhysNew=%RGp cb=%RGp fHasHCHandler=%RTbool fRestoreAsRAM=%RTbool\n",
     3439         enmKind, GCPhysOld, GCPhysNew, cb, fHasHCHandler, fRestoreAsRAM));
    34363440    VM_ASSERT_EMT(pVM);
    3437     AssertReleaseMsg(enmType != PGMPHYSHANDLERTYPE_MMIO, ("enmType=%d\n", enmType));
     3441    AssertReleaseMsg(enmKind != PGMPHYSHANDLERKIND_MMIO, ("enmKind=%d\n", enmKind));
    34383442
    34393443    if (fHasHCHandler)
     
    34713475 *
    34723476 * @param   pVM             VM Handle.
    3473  * @param   enmType         Handler type.
     3477 * @param   enmKind         Kind of access handler.
    34743478 * @param   GCPhysOld       Old handler range address.
    34753479 * @param   GCPhysNew       New handler range address.
     
    34783482 * @param   fRestoreAsRAM   Whether the to restore it as normal RAM or as unassigned memory.
    34793483 */
    3480 REMR3DECL(void) REMR3NotifyHandlerPhysicalModify(PVM pVM, PGMPHYSHANDLERTYPE enmType, RTGCPHYS GCPhysOld, RTGCPHYS GCPhysNew, RTGCPHYS cb, bool fHasHCHandler, bool fRestoreAsRAM)
     3484REMR3DECL(void) REMR3NotifyHandlerPhysicalModify(PVM pVM, PGMPHYSHANDLERKIND enmKind, RTGCPHYS GCPhysOld, RTGCPHYS GCPhysNew, RTGCPHYS cb, bool fHasHCHandler, bool fRestoreAsRAM)
    34813485{
    34823486    REMR3ReplayHandlerNotifications(pVM);
    34833487
    3484     remR3NotifyHandlerPhysicalModify(pVM, enmType, GCPhysOld, GCPhysNew, cb, fHasHCHandler, fRestoreAsRAM);
     3488    remR3NotifyHandlerPhysicalModify(pVM, enmKind, GCPhysOld, GCPhysNew, cb, fHasHCHandler, fRestoreAsRAM);
    34853489}
    34863490
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