1 /******************************************************************************
2  * guest_access.h
3  *
4  * Copyright (x) 2006, K A Fraser
5  */
6 
7 #ifndef __XEN_GUEST_ACCESS_H__
8 #define __XEN_GUEST_ACCESS_H__
9 
10 #include <asm/guest_access.h>
11 #include <xen/types.h>
12 #include <public/xen.h>
13 
14 #define copy_to_guest(hnd, ptr, nr)                     \
15     copy_to_guest_offset(hnd, 0, ptr, nr)
16 
17 #define copy_from_guest(ptr, hnd, nr)                   \
18     copy_from_guest_offset(ptr, hnd, 0, nr)
19 
20 #define clear_guest(hnd, nr)                            \
21     clear_guest_offset(hnd, 0, nr)
22 
23 #define __copy_to_guest(hnd, ptr, nr)                   \
24     __copy_to_guest_offset(hnd, 0, ptr, nr)
25 
26 #define __copy_from_guest(ptr, hnd, nr)                 \
27     __copy_from_guest_offset(ptr, hnd, 0, nr)
28 
29 #define __clear_guest(hnd, nr)                          \
30     __clear_guest_offset(hnd, 0, nr)
31 
32 char *safe_copy_string_from_guest(XEN_GUEST_HANDLE(char) u_buf,
33                                   size_t size, size_t max_size);
34 
35 #endif /* __XEN_GUEST_ACCESS_H__ */
36