Changeset 20049 in vbox
- Timestamp:
- May 26, 2009 5:10:42 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/PC/DevPit-i8254.cpp
r16158 r20049 162 162 #ifdef IN_RING3 163 163 PDMBOTHCBDECL(int) pitIOPortSpeakerWrite(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t u32, unsigned cb); 164 static void pit_irq_timer_update(PITChannelState *s, uint64_t current_time );164 static void pit_irq_timer_update(PITChannelState *s, uint64_t current_time, uint64_t now); 165 165 #endif 166 166 __END_DECLS … … 287 287 if (s->gate < val) { 288 288 /* restart counting on rising edge */ 289 Log(("pit_set_gate: restarting mode %d\n", s->mode)); 289 290 s->count_load_time = TMTimerGet(pTimer); 290 pit_irq_timer_update(s, s->count_load_time );291 pit_irq_timer_update(s, s->count_load_time, s->count_load_time); 291 292 } 292 293 break; … … 295 296 if (s->gate < val) { 296 297 /* restart counting on rising edge */ 298 Log(("pit_set_gate: restarting mode %d\n", s->mode)); 297 299 s->count_load_time = s->u64ReloadTS = TMTimerGet(pTimer); 298 pit_irq_timer_update(s, s->count_load_time );300 pit_irq_timer_update(s, s->count_load_time, s->count_load_time); 299 301 } 300 302 /* XXX: disable/enable counting */ … … 311 313 s->count_load_time = s->u64ReloadTS = TMTimerGet(pTimer); 312 314 s->count = val; 313 pit_irq_timer_update(s, s->count_load_time );315 pit_irq_timer_update(s, s->count_load_time, s->count_load_time); 314 316 315 317 /* log the new rate (ch 0 only). */ … … 318 320 LogRel(("PIT: mode=%d count=%#x (%u) - %d.%02d Hz (ch=0)\n", 319 321 s->mode, s->count, s->count, PIT_FREQ / s->count, (PIT_FREQ * 100 / s->count) % 100)); 322 else 323 Log(("PIT: mode=%d count=%#x (%u) - %d.%02d Hz (ch=0)\n", 324 s->mode, s->count, s->count, PIT_FREQ / s->count, (PIT_FREQ * 100 / s->count) % 100)); 320 325 } 321 326 … … 377 382 } 378 383 /* convert to timer units */ 379 LogFlow(("PIT: next_time=% 14RI64 %20RI64 mode=%#x count=%#06x\n", next_time,384 LogFlow(("PIT: next_time=%'14RU64 %'20RU64 mode=%#x count=%#06x\n", next_time, 380 385 ASMMultU64ByU32DivByU32(next_time, TMTimerGetFreq(pTimer), PIT_FREQ), s->mode, s->count)); 381 386 next_time = s->count_load_time + ASMMultU64ByU32DivByU32(next_time, TMTimerGetFreq(pTimer), PIT_FREQ); … … 387 392 } 388 393 389 static void pit_irq_timer_update(PITChannelState *s, uint64_t current_time) 390 { 391 uint64_t now; 394 static void pit_irq_timer_update(PITChannelState *s, uint64_t current_time, uint64_t now) 395 { 392 396 int64_t expire_time; 393 397 int irq_level; … … 405 409 if (irq_level) 406 410 PDMDevHlpISASetIrq(pDevIns, s->irq, 0); 407 now = TMTimerGet(pTimer);408 Log3(("pit_irq_timer_update: %lldns late\n", now - s->u64NextTS));409 411 if (irq_level) 410 412 { … … 415 417 if (expire_time != -1) 416 418 { 419 Log3(("pit_irq_timer_update: next=%'RU64 now=%'RU64\n", expire_time, now)); 417 420 s->u64NextTS = expire_time; 418 421 TMTimerSet(s->CTX_SUFF(pTimer), s->u64NextTS); … … 812 815 PITChannelState *s = &pThis->channels[0]; 813 816 STAM_PROFILE_ADV_START(&s->CTX_SUFF(pPit)->StatPITHandler, a); 814 pit_irq_timer_update(s, s->next_transition_time); 817 Log(("pitTimer\n")); 818 pit_irq_timer_update(s, s->next_transition_time, TMTimerGet(pTimer)); 815 819 STAM_PROFILE_ADV_STOP(&s->CTX_SUFF(pPit)->StatPITHandler, a); 816 820 }
Note:
See TracChangeset
for help on using the changeset viewer.