[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] [powerpc] Handle 2 forms of NULL guest handle



# HG changeset patch
# User Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
# Node ID a4ab169ee85042e9ced6ae13a459da13f4517d19
# Parent  fcef9a741e1dcd07a740218d393441a5985cafc5
[powerpc] Handle 2 forms of NULL guest handle

Signed-off-by: Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
---
 xen/arch/powerpc/usercopy.c            |    9 +++++++++
 xen/include/asm-powerpc/guest_access.h |    5 ++++-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff -r fcef9a741e1d -r a4ab169ee850 xen/arch/powerpc/usercopy.c
--- a/xen/arch/powerpc/usercopy.c       Thu Jul 13 11:25:36 2006 -0400
+++ b/xen/arch/powerpc/usercopy.c       Thu Jul 13 11:26:51 2006 -0400
@@ -231,3 +231,12 @@ void xencomm_add_offset(void *handle, un
         bytes -= chunk_skip;
     }
 }
+
+int xencomm_handle_is_null(void *ptr)
+{
+    struct xencomm_desc *desc;
+
+    desc = (struct xencomm_desc *)paddr_to_maddr((unsigned long)ptr);
+
+    return (desc->address[0] == XENCOMM_INVALID);
+}
diff -r fcef9a741e1d -r a4ab169ee850 xen/include/asm-powerpc/guest_access.h
--- a/xen/include/asm-powerpc/guest_access.h    Thu Jul 13 11:25:36 2006 -0400
+++ b/xen/include/asm-powerpc/guest_access.h    Thu Jul 13 11:26:51 2006 -0400
@@ -26,9 +26,12 @@ extern unsigned long xencomm_copy_from_g
 extern unsigned long xencomm_copy_from_guest(void *to, const void *from,
         unsigned int len, unsigned int skip); 
 extern void xencomm_add_offset(void *handle, unsigned int bytes);
+extern int xencomm_handle_is_null(void *ptr);
+
 
 /* Is the guest handle a NULL reference? */
-#define guest_handle_is_null(hnd)        ((hnd).p == NULL)
+#define guest_handle_is_null(hnd) \
+    ((hnd).p == NULL || xencomm_handle_is_null((hnd).p))
 
 /* Offset the given guest handle into the array it refers to. */
 #define guest_handle_add_offset(hnd, nr) ({         \

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.