Changeset 73035 in vbox
- Timestamp:
- Jul 10, 2018 2:04:41 PM (7 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/NEMAllNativeTemplate-win.cpp.h
r72926 r73035 4086 4086 # ifdef NEM_WIN_TEMPLATE_MODE_OWN_RUN_API 4087 4087 VID_MESSAGE_MAPPING_HEADER volatile *pMappingHeader = (VID_MESSAGE_MAPPING_HEADER volatile *)pVCpu->nem.s.pvMsgSlotMapping; 4088 uint32_t cMillies = 5000; /** @todo lower this later... */4089 4088 # endif 4090 4089 const bool fSingleStepping = DBGFIsStepping(pVCpu); … … 4167 4166 4168 4167 /* 4169 * Run a bit. 4168 * Poll timers and run for a bit. 4169 * 4170 * With the VID approach (ring-0 or ring-3) we can specify a timeout here, 4171 * so we take the time of the next timer event and uses that as a deadline. 4172 * The rounding heuristics are "tuned" so that rhel5 (1K timer) will boot fine. 4170 4173 */ 4174 /** @todo See if we cannot optimize this TMTimerPollGIP by only redoing 4175 * the whole polling job when timers have changed... */ 4176 uint64_t offDeltaIgnored; 4177 uint64_t const nsNextTimerEvt = TMTimerPollGIP(pVM, pVCpu, &offDeltaIgnored); NOREF(nsNextTimerEvt); 4171 4178 if ( !VM_FF_IS_PENDING(pVM, VM_FF_EMT_RENDEZVOUS | VM_FF_TM_VIRTUAL_SYNC) 4172 4179 && !VMCPU_FF_IS_PENDING(pVCpu, VMCPU_FF_HM_TO_R3_MASK)) … … 4198 4205 { 4199 4206 # ifdef NEM_WIN_TEMPLATE_MODE_OWN_RUN_API 4207 uint64_t const nsNow = RTTimeNanoTS(); 4208 int64_t const cNsNextTimerEvt = nsNow - nsNextTimerEvt; 4209 uint32_t cMsWait; 4210 if (cNsNextTimerEvt < 100000 /* ns */) 4211 cMsWait = 0; 4212 else if ((uint64_t)cNsNextTimerEvt < RT_NS_1SEC) 4213 { 4214 if ((uint32_t)cNsNextTimerEvt < 2*RT_NS_1MS) 4215 cMsWait = 1; 4216 else 4217 cMsWait = ((uint32_t)cNsNextTimerEvt - 100000 /*ns*/) / RT_NS_1MS; 4218 } 4219 else 4220 cMsWait = RT_MS_1SEC; 4200 4221 # ifdef IN_RING0 4201 4222 pVCpu->nem.s.uIoCtlBuf.MsgSlotHandleAndGetNext.iCpu = pGVCpu->idCpu; 4202 4223 pVCpu->nem.s.uIoCtlBuf.MsgSlotHandleAndGetNext.fFlags = pVCpu->nem.s.fHandleAndGetFlags; 4203 pVCpu->nem.s.uIoCtlBuf.MsgSlotHandleAndGetNext.cMillies = cM illies;4224 pVCpu->nem.s.uIoCtlBuf.MsgSlotHandleAndGetNext.cMillies = cMsWait; 4204 4225 NTSTATUS rcNt = nemR0NtPerformIoControl(pGVM, pGVM->nem.s.IoCtlMessageSlotHandleAndGetNext.uFunction, 4205 4226 &pVCpu->nem.s.uIoCtlBuf.MsgSlotHandleAndGetNext, … … 4210 4231 # else 4211 4232 BOOL fRet = VidMessageSlotHandleAndGetNext(pVM->nem.s.hPartitionDevice, pVCpu->idCpu, 4212 pVCpu->nem.s.fHandleAndGetFlags, cM illies);4233 pVCpu->nem.s.fHandleAndGetFlags, cMsWait); 4213 4234 VMCPU_CMPXCHG_STATE(pVCpu, VMCPUSTATE_STARTED_EXEC_NEM, VMCPUSTATE_STARTED_EXEC_NEM_WAIT); 4214 4235 if (fRet) -
trunk/src/VBox/VMM/VMMR0/NEMR0Native-win.cpp
r72924 r73035 42 42 #include <iprt/memobj.h> 43 43 #include <iprt/string.h> 44 #include <iprt/time.h> 44 45 45 46
Note:
See TracChangeset
for help on using the changeset viewer.