- Timestamp:
- Feb 28, 2010 5:26:07 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/PC/DevHPET.cpp
r26766 r26888 408 408 { 409 409 case HPET_TN_CFG: 410 Log((" HPET_TN_CFG on %d\n", pTimer->u8TimerNumber));410 Log(("read HPET_TN_CFG on %d\n", pTimer->u8TimerNumber)); 411 411 *pValue = (uint32_t)(pTimer->u64Config); 412 412 break; 413 413 case HPET_TN_CFG + 4: 414 Log((" HPET_TN_CFG+4 on %d\n", pTimer->u8TimerNumber));414 Log(("read HPET_TN_CFG+4 on %d\n", pTimer->u8TimerNumber)); 415 415 *pValue = (uint32_t)(pTimer->u64Config >> 32); 416 416 break; 417 417 case HPET_TN_CMP: 418 Log((" HPET_TN_CMP on %d\n", pTimer->u8TimerNumber));418 Log(("read HPET_TN_CMP on %d, cmp=%llx\n", pTimer->u8TimerNumber, pTimer->u64Cmp)); 419 419 *pValue = (uint32_t)(pTimer->u64Cmp); 420 420 break; 421 421 case HPET_TN_CMP + 4: 422 Log((" HPET_TN_CMP+4 on %d\n", pTimer->u8TimerNumber));422 Log(("read HPET_TN_CMP+4 on %d, cmp=%llx\n", pTimer->u8TimerNumber, pTimer->u64Cmp)); 423 423 *pValue = (uint32_t)(pTimer->u64Cmp >> 32); 424 424 break; 425 425 case HPET_TN_ROUTE: 426 Log((" HPET_TN_ROUTE on %d\n", pTimer->u8TimerNumber));426 Log(("read HPET_TN_ROUTE on %d\n", pTimer->u8TimerNumber)); 427 427 *pValue = (uint32_t)(pTimer->u64Fsb >> 32); 428 428 break; 429 429 default: 430 LogRel(("invalid HPET register %d on %d\n", iTimerReg, pTimer->u8TimerNumber));430 LogRel(("invalid HPET register read %d on %d\n", iTimerReg, pTimer->u8TimerNumber)); 431 431 break; 432 432 } … … 507 507 case HPET_TN_CFG: 508 508 { 509 Log(("write HPET_TN_CFG \n"));509 Log(("write HPET_TN_CFG: %d\n", iTimerNo)); 510 510 /** We only care about lower 32-bits so far */ 511 511 pTimer->u64Config = … … 530 530 case HPET_TN_CMP: /* lower bits of comparator register */ 531 531 { 532 Log(("write HPET_TN_CMP \n"));532 Log(("write HPET_TN_CMP on %d: %x\n", iTimerNo, iNewValue)); 533 533 if (pTimer->u64Config & HPET_TN_32BIT) 534 534 iNewValue = (uint32_t)iNewValue; 535 535 536 if (!(pTimer->u64Config & HPET_TN_PERIODIC) || 537 (pTimer->u64Config & HPET_TN_SETVAL)) 538 { 539 pTimer->u64Cmp = (pTimer->u64Cmp & 0xffffffff00000000ULL) 540 | iNewValue; 541 } 542 else 543 { 544 iNewValue &= (pTimer->u64Config & HPET_TN_32BIT ? ~0u : ~0ull) >> 1; 536 if (pTimer->u64Config & HPET_TN_SETVAL) 537 { 538 /* HPET_TN_SETVAL allows to adjust comparator w/o updating period, and it's cleared on access */ 539 if (pTimer->u64Config & HPET_TN_32BIT) 540 pTimer->u64Config &= ~HPET_TN_SETVAL; 541 } else if (pTimer->u64Config & HPET_TN_PERIODIC) 542 { 543 iNewValue &= (pTimer->u64Config & HPET_TN_32BIT ? ~0U : ~0ULL) >> 1; 545 544 pTimer->u64Period = (pTimer->u64Period & 0xffffffff00000000ULL) 546 545 | iNewValue; 547 546 } 548 pTimer->u64Config &= ~HPET_TN_SETVAL; 547 548 pTimer->u64Cmp = (pTimer->u64Cmp & 0xffffffff00000000ULL) 549 | iNewValue; 550 551 Log2(("after HPET_TN_CMP cmp=%llx per=%llx\n", pTimer->u64Cmp, pTimer->u64Period)); 549 552 550 553 if (pThis->u64Config & HPET_CFG_ENABLE) … … 552 555 break; 553 556 } 554 case HPET_TN_CMP + 4: /* upper bits of comparator */ 555 { 556 Log(("write HPET_TN_CMP + 4\n")); 557 if (!(pTimer->u64Config & HPET_TN_PERIODIC) || 558 (pTimer->u64Config & HPET_TN_SETVAL)) 559 { 560 pTimer->u64Cmp = (pTimer->u64Cmp & 0xffffffffULL) 561 | ((uint64_t)iNewValue << 32); 557 case HPET_TN_CMP + 4: /* upper bits of comparator register */ 558 { 559 Log(("write HPET_TN_CMP + 4 on %d: %x\n", iTimerNo, iNewValue)); 560 if (pTimer->u64Config & HPET_TN_32BIT) 561 break; 562 563 if (pTimer->u64Config & HPET_TN_SETVAL) 564 { 565 /* HPET_TN_SETVAL allows to adjust comparator w/o updating period, and it's cleared on access */ 566 pTimer->u64Config &= ~HPET_TN_SETVAL; 567 } else if (pTimer->u64Config & HPET_TN_PERIODIC) 568 { 569 pTimer->u64Period = (pTimer->u64Period & 0xffffffffULL) 570 | ((uint64_t)iNewValue << 32); 562 571 } 563 else 564 { 565 iNewValue &= (pTimer->u64Config & HPET_TN_32BIT ? ~0u : ~0ull) >> 1; 566 pTimer->u64Period = (pTimer->u64Period & 0xffffffffULL) 567 | ((uint64_t)iNewValue << 32); 568 } 569 570 pTimer->u64Config &= ~HPET_TN_SETVAL; 572 573 pTimer->u64Cmp = (pTimer->u64Cmp & 0xffffffffULL) 574 | ((uint64_t)iNewValue << 32); 575 576 Log2(("after HPET_TN_CMP+4 cmp=%llx per=%llx\n", pTimer->u64Cmp, pTimer->u64Period)); 571 577 572 578 if (pThis->u64Config & HPET_CFG_ENABLE) … … 726 732 case 1: 727 733 case 2: 728 /** @todo: error? */729 734 Log(("Narrow read: %d\n", cb)); 735 rc = VERR_INTERNAL_ERROR; 730 736 break; 731 737 case 4: … … 805 811 case 1: 806 812 case 2: 807 /** @todo: error? */808 813 Log(("Narrow write: %d\n", cb)); 814 rc = VERR_INTERNAL_ERROR; 809 815 break; 810 816 case 4:
Note:
See TracChangeset
for help on using the changeset viewer.