aboutsummaryrefslogtreecommitdiff
path: root/hw/mc146818rtc.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2009-06-15 14:33:24 -0500
committerAnthony Liguori <aliguori@us.ibm.com>2009-06-15 14:35:14 -0500
commit72716184aae06fe24a49f11abca384e1b0de5d69 (patch)
tree895c6fec3d0efd7ecc598f9d1c7b336428d76258 /hw/mc146818rtc.c
parentba494313d386475e849b536fe0eb1cd05d8dfa68 (diff)
Incorporate changes from v2 of Gleb's RTC reset patch
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/mc146818rtc.c')
-rw-r--r--hw/mc146818rtc.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/hw/mc146818rtc.c b/hw/mc146818rtc.c
index 98a2273f80..8c446e186f 100644
--- a/hw/mc146818rtc.c
+++ b/hw/mc146818rtc.c
@@ -57,6 +57,11 @@
#define REG_B_SQWE 0x08
#define REG_B_DM 0x04
+#define REG_C_UF 0x10
+#define REG_C_IRQF 0x80
+#define REG_C_PF 0x40
+#define REG_C_AF 0x20
+
struct RTCState {
uint8_t cmos_data[128];
uint8_t cmos_index;
@@ -572,11 +577,10 @@ static void rtc_reset(void *opaque)
{
RTCState *s = opaque;
- /* clear PIE,AIE,SQWE on reset */
- s->cmos_data[RTC_REG_B] &= ~((1<<6) | (1<<5) | (1<<3));
+ s->cmos_data[RTC_REG_B] &= ~(REG_B_PIE | REG_B_AIE | REG_B_SQWE);
+ s->cmos_data[RTC_REG_C] &= ~(REG_C_UF | REG_C_IRQF | REG_C_PF | REG_C_AF);
- /* clear UF,IRQF,PF,AF on reset */
- s->cmos_data[RTC_REG_C] &= ~((1<<4) | (1<<7) | (1<<6) | (1<<5));
+ qemu_irq_lower(s->irq);
#ifdef TARGET_I386
if (rtc_td_hack)