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-ppc-devel

[XenPPC] [xenppc-unstable] [ppc] Handle 2 forms of NULL gues handle

To: xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
Subject: [XenPPC] [xenppc-unstable] [ppc] Handle 2 forms of NULL gues handle
From: Xen patchbot-xenppc-unstable <patchbot-xenppc-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 26 Jul 2006 18:40:43 +0000
Delivery-date: Wed, 26 Jul 2006 11:45:31 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-ppc-devel-request@lists.xensource.com?subject=help>
List-id: Xen PPC development <xen-ppc-devel.lists.xensource.com>
List-post: <mailto:xen-ppc-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-ppc-devel-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
# Node ID 50ef9c9c717c20eb5e7003459f9dd41dd783b0c2
# Parent  518e1322992910df7f0fb29f51e54a4f4ef312ac
[ppc] Handle 2 forms of NULL gues 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 518e13229929 -r 50ef9c9c717c 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 518e13229929 -r 50ef9c9c717c 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-ppc-devel mailing list
Xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ppc-devel