From 29cc9a2eb675d939ab8d702e0ee5ec6e92917f16 Mon Sep 17 00:00:00 2001 From: Christopher Clark Date: Sun, 6 Jan 2019 21:05:52 -0800 Subject: [PATCH] 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 === v3: Added Stefano's Reviewed-by v2: Added Paul's Reviewed-by --- xen/include/asm-arm/guest_access.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xen/include/asm-arm/guest_access.h b/xen/include/asm-arm/guest_access.h index 224d2a033beb..8997a1cbfeab 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) \