summaryrefslogtreecommitdiff
path: root/src/VBox/Devices/PC/DevRTC.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/VBox/Devices/PC/DevRTC.cpp')
-rw-r--r--src/VBox/Devices/PC/DevRTC.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/VBox/Devices/PC/DevRTC.cpp b/src/VBox/Devices/PC/DevRTC.cpp
index 6a5a9e40d..d10286704 100644
--- a/src/VBox/Devices/PC/DevRTC.cpp
+++ b/src/VBox/Devices/PC/DevRTC.cpp
@@ -1,4 +1,4 @@
-/* $Id: DevRTC.cpp 37526 2011-06-17 10:17:38Z vboxsync $ */
+/* $Id: DevRTC.cpp 38195 2011-07-27 11:21:13Z vboxsync $ */
/** @file
* Motorola MC146818 RTC/CMOS Device with PIIX4 extensions.
*/
@@ -785,15 +785,20 @@ static DECLCALLBACK(int) rtcLoadExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSM, uint32
int period_code = pThis->cmos_data[RTC_REG_A] & 0x0f;
if ( period_code != 0
- && (pThis->cmos_data[RTC_REG_B] & REG_B_PIE)) {
+ && (pThis->cmos_data[RTC_REG_B] & REG_B_PIE))
+ {
if (period_code <= 2)
period_code += 7;
int period = 1 << (period_code - 1);
LogRel(("RTC: period=%#x (%d) %u Hz (restore)\n", period, period, _32K / period));
+ PDMCritSectEnter(pThis->pDevInsR3->pCritSectRoR3, VINF_SUCCESS);
TMTimerSetFrequencyHint(pThis->CTX_SUFF(pPeriodicTimer), _32K / period);
+ PDMCritSectLeave(pThis->pDevInsR3->pCritSectRoR3);
pThis->CurLogPeriod = period;
pThis->CurHintPeriod = period;
- } else {
+ }
+ else
+ {
LogRel(("RTC: stopped the periodic timer (restore)\n"));
pThis->CurLogPeriod = 0;
pThis->CurHintPeriod = 0;