# HG changeset patch
# User awilliam@xxxxxxxxxxx
# Node ID e28beea6d2284f9123a3f54c7ca901bc01d90dd4
# Parent 3ac52066af814d8f2dee0c0467d641891753c96e
[IA64] Fix time services of EFI emulation
This patch serializes the execution of following efi.runtimes.
- GetTime
- SetTime
- GetWakeTime
- SetWakeTime
Linux/ia64 uses similar spinlocks in the EFI RTC driver.
Signed-off-by: Masaki Kanno <kanno.masaki@xxxxxxxxxxxxxx>
---
xen/arch/ia64/xen/fw_emul.c | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
diff -r 3ac52066af81 -r e28beea6d228 xen/arch/ia64/xen/fw_emul.c
--- a/xen/arch/ia64/xen/fw_emul.c Fri Nov 10 11:44:38 2006 -0700
+++ b/xen/arch/ia64/xen/fw_emul.c Fri Nov 10 12:03:19 2006 -0700
@@ -31,6 +31,8 @@
#include <asm/uaccess.h>
#include <xen/console.h>
#include <xen/hypercall.h>
+
+static DEFINE_SPINLOCK(efi_time_services_lock);
extern unsigned long running_on_sim;
@@ -445,7 +447,6 @@ efi_emulate_get_time(
struct page_info *tc_page = NULL;
efi_status_t status = 0;
- //printk("efi_get_time(%016lx,%016lx) called\n", tv_addr, tc_addr);
tv = efi_translate_domain_addr(tv_addr, fault, &tv_page);
if (*fault != IA64_NO_FAULT)
goto errout;
@@ -455,9 +456,9 @@ efi_emulate_get_time(
goto errout;
}
- //printk("efi_get_time(%016lx,%016lx) translated to xen virtual
address\n", tv, tc);
+ spin_lock(&efi_time_services_lock);
status = (*efi.get_time)((efi_time_t *) tv, (efi_time_cap_t *) tc);
- //printk("efi_get_time returns %lx\n", status);
+ spin_unlock(&efi_time_services_lock);
errout:
if (tc_page != NULL)
@@ -483,7 +484,9 @@ efi_emulate_set_time(
if (*fault != IA64_NO_FAULT)
goto errout;
+ spin_lock(&efi_time_services_lock);
status = (*efi.set_time)((efi_time_t *)tv);
+ spin_unlock(&efi_time_services_lock);
errout:
if (tv_page != NULL)
@@ -518,9 +521,11 @@ efi_emulate_get_wakeup_time(
if (*fault != IA64_NO_FAULT)
goto errout;
+ spin_lock(&efi_time_services_lock);
status = (*efi.get_wakeup_time)((efi_bool_t *)enabled,
(efi_bool_t *)pending,
(efi_time_t *)tv);
+ spin_unlock(&efi_time_services_lock);
errout:
if (e_page != NULL)
@@ -551,8 +556,10 @@ efi_emulate_set_wakeup_time(
goto errout;
}
+ spin_lock(&efi_time_services_lock);
status = (*efi.set_wakeup_time)((efi_bool_t)enabled,
(efi_time_t *)tv);
+ spin_unlock(&efi_time_services_lock);
errout:
if (tv_page != NULL)
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|