introduce guest_handle_for_field()
authorJan Beulich <jbeulich@suse.com>
Thu, 20 Sep 2012 11:31:19 +0000 (13:31 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 20 Sep 2012 11:31:19 +0000 (13:31 +0200)
This helper turns a field of a GUEST_HANDLE in a GUEST_HANDLE.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
xen/include/asm-x86/guest_access.h

index 2b429c225f1e3adf828486675e1b645c234c1ec3..e3ac1d6fa8f66c10c190f9a7ce99f8f3f25a71e6 100644 (file)
@@ -51,6 +51,9 @@
     (XEN_GUEST_HANDLE(type)) { _x };            \
 })
 
+#define guest_handle_for_field(hnd, type, fld)          \
+    ((XEN_GUEST_HANDLE(type)) { &(hnd).p->fld })
+
 #define guest_handle_from_ptr(ptr, type)        \
     ((XEN_GUEST_HANDLE(type)) { (type *)ptr })
 #define const_guest_handle_from_ptr(ptr, type)  \