Changeset 35853 in vbox for trunk/src/VBox/Devices/PC
- Timestamp:
- Feb 4, 2011 2:38:31 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/PC/DevPit-i8254.cpp
r35848 r35853 254 254 case 4: 255 255 case 5: 256 out = (d == s->count);256 out = (d != s->count); 257 257 break; 258 258 } … … 395 395 next_time = base + s->count; 396 396 break; 397 /* Modes 4 and 5 generate a short pulse at the end of the time delay. This 398 * is similar to mode 2, except modes 4/5 aren't periodic. We use the same 399 * optimization - only use one timer callback and pulse the IRQ. 400 * Note: Tickless Linux kernels use PIT mode 4 with 'nolapic'. 401 */ 397 402 case 4: 398 403 case 5: 404 #ifdef VBOX 405 if (d <= s->count) 406 next_time = s->count; 407 #else 399 408 if (d < s->count) 400 409 next_time = s->count; 401 410 else if (d == s->count) 402 411 next_time = s->count + 1; 412 #endif 403 413 else 404 414 return -1; … … 438 448 pDevIns = s->CTX_SUFF(pPit)->pDevIns; 439 449 440 if (EFFECTIVE_MODE(s->mode) == 2 && in_timer)450 switch (EFFECTIVE_MODE(s->mode)) 441 451 { 442 /* We just flip-flop the irq level to save that extra timer call, which 443 * isn't generally required (we haven't served it for years). However, 444 * the pulse is only generated when running on the timer callback (and 445 * thus on the trailing edge of the output signal pulse). 446 */ 447 PDMDevHlpISASetIrq(pDevIns, s->irq, PDM_IRQ_LEVEL_FLIP_FLOP); 448 449 } else 450 PDMDevHlpISASetIrq(pDevIns, s->irq, irq_level); 452 case 2: 453 case 4: 454 case 5: 455 /* We just flip-flop the IRQ line to save an extra timer call, 456 * which isn't generally required. However, the pulse is only 457 * generated when running on the timer callback (and thus on 458 * the trailing edge of the output signal pulse). 459 */ 460 if (in_timer) 461 { 462 PDMDevHlpISASetIrq(pDevIns, s->irq, PDM_IRQ_LEVEL_FLIP_FLOP); 463 break; 464 } 465 /* Else fall through! */ 466 default: 467 PDMDevHlpISASetIrq(pDevIns, s->irq, irq_level); 468 break; 469 } 451 470 } 452 471
Note:
See TracChangeset
for help on using the changeset viewer.