From bb544585137259545d4adc9afe6eed8dc7c7376d Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Thu, 20 Sep 2012 13:31:19 +0200 Subject: [PATCH] introduce guest_handle_for_field() This helper turns a field of a GUEST_HANDLE in a GUEST_HANDLE. Signed-off-by: Jan Beulich --- xen/include/asm-x86/guest_access.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xen/include/asm-x86/guest_access.h b/xen/include/asm-x86/guest_access.h index 2b429c225f..e3ac1d6fa8 100644 --- a/xen/include/asm-x86/guest_access.h +++ b/xen/include/asm-x86/guest_access.h @@ -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) \ -- 2.39.5