]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
goldfish_rtc: Fix handling a local time RTC
authorJessica Clarke <jrtc27@FreeBSD.org>
Sun, 14 Aug 2022 18:50:22 +0000 (19:50 +0100)
committerJessica Clarke <jrtc27@FreeBSD.org>
Sun, 14 Aug 2022 18:50:22 +0000 (19:50 +0100)
commit762dcf10641251c55dda2e6950fef8bb698027ad
tree132387ea0c25f933c14f2ecbde73183d318ab3b7
parent9f678cfcb42d1d0ce3898b0e38bb147a3e14834a
goldfish_rtc: Fix handling a local time RTC

The default QEMU config is to have the RTC in UTC. However, if run with
-rtc base=localtime (and wall_cmos_clock is set to match), the driver
fails to account for adjkerntz due to the use of CLOCKF_SETTIME_NO_ADJ.
Copy the same code used by other CLOCKF_SETTIME_NO_ADJ-using drivers
to fix this, namely manually subtracting utc_offset().

Fixes: d63a631e7244 ("Add Goldfish RTC device driver for RISC-V")
MFC after: 1 week
sys/dev/goldfish/goldfish_rtc.c