X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=blobdiff_plain;f=arch%2Fx86%2Fxen%2Ftime.c;h=0296a95225017912cec06b9794683e62b20a5382;hp=163b4679556e300615095cc995fa0eac6ea7cf45;hb=403299a8515c56db58454c57712f4dc96d6c1fde;hpb=7e0a6fd5a4723c79cc46c9541e343092302e0e5b diff --git a/arch/x86/xen/time.c b/arch/x86/xen/time.c index 163b4679556e..0296a9522501 100644 --- a/arch/x86/xen/time.c +++ b/arch/x86/xen/time.c @@ -201,8 +201,22 @@ static unsigned long xen_get_wallclock(void) static int xen_set_wallclock(unsigned long now) { + struct xen_platform_op op; + int rc; + /* do nothing for domU */ - return -1; + if (!xen_initial_domain()) + return -1; + + op.cmd = XENPF_settime; + op.u.settime.secs = now; + op.u.settime.nsecs = 0; + op.u.settime.system_time = xen_clocksource_read(); + + rc = HYPERVISOR_dom0_op(&op); + WARN(rc != 0, "XENPF_settime failed: now=%ld\n", now); + + return rc; } static struct clocksource xen_clocksource __read_mostly = {