From: Christopher Clark Date: Wed, 6 Feb 2019 08:55:00 +0000 (+0100) Subject: xen/arm: introduce guest_handle_for_field() X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=926d0a3b55e99b12a0f54ad9c0ad197dca4d959e;p=people%2Fpauldu%2Fxen.git xen/arm: introduce guest_handle_for_field() 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 Reviewed-by: Paul Durrant Reviewed-by: Stefano Stabellini Release-acked-by: Juergen Gross --- diff --git a/xen/include/asm-arm/guest_access.h b/xen/include/asm-arm/guest_access.h index 224d2a033b..8997a1cbfe 100644 --- a/xen/include/asm-arm/guest_access.h +++ b/xen/include/asm-arm/guest_access.h @@ -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) \