summaryrefslogtreecommitdiff
path: root/arch/x86/xen/time.c
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2011-11-23 22:46:10 (GMT)
committerTony Lindgren <tony@atomide.com>2011-11-23 22:46:10 (GMT)
commit52f3a41e0aca5625fbd118ed57a4debb25817e99 (patch)
tree86730c862fc97eef5f1eb1a81bf74bf2a8a36754 /arch/x86/xen/time.c
parente9b7086b80c4d9e354f4edc9e280ae85a60df408 (diff)
parent8770b07c2dff3cec2c751b289ee690137c88ea54 (diff)
downloadlinux-fsl-qoriq-52f3a41e0aca5625fbd118ed57a4debb25817e99.tar.xz
Merge branch 'fixes-v3.2-rc2' into fixes
Diffstat (limited to 'arch/x86/xen/time.c')
-rw-r--r--arch/x86/xen/time.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/arch/x86/xen/time.c b/arch/x86/xen/time.c
index 163b467..0296a95 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 = {