diff options
author | Isaku Yamahata <yamahata@valinux.co.jp> | 2008-04-02 13:53:52 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-04-24 17:57:32 -0400 |
commit | 87e27cf6288c6bf089ed34a72213d9ad16e82d84 (patch) | |
tree | db7c9022e6b1fd77de850f5d0037181937041d24 /include/asm-x86/xen/interface.h | |
parent | 2eb6d5eb48fd6aedf5787b30e5c41693e8c91fa3 (diff) |
xen: add missing definitions for xen grant table which ia64/xen needs
Add xen handles realted definitions for grant table which ia64/xen
needs.
Pointer argumsnts for ia64/xen hypercall are passed in pseudo physical
address (guest physical address) so that it is required to convert
guest kernel virtual address into pseudo physical address right before
issuing hypercall.
The xen guest handle represents such arguments.
Define necessary handles and helper functions.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/asm-x86/xen/interface.h')
-rw-r--r-- | include/asm-x86/xen/interface.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/include/asm-x86/xen/interface.h b/include/asm-x86/xen/interface.h index 588a0716cd78..6227000a1e84 100644 --- a/include/asm-x86/xen/interface.h +++ b/include/asm-x86/xen/interface.h | |||
@@ -22,6 +22,30 @@ | |||
22 | #define DEFINE_GUEST_HANDLE(name) __DEFINE_GUEST_HANDLE(name, name) | 22 | #define DEFINE_GUEST_HANDLE(name) __DEFINE_GUEST_HANDLE(name, name) |
23 | #define GUEST_HANDLE(name) __guest_handle_ ## name | 23 | #define GUEST_HANDLE(name) __guest_handle_ ## name |
24 | 24 | ||
25 | #ifdef __XEN__ | ||
26 | #if defined(__i386__) | ||
27 | #define set_xen_guest_handle(hnd, val) \ | ||
28 | do { \ | ||
29 | if (sizeof(hnd) == 8) \ | ||
30 | *(uint64_t *)&(hnd) = 0; \ | ||
31 | (hnd).p = val; \ | ||
32 | } while (0) | ||
33 | #elif defined(__x86_64__) | ||
34 | #define set_xen_guest_handle(hnd, val) do { (hnd).p = val; } while (0) | ||
35 | #endif | ||
36 | #else | ||
37 | #if defined(__i386__) | ||
38 | #define set_xen_guest_handle(hnd, val) \ | ||
39 | do { \ | ||
40 | if (sizeof(hnd) == 8) \ | ||
41 | *(uint64_t *)&(hnd) = 0; \ | ||
42 | (hnd) = val; \ | ||
43 | } while (0) | ||
44 | #elif defined(__x86_64__) | ||
45 | #define set_xen_guest_handle(hnd, val) do { (hnd) = val; } while (0) | ||
46 | #endif | ||
47 | #endif | ||
48 | |||
25 | #ifndef __ASSEMBLY__ | 49 | #ifndef __ASSEMBLY__ |
26 | /* Guest handles for primitive C types. */ | 50 | /* Guest handles for primitive C types. */ |
27 | __DEFINE_GUEST_HANDLE(uchar, unsigned char); | 51 | __DEFINE_GUEST_HANDLE(uchar, unsigned char); |