WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] PV-on-HVM: Implement compatibilty version

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] PV-on-HVM: Implement compatibilty version of wait_for_completion_timeout
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 25 Oct 2006 15:20:33 +0000
Delivery-date: Wed, 25 Oct 2006 08:22:27 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxxxxx>
# Node ID 0886fc73e787076a7ee2247e71da68f48d311e0b
# Parent  ac6e4405ab6c363eae43fd7384b7dca975e9e28e
PV-on-HVM: Implement compatibilty version of wait_for_completion_timeout
for kernels before 2.6.11

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxxxxx>
---
 unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h |    4 +
 unmodified_drivers/linux-2.6/platform-pci/platform-compat.c       |   32 
++++++++++
 2 files changed, 36 insertions(+)

diff -r ac6e4405ab6c -r 0886fc73e787 
unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h
--- a/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h Wed Oct 
25 13:58:30 2006 +0100
+++ b/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h Wed Oct 
25 13:58:30 2006 +0100
@@ -33,4 +33,8 @@ unsigned long vmalloc_to_pfn(void *addr)
 unsigned long vmalloc_to_pfn(void *addr);
 #endif
 
+#if defined(__LINUX_COMPLETION_H) && LINUX_VERSION_CODE < 
KERNEL_VERSION(2,6,11)
+unsigned long wait_for_completion_timeout(struct completion *x, unsigned long 
timeout);
 #endif
+
+#endif
diff -r ac6e4405ab6c -r 0886fc73e787 
unmodified_drivers/linux-2.6/platform-pci/platform-compat.c
--- a/unmodified_drivers/linux-2.6/platform-pci/platform-compat.c       Wed Oct 
25 13:58:30 2006 +0100
+++ b/unmodified_drivers/linux-2.6/platform-pci/platform-compat.c       Wed Oct 
25 13:58:30 2006 +0100
@@ -3,6 +3,7 @@
 
 #include <linux/mm.h>
 #include <linux/module.h>
+#include <linux/sched.h>
 
 #include <xen/platform-compat.h>
 
@@ -41,3 +42,34 @@ unsigned long vmalloc_to_pfn(void * vmal
 }
 EXPORT_SYMBOL(vmalloc_to_pfn);
 #endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,11)
+unsigned long wait_for_completion_timeout(struct completion *x, unsigned long 
timeout)
+{
+        might_sleep();
+
+        spin_lock_irq(&x->wait.lock);
+        if (!x->done) {
+                DECLARE_WAITQUEUE(wait, current);
+
+                wait.flags |= WQ_FLAG_EXCLUSIVE;
+                __add_wait_queue_tail(&x->wait, &wait);
+                do {
+                        __set_current_state(TASK_UNINTERRUPTIBLE);
+                        spin_unlock_irq(&x->wait.lock);
+                        timeout = schedule_timeout(timeout);
+                        spin_lock_irq(&x->wait.lock);
+                        if (!timeout) {
+                                __remove_wait_queue(&x->wait, &wait);
+                                goto out;
+                        }
+                } while (!x->done);
+                __remove_wait_queue(&x->wait, &wait);
+        }
+        x->done--;
+out:
+        spin_unlock_irq(&x->wait.lock);
+        return timeout;
+}
+EXPORT_SYMBOL(wait_for_completion_timeout);
+#endif

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] PV-on-HVM: Implement compatibilty version of wait_for_completion_timeout, Xen patchbot-unstable <=