mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-01-06 08:04:55 +00:00
hv: add time modification of vrtc
VRTC for hv used to ignore writes to vRTC register. This patch add time modification to vRTC. Add base RTC time and TSC offset to get the current time. Convert current time to vRTC register values (`struct rtcdev`). Then modify a register, and calculate a new time. Get RTC offset by substrcting new time from current time. Thereafter, add RTC offset also when get current time. Then user can get the modified time. Tracked-On: #7440 Signed-off-by: Yuanyuan Zhao <yuanyuan.zhao@linux.intel.com> Reviewed-by: Junjie Mao <junjie.mao@intel.com>
This commit is contained in:
committed by
acrnsi-robot
parent
bca21648a3
commit
08e8161f51
@@ -34,6 +34,8 @@ struct acrn_vrtc {
|
||||
uint32_t addr; /* RTC register to read or write */
|
||||
|
||||
time_t base_rtctime; /* Base time calulated from physical rtc register. */
|
||||
time_t offset_rtctime; /* RTC offset against base time. */
|
||||
|
||||
uint64_t base_tsc; /* Base tsc value */
|
||||
|
||||
struct rtcdev rtcdev; /* RTC register */
|
||||
|
||||
Reference in New Issue
Block a user