s390x/tcg: drop tod_basetime
Never set to anything but 0. Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: David Hildenbrand <david@redhat.com> Message-Id: <20180627134410.4901-5-david@redhat.com> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
This commit is contained in:
parent
8046f374a6
commit
f777b20544
@ -289,7 +289,6 @@ static void s390_cpu_initfn(Object *obj)
|
|||||||
qemu_get_timedate(&tm, 0);
|
qemu_get_timedate(&tm, 0);
|
||||||
env->tod_offset = TOD_UNIX_EPOCH +
|
env->tod_offset = TOD_UNIX_EPOCH +
|
||||||
(time2tod(mktimegm(&tm)) * 1000000000ULL);
|
(time2tod(mktimegm(&tm)) * 1000000000ULL);
|
||||||
env->tod_basetime = 0;
|
|
||||||
env->tod_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, s390x_tod_timer, cpu);
|
env->tod_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, s390x_tod_timer, cpu);
|
||||||
env->cpu_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, s390x_cpu_timer, cpu);
|
env->cpu_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, s390x_cpu_timer, cpu);
|
||||||
s390_cpu_set_state(S390_CPU_STATE_STOPPED, cpu);
|
s390_cpu_set_state(S390_CPU_STATE_STOPPED, cpu);
|
||||||
|
@ -131,7 +131,6 @@ struct CPUS390XState {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
uint64_t tod_offset;
|
uint64_t tod_offset;
|
||||||
uint64_t tod_basetime;
|
|
||||||
QEMUTimer *tod_timer;
|
QEMUTimer *tod_timer;
|
||||||
|
|
||||||
QEMUTimer *cpu_timer;
|
QEMUTimer *cpu_timer;
|
||||||
|
@ -141,7 +141,7 @@ uint64_t HELPER(stck)(CPUS390XState *env)
|
|||||||
uint64_t time;
|
uint64_t time;
|
||||||
|
|
||||||
time = env->tod_offset +
|
time = env->tod_offset +
|
||||||
time2tod(qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) - env->tod_basetime);
|
time2tod(qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL));
|
||||||
|
|
||||||
return time;
|
return time;
|
||||||
}
|
}
|
||||||
@ -161,7 +161,7 @@ void HELPER(sckc)(CPUS390XState *env, uint64_t time)
|
|||||||
/* nanoseconds */
|
/* nanoseconds */
|
||||||
time = tod2time(time);
|
time = tod2time(time);
|
||||||
|
|
||||||
timer_mod(env->tod_timer, env->tod_basetime + time);
|
timer_mod(env->tod_timer, time);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set Tod Programmable Field */
|
/* Set Tod Programmable Field */
|
||||||
|
Loading…
Reference in New Issue
Block a user