Changeset 35178 in vbox
- Timestamp:
- Dec 16, 2010 1:06:34 PM (14 years ago)
- File:
-
- 1 edited
-
trunk/src/VBox/Devices/PC/DevPit-i8254.cpp (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/PC/DevPit-i8254.cpp
r34900 r35178 88 88 #endif 89 89 90 /** The effective counter mode - if bit 1 is set, bit 2 is ignored. */ 91 #define EFFECTIVE_MODE(x) ((x) & ~(((x) & 2) << 1)) 90 92 91 93 /******************************************************************************* … … 188 190 PTMTIMER pTimer = s->CTX_SUFF(pPit)->channels[0].CTX_SUFF(pTimer); 189 191 190 if ( s->mode== 2)192 if (EFFECTIVE_MODE(s->mode) == 2) 191 193 { 192 194 if (s->u64NextTS == UINT64_MAX) … … 205 207 } 206 208 d = ASMMultU64ByU32DivByU32(TMTimerGet(pTimer) - s->count_load_time, PIT_FREQ, TMTimerGetFreq(pTimer)); 207 switch( s->mode) {209 switch(EFFECTIVE_MODE(s->mode)) { 208 210 case 0: 209 211 case 1: … … 232 234 233 235 d = ASMMultU64ByU32DivByU32(current_time - s->count_load_time, PIT_FREQ, TMTimerGetFreq(pTimer)); 234 switch( s->mode) {236 switch(EFFECTIVE_MODE(s->mode)) { 235 237 default: 236 238 case 0: … … 293 295 Assert((val & 1) == val); 294 296 295 switch( s->mode) {297 switch(EFFECTIVE_MODE(s->mode)) { 296 298 default: 297 299 case 0: … … 357 359 358 360 d = ASMMultU64ByU32DivByU32(current_time - s->count_load_time, PIT_FREQ, TMTimerGetFreq(pTimer)); 359 switch( s->mode) {361 switch(EFFECTIVE_MODE(s->mode)) { 360 362 default: 361 363 case 0: … … 436 438 pDevIns = s->CTX_SUFF(pPit)->pDevIns; 437 439 438 if ( s->mode== 2)440 if (EFFECTIVE_MODE(s->mode) == 2) 439 441 { 440 442 /* We just flip-flop the irq level to save that extra timer call, which isn't generally required (we haven't served it for years). */
Note:
See TracChangeset
for help on using the changeset viewer.

