diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-11-06 23:15:05 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-11-06 23:15:05 -0500 |
commit | 403299a8515c56db58454c57712f4dc96d6c1fde (patch) | |
tree | 1dbcb33c606b03adc7d7fe128ecb3f0c3404ffef /arch/x86/xen | |
parent | daedd8708fe7707ed651bb1c83162f25c48a947c (diff) | |
parent | fdb9eb9f155bfc0f8dc2fc88f90448b30c78ad97 (diff) |
Merge branch 'upstream/xen-settime' of git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen
* 'upstream/xen-settime' of git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen:
xen/dom0: set wallclock time in Xen
xen: add dom0_op hypercall
xen/acpi: Domain0 acpi parser related platform hypercall
Diffstat (limited to 'arch/x86/xen')
-rw-r--r-- | arch/x86/xen/time.c | 16 |
1 files changed, 15 insertions, 1 deletions
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) | |||
201 | 201 | ||
202 | static int xen_set_wallclock(unsigned long now) | 202 | static int xen_set_wallclock(unsigned long now) |
203 | { | 203 | { |
204 | struct xen_platform_op op; | ||
205 | int rc; | ||
206 | |||
204 | /* do nothing for domU */ | 207 | /* do nothing for domU */ |
205 | return -1; | 208 | if (!xen_initial_domain()) |
209 | return -1; | ||
210 | |||
211 | op.cmd = XENPF_settime; | ||
212 | op.u.settime.secs = now; | ||
213 | op.u.settime.nsecs = 0; | ||
214 | op.u.settime.system_time = xen_clocksource_read(); | ||
215 | |||
216 | rc = HYPERVISOR_dom0_op(&op); | ||
217 | WARN(rc != 0, "XENPF_settime failed: now=%ld\n", now); | ||
218 | |||
219 | return rc; | ||
206 | } | 220 | } |
207 | 221 | ||
208 | static struct clocksource xen_clocksource __read_mostly = { | 222 | static struct clocksource xen_clocksource __read_mostly = { |