ia64/xen-unstable

view linux-2.6.7-xen-sparse/include/asm-xen/multicall.h @ 1820:3d4f8eb89670

bitkeeper revision 1.1106.1.2 (40faa780dekT3E5arFwcbQDu1MbX6g)

Cleaned up Xen's instruction emulator.
author kaf24@scramble.cl.cam.ac.uk
date Sun Jul 18 16:38:24 2004 +0000 (2004-07-18)
parents 002fc84add90
children 6f08c0b6c8cd 3b0ab2e570a0 dae98734f12e
line source
1 /******************************************************************************
2 * multicall.h
3 */
5 #ifndef __MULTICALL_H__
6 #define __MULTICALL_H__
8 #include <asm/hypervisor.h>
10 extern multicall_entry_t multicall_list[];
11 extern int nr_multicall_ents;
13 static inline void queue_multicall0(unsigned long op)
14 {
15 int i = nr_multicall_ents;
16 multicall_list[i].op = op;
17 nr_multicall_ents = i+1;
18 }
20 static inline void queue_multicall1(unsigned long op, unsigned long arg1)
21 {
22 int i = nr_multicall_ents;
23 multicall_list[i].op = op;
24 multicall_list[i].args[0] = arg1;
25 nr_multicall_ents = i+1;
26 }
28 static inline void queue_multicall2(
29 unsigned long op, unsigned long arg1, unsigned long arg2)
30 {
31 int i = nr_multicall_ents;
32 multicall_list[i].op = op;
33 multicall_list[i].args[0] = arg1;
34 multicall_list[i].args[1] = arg2;
35 nr_multicall_ents = i+1;
36 }
38 static inline void queue_multicall3(
39 unsigned long op, unsigned long arg1, unsigned long arg2,
40 unsigned long arg3)
41 {
42 int i = nr_multicall_ents;
43 multicall_list[i].op = op;
44 multicall_list[i].args[0] = arg1;
45 multicall_list[i].args[1] = arg2;
46 multicall_list[i].args[2] = arg3;
47 nr_multicall_ents = i+1;
48 }
50 static inline void queue_multicall4(
51 unsigned long op, unsigned long arg1, unsigned long arg2,
52 unsigned long arg3, unsigned long arg4)
53 {
54 int i = nr_multicall_ents;
55 multicall_list[i].op = op;
56 multicall_list[i].args[0] = arg1;
57 multicall_list[i].args[1] = arg2;
58 multicall_list[i].args[2] = arg3;
59 multicall_list[i].args[3] = arg4;
60 nr_multicall_ents = i+1;
61 }
63 static inline void queue_multicall5(
64 unsigned long op, unsigned long arg1, unsigned long arg2,
65 unsigned long arg3, unsigned long arg4, unsigned long arg5)
66 {
67 int i = nr_multicall_ents;
68 multicall_list[i].op = op;
69 multicall_list[i].args[0] = arg1;
70 multicall_list[i].args[1] = arg2;
71 multicall_list[i].args[2] = arg3;
72 multicall_list[i].args[3] = arg4;
73 multicall_list[i].args[4] = arg5;
74 nr_multicall_ents = i+1;
75 }
77 static inline void execute_multicall_list(void)
78 {
79 if ( unlikely(nr_multicall_ents == 0) ) return;
80 (void)HYPERVISOR_multicall(multicall_list, nr_multicall_ents);
81 nr_multicall_ents = 0;
82 }
84 #endif /* __MULTICALL_H__ */