- Update Xen patches to 3.3-rc5 and c/s 1157.
[linux-flexiantxendom0-3.2.10.git] / include / xen / hypercall.h
1 #ifndef __XEN_HYPERCALL_H__
2 #define __XEN_HYPERCALL_H__
3
4 #include <asm/hypercall.h>
5
6 static inline int __must_check
7 HYPERVISOR_multicall_check(
8         multicall_entry_t *call_list, unsigned int nr_calls,
9         const unsigned long *rc_list)
10 {
11         int rc = HYPERVISOR_multicall(call_list, nr_calls);
12
13         if (unlikely(rc < 0))
14                 return rc;
15         BUG_ON(rc);
16         BUG_ON((int)nr_calls < 0);
17
18         for ( ; nr_calls > 0; --nr_calls, ++call_list)
19                 if (unlikely(call_list->result != (rc_list ? *rc_list++ : 0)))
20                         return nr_calls;
21
22         return 0;
23 }
24
25 /* A construct to ignore the return value of hypercall wrappers in a few
26  * exceptional cases (simply casting the function result to void doesn't
27  * avoid the compiler warning): */
28 #define VOID(expr) ((void)((expr)?:0))
29
30 #endif /* __XEN_HYPERCALL_H__ */