]> xenbits.xensource.com Git - people/pauldu/xen.git/commitdiff
xen/arm: introduce guest_handle_for_field()
authorChristopher Clark <christopher.w.clark@gmail.com>
Wed, 6 Feb 2019 08:55:00 +0000 (09:55 +0100)
committerJan Beulich <jbeulich@suse.com>
Thu, 7 Feb 2019 13:22:44 +0000 (14:22 +0100)
ARM port of c/s bb544585: "introduce guest_handle_for_field()"

This helper turns a field of a GUEST_HANDLE into a GUEST_HANDLE.

Signed-off-by: Christopher Clark <christopher.clark6@baesystems.com>
Reviewed-by: Paul Durrant <paul.durrant@citrix.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Release-acked-by: Juergen Gross <jgross@suse.com>
xen/include/asm-arm/guest_access.h

index 224d2a033bebcb3b1fad6da11b4f0705e09b014e..8997a1cbfeab8210659fcf37383d854b8c1fa423 100644 (file)
@@ -63,6 +63,9 @@ int access_guest_memory_by_ipa(struct domain *d, paddr_t ipa, void *buf,
     _y;                                                     \
 })
 
+#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_PARAM(type)) { (type *)ptr })
 #define const_guest_handle_from_ptr(ptr, type)  \