Skip to content

Commit

Permalink
xen/arm: introduce guest_handle_for_field()
Browse files Browse the repository at this point in the history
ARM port of c/s bb54458: "introduce guest_handle_for_field()"

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

Signed-off-by: Christopher Clark <[email protected]>
Reviewed-by: Paul Durrant <[email protected]>
Reviewed-by: Stefano Stabellini <[email protected]>
===
v3: Added Stefano's Reviewed-by
v2: Added Paul's Reviewed-by
  • Loading branch information
dozylynx authored and andyhhp committed Jan 15, 2019
1 parent 63eaa9f commit 29cc9a2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions xen/include/asm-arm/guest_access.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand Down

0 comments on commit 29cc9a2

Please sign in to comment.