Changeset 89735 in vbox
- Timestamp:
- Jun 16, 2021 8:13:58 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/PC/DevRTC.cpp
r88836 r89735 94 94 #define REG_B_UIE 0x10 95 95 96 #define REG_C_IRQF 0x80 97 #define REG_C_PF 0x40 98 #define REG_C_AF 0x20 99 #define REG_C_UF 0x10 100 96 101 #define CMOS_BANK_LOWER_LIMIT 0x0E 97 102 #define CMOS_BANK_UPPER_LIMIT 0x7F … … 171 176 /** Number of times the timer callback handler ran. */ 172 177 STAMCOUNTER StatRTCTimerCB; 178 /** Number of times the PIE bit was changed. */ 179 STAMCOUNTER StatRTCPieFlip; 180 /** Number of times an interrupt was cleared. */ 181 STAMCOUNTER StatRTCIrqClear; 182 /** How long the periodic interrupt remains active. */ 183 STAMPROFILEADV StatPIrqPending; 173 184 } RTCSTATE; 174 185 /** Pointer to the RTC device state. */ … … 381 392 case RTC_REG_C: 382 393 *pu32 = pThis->cmos_data[pThis->cmos_index[0]]; 394 if (*pu32) /* If any bits were set, reading will clear them. */ 395 { 396 STAM_REL_COUNTER_INC(&pThis->StatRTCIrqClear); 397 if (pThis->cmos_data[RTC_REG_C] & REG_C_PF) 398 STAM_REL_PROFILE_ADV_STOP(&pThis->StatPIrqPending, dummy); 399 } 383 400 rtc_raise_irq(pDevIns, pThis, 0); 384 401 pThis->cmos_data[RTC_REG_C] = 0x00; … … 481 498 rtc_set_time(pThis); 482 499 } 500 501 if (((uint8_t)u32 & REG_B_PIE) != (pThis->cmos_data[RTC_REG_B] & REG_B_PIE)) 502 STAM_REL_COUNTER_INC(&pThis->StatRTCPieFlip); 503 483 504 pThis->cmos_data[RTC_REG_B] = u32; 484 505 } … … 579 600 pThis->cmos_data[RTC_REG_A], pThis->cmos_data[RTC_REG_B], 580 601 pThis->cmos_data[RTC_REG_C], pThis->cmos_data[RTC_REG_D]); 602 603 if (pThis->cmos_data[RTC_REG_B] & REG_B_PIE) 604 { 605 if (pThis->CurHintPeriod) 606 pHlp->pfnPrintf(pHlp, "Periodic Interrupt Enabled: %d Hz\n", _32K / pThis->CurHintPeriod); 607 } 581 608 } 582 609 … … 599 626 rtc_timer_update(pDevIns, pThis, pThis->next_periodic_time); 600 627 STAM_REL_COUNTER_INC(&pThis->StatRTCTimerCB); 601 pThis->cmos_data[RTC_REG_C] |= 0xc0; 628 629 if (!(pThis->cmos_data[RTC_REG_C] & REG_C_PF)) 630 STAM_REL_PROFILE_ADV_START(&pThis->StatPIrqPending, dummy); 631 632 pThis->cmos_data[RTC_REG_C] |= REG_C_IRQF | REG_C_PF; 602 633 603 634 rtc_raise_irq(pDevIns, pThis, 1); … … 756 787 ) 757 788 { 758 pThis->cmos_data[RTC_REG_C] |= 0xa0;789 pThis->cmos_data[RTC_REG_C] |= REG_C_IRQF | REG_C_AF; 759 790 rtc_raise_irq(pDevIns, pThis, 1); 760 791 } … … 764 795 if (pThis->cmos_data[RTC_REG_B] & REG_B_UIE) 765 796 { 766 pThis->cmos_data[RTC_REG_C] |= 0x90;797 pThis->cmos_data[RTC_REG_C] |= REG_C_IRQF | REG_C_UF; 767 798 rtc_raise_irq(pDevIns, pThis, 1); 768 799 } … … 1222 1253 * Register statistics. 1223 1254 */ 1224 PDMDevHlpSTAMRegister(pDevIns, &pThis->StatRTCIrq, STAMTYPE_COUNTER, "Irq", STAMUNIT_OCCURENCES, "The number of times a RTC interrupt was triggered."); 1225 PDMDevHlpSTAMRegister(pDevIns, &pThis->StatRTCTimerCB, STAMTYPE_COUNTER, "TimerCB", STAMUNIT_OCCURENCES, "The number of times the RTC timer callback ran."); 1255 PDMDevHlpSTAMRegister(pDevIns, &pThis->StatRTCIrq, STAMTYPE_COUNTER, "Irq", STAMUNIT_OCCURENCES, "The number of times a RTC interrupt was triggered."); 1256 PDMDevHlpSTAMRegister(pDevIns, &pThis->StatRTCTimerCB, STAMTYPE_COUNTER, "TimerCB", STAMUNIT_OCCURENCES, "The number of times the RTC timer callback ran."); 1257 PDMDevHlpSTAMRegister(pDevIns, &pThis->StatRTCPieFlip, STAMTYPE_COUNTER, "PieFlip", STAMUNIT_OCCURENCES, "The number of times Periodic Interrupt Enable changed."); 1258 PDMDevHlpSTAMRegister(pDevIns, &pThis->StatRTCIrqClear, STAMTYPE_COUNTER, "IrqClear", STAMUNIT_OCCURENCES, "The number of times an active interrupt was cleared."); 1259 PDMDevHlpSTAMRegister(pDevIns, &pThis->StatPIrqPending, STAMTYPE_PROFILE, "PiActive", STAMUNIT_TICKS_PER_CALL, "How long periodic interrupt stays active (pending)."); 1226 1260 1227 1261 return VINF_SUCCESS;
Note:
See TracChangeset
for help on using the changeset viewer.