[powerpc] Handle 2 forms of NULL guest handle

Signed-off-by: Jimi Xenidis <jimix@watson.ibm.com>
This commit is contained in:
Jimi Xenidis committed 2006-07-13 11:26:51 -04:00
1 parent fee90920fa
commit 1a0ef99488
2 files changed
+13 -1

No files matched your search

+9
View File
@@ -231,3 +231,12 @@ void xencomm_add_offset(void *handle, unsigned int bytes)
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);
}
+4 -1
View File
@@ -26,9 +26,12 @@ extern unsigned long xencomm_copy_to_guest(void *to, const void *from,
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) ({ \
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.