VirtualBox

Ignore:
Timestamp:
Apr 13, 2013 4:13:22 PM (12 years ago)
Author:
vboxsync
Message:

#ifdef the raw-mode force flags to find more code to #ifdef out.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/TRPM.cpp

    r45528 r45533  
    424424
    425425
    426 /** Enable or disable tracking of Guest's IDT. */
     426#ifdef VBOX_WITH_RAW_MODE
     427/ ** Enable or disable tracking of Guest's IDT. */
    427428#define TRPM_TRACK_GUEST_IDT_CHANGES
    428 
    429429/** Enable or disable tracking of Shadow IDT. */
    430 #define TRPM_TRACK_SHADOW_IDT_CHANGES
     430# define TRPM_TRACK_SHADOW_IDT_CHANGES
     431#endif
    431432
    432433/** TRPM saved state version. */
     
    440441static DECLCALLBACK(int) trpmR3Save(PVM pVM, PSSMHANDLE pSSM);
    441442static DECLCALLBACK(int) trpmR3Load(PVM pVM, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass);
     443#ifdef TRPM_TRACK_GUEST_IDT_CHANGES
    442444static DECLCALLBACK(int) trpmR3GuestIDTWriteHandler(PVM pVM, RTGCPTR GCPtr, void *pvPtr, void *pvBuf, size_t cbBuf, PGMACCESSTYPE enmAccessType, void *pvUser);
     445#endif
    443446
    444447
     
    571574    STAM_REG(pVM, &pVM->trpm.s.StatTrap0dRdTsc,             STAMTYPE_COUNTER, "/TRPM/RC/Traps/0d/RdTsc",        STAMUNIT_OCCURENCES, "Number of RDTSC #GPs.");
    572575
     576#ifdef VBOX_WITH_RAW_MODE
    573577    /*
    574578     * Default action when entering raw mode for the first time
     
    576580    PVMCPU pVCpu = &pVM->aCpus[0];  /* raw mode implies on VCPU */
    577581    VMCPU_FF_SET(pVCpu, VMCPU_FF_TRPM_SYNC_IDT);
     582#endif
    578583    return 0;
    579584}
     
    773778    TRPMR3Relocate(pVM, 0);
    774779
     780#ifdef VBOX_WITH_RAW_MODE
    775781    /*
    776782     * Default action when entering raw mode for the first time
     
    778784    PVMCPU pVCpu = &pVM->aCpus[0];  /* raw mode implies on VCPU */
    779785    VMCPU_FF_SET(pVCpu, VMCPU_FF_TRPM_SYNC_IDT);
     786#endif
    780787}
    781788
     
    847854    SSMR3PutBool(pSSM,      pTrpm->fDisableMonitoring);
    848855    PVMCPU pVCpu = &pVM->aCpus[0];  /* raw mode implies 1 VCPU */
    849     SSMR3PutUInt(pSSM,      VMCPU_FF_ISSET(pVCpu, VMCPU_FF_TRPM_SYNC_IDT));
     856    SSMR3PutUInt(pSSM,      VM_WHEN_RAW_MODE(VMCPU_FF_ISSET(pVCpu, VMCPU_FF_TRPM_SYNC_IDT), 0));
    850857    SSMR3PutMem(pSSM,       &pTrpm->au32IdtPatched[0], sizeof(pTrpm->au32IdtPatched));
    851858    SSMR3PutU32(pSSM, ~0);              /* separator. */
     
    947954        return VERR_SSM_DATA_UNIT_FORMAT_CHANGED;
    948955    }
     956#ifdef VBOX_WITH_RAW_MODE
    949957    if (fSyncIDT)
    950958    {
     
    953961    }
    954962    /* else: cleared by reset call above. */
     963#endif
    955964
    956965    SSMR3GetMem(pSSM, &pTrpm->au32IdtPatched[0], sizeof(pTrpm->au32IdtPatched));
     
    10001009}
    10011010
     1011#ifdef VBOX_WITH_RAW_MODE
    10021012
    10031013/**
     
    10211031    }
    10221032
    1023 #ifdef VBOX_WITH_RAW_MODE
    10241033    if (fRawRing0 && CSAMIsEnabled(pVM))
    10251034    {
     
    10331042        CSAMR3CheckGates(pVM, 0, 256);
    10341043    }
    1035 #endif /* VBOX_WITH_RAW_MODE */
    10361044
    10371045    /*
     
    10461054    }
    10471055
    1048 #ifdef TRPM_TRACK_GUEST_IDT_CHANGES
     1056# ifdef TRPM_TRACK_GUEST_IDT_CHANGES
    10491057    /*
    10501058     * Check if Guest's IDTR has changed.
     
    10681076                                             0, trpmR3GuestIDTWriteHandler, "trpmRCGuestIDTWriteHandler", 0, "Guest IDT write access handler");
    10691077
    1070 # ifdef VBOX_WITH_RAW_MODE
    10711078            if (rc == VERR_PGM_HANDLER_VIRTUAL_CONFLICT)
    10721079            {
     
    10791086                                                 0, trpmR3GuestIDTWriteHandler, "trpmRCGuestIDTWriteHandler", 0, "Guest IDT write access handler");
    10801087            }
    1081 # endif /* VBOX_WITH_RAW_MODE */
    10821088
    10831089            AssertRCReturn(rc, rc);
     
    10871093        pVM->trpm.s.GuestIdtr = IDTR;
    10881094    }
    1089 #endif
     1095# endif
    10901096
    10911097    /*
     
    11251131     * Deregister any virtual handlers.
    11261132     */
    1127 #ifdef TRPM_TRACK_GUEST_IDT_CHANGES
     1133# ifdef TRPM_TRACK_GUEST_IDT_CHANGES
    11281134    if (pVM->trpm.s.GuestIdtr.pIdt != RTRCPTR_MAX)
    11291135    {
     
    11361142    }
    11371143    pVM->trpm.s.GuestIdtr.cbIdt = 0;
    1138 #endif
    1139 
    1140 #ifdef TRPM_TRACK_SHADOW_IDT_CHANGES
     1144# endif
     1145
     1146# ifdef TRPM_TRACK_SHADOW_IDT_CHANGES
    11411147    if (pVM->trpm.s.pvMonShwIdtRC != RTRCPTR_MAX)
    11421148    {
     
    11451151        pVM->trpm.s.pvMonShwIdtRC = RTRCPTR_MAX;
    11461152    }
    1147 #endif
     1153# endif
    11481154
    11491155    PVMCPU pVCpu = &pVM->aCpus[0];  /* raw mode implies on VCPU */
     
    11811187}
    11821188
    1183 #ifdef VBOX_WITH_RAW_MODE
    11841189
    11851190/**
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