summary refs log tree commit diff stats
path: root/hw/exynos4210_rtc.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2012-07-23 13:15:34 -0500
committerAnthony Liguori <aliguori@us.ibm.com>2012-07-23 13:15:34 -0500
commit400006c27622d54ef588e1a9bd5a005d5fc9be5b (patch)
tree7fd03d3b57a7b9aea5e52d01022555d846187e78 /hw/exynos4210_rtc.c
parent903f650b0c77827f8d92b35f61419401d648df1e (diff)
parentffbbe7d02fd02a6b563df443e4406de076ac7d93 (diff)
downloadfocaccia-qemu-400006c27622d54ef588e1a9bd5a005d5fc9be5b.tar.gz
focaccia-qemu-400006c27622d54ef588e1a9bd5a005d5fc9be5b.zip
Merge remote-tracking branch 'pmaydell/arm-devs.for-upstream' into staging
* pmaydell/arm-devs.for-upstream:
  exynos4210: add Exynos4210 i2c implementation
  hw/exynos4210_rtc.c: remove unnecessary code
  hw/exynos4210_rtc.c: Fix calculating for value of year
  hw/vexpress.c: Allow >4GB of RAM for Cortex-A15 daughterboard
  hw/arm_boot.c: Support DTBs which use 64 bit addresses
  device_tree: Add support for reading device tree properties
  hw/arm_boot.c: Check for RAM sizes exceeding ATAGS capacity
  hw/arm_boot.c: Consistently use ram_size from arm_boot_info struct
  hw/arm_boot.c: Make ram_size a uint64_t
  hw/pl011.c: Avoid crash on read when no chr backend present
Diffstat (limited to 'hw/exynos4210_rtc.c')
-rw-r--r--hw/exynos4210_rtc.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/hw/exynos4210_rtc.c b/hw/exynos4210_rtc.c
index f78102049b..42a4ddc327 100644
--- a/hw/exynos4210_rtc.c
+++ b/hw/exynos4210_rtc.c
@@ -142,7 +142,7 @@ static const VMStateDescription vmstate_exynos4210_rtc_state = {
 };
 
 #define BCD3DIGITS(x) \
-    ((uint32_t)to_bcd((uint8_t)x) + \
+    ((uint32_t)to_bcd((uint8_t)(x % 100)) + \
     ((uint32_t)to_bcd((uint8_t)((x % 1000) / 100)) << 8))
 
 static void check_alarm_raise(Exynos4210RTCState *s)
@@ -510,10 +510,7 @@ static void exynos4210_rtc_reset(DeviceState *d)
 {
     Exynos4210RTCState *s = (Exynos4210RTCState *)d;
 
-    struct tm tm;
-
-    qemu_get_timedate(&tm, 0);
-    s->current_tm = tm;
+    qemu_get_timedate(&s->current_tm, 0);
 
     DPRINTF("Get time from host: %d-%d-%d %2d:%02d:%02d\n",
             s->current_tm.tm_year, s->current_tm.tm_mon, s->current_tm.tm_mday,