summaryrefslogtreecommitdiff
path: root/hw/m48t59.c
diff options
context:
space:
mode:
authorArtyom Tarasenko <atar4qemu@gmail.com>2012-04-23 16:48:31 +0200
committerBlue Swirl <blauwirbel@gmail.com>2012-04-23 17:01:04 +0000
commit02f5da11d694df75af454205d8d81ac73dea50f0 (patch)
tree979f2ac549f48a2c97ea7c58c3e7e072a11dbcba /hw/m48t59.c
parent3c30dd5a68e9fee6af67cfd0d14ed7520820f36a (diff)
fix BCD mask for date (Solaris 2.5 guest hang fix)
Fix BCD mask for date. The most visible effect of this patch is Solaris 2.5.1 doesn't hang at boot if the day of month is >21. Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'hw/m48t59.c')
-rw-r--r--hw/m48t59.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/hw/m48t59.c b/hw/m48t59.c
index 60bbb0094..0c50f450a 100644
--- a/hw/m48t59.c
+++ b/hw/m48t59.c
@@ -239,7 +239,7 @@ void m48t59_write (void *opaque, uint32_t addr, uint32_t val)
break;
case 0x1FF5:
/* alarm date */
- tmp = from_bcd(val & 0x1F);
+ tmp = from_bcd(val & 0x3F);
if (tmp != 0) {
NVRAM->alarm.tm_mday = tmp;
NVRAM->buffer[0x1FF5] = val;
@@ -310,8 +310,8 @@ void m48t59_write (void *opaque, uint32_t addr, uint32_t val)
break;
case 0x1FFD:
case 0x07FD:
- /* date */
- tmp = from_bcd(val & 0x1F);
+ /* date (BCD) */
+ tmp = from_bcd(val & 0x3F);
if (tmp != 0) {
get_time(NVRAM, &tm);
tm.tm_mday = tmp;