.. | .. |
---|
32 | 32 | #ifndef _VMWGFX_MSG_H |
---|
33 | 33 | #define _VMWGFX_MSG_H |
---|
34 | 34 | |
---|
| 35 | +#include <asm/vmware.h> |
---|
35 | 36 | |
---|
36 | 37 | /** |
---|
37 | 38 | * Hypervisor-specific bi-directional communication channel. Should never |
---|
.. | .. |
---|
44 | 45 | * @in_ebx: [IN] Message Len, through EBX |
---|
45 | 46 | * @in_si: [IN] Input argument through SI, set to 0 if not used |
---|
46 | 47 | * @in_di: [IN] Input argument through DI, set ot 0 if not used |
---|
47 | | - * @port_num: [IN] port number + [channel id] |
---|
| 48 | + * @flags: [IN] hypercall flags + [channel id] |
---|
48 | 49 | * @magic: [IN] hypervisor magic value |
---|
49 | 50 | * @eax: [OUT] value of EAX register |
---|
50 | 51 | * @ebx: [OUT] e.g. status from an HB message status command |
---|
.. | .. |
---|
54 | 55 | * @di: [OUT] |
---|
55 | 56 | */ |
---|
56 | 57 | #define VMW_PORT(cmd, in_ebx, in_si, in_di, \ |
---|
57 | | - port_num, magic, \ |
---|
| 58 | + flags, magic, \ |
---|
58 | 59 | eax, ebx, ecx, edx, si, di) \ |
---|
59 | 60 | ({ \ |
---|
60 | | - asm volatile ("inl %%dx, %%eax;" : \ |
---|
| 61 | + asm volatile (VMWARE_HYPERCALL : \ |
---|
61 | 62 | "=a"(eax), \ |
---|
62 | 63 | "=b"(ebx), \ |
---|
63 | 64 | "=c"(ecx), \ |
---|
.. | .. |
---|
67 | 68 | "a"(magic), \ |
---|
68 | 69 | "b"(in_ebx), \ |
---|
69 | 70 | "c"(cmd), \ |
---|
70 | | - "d"(port_num), \ |
---|
| 71 | + "d"(flags), \ |
---|
71 | 72 | "S"(in_si), \ |
---|
72 | 73 | "D"(in_di) : \ |
---|
73 | 74 | "memory"); \ |
---|
.. | .. |
---|
85 | 86 | * @in_ecx: [IN] Message Len, through ECX |
---|
86 | 87 | * @in_si: [IN] Input argument through SI, set to 0 if not used |
---|
87 | 88 | * @in_di: [IN] Input argument through DI, set to 0 if not used |
---|
88 | | - * @port_num: [IN] port number + [channel id] |
---|
| 89 | + * @flags: [IN] hypercall flags + [channel id] |
---|
89 | 90 | * @magic: [IN] hypervisor magic value |
---|
90 | 91 | * @bp: [IN] |
---|
91 | 92 | * @eax: [OUT] value of EAX register |
---|
.. | .. |
---|
98 | 99 | #ifdef __x86_64__ |
---|
99 | 100 | |
---|
100 | 101 | #define VMW_PORT_HB_OUT(cmd, in_ecx, in_si, in_di, \ |
---|
101 | | - port_num, magic, bp, \ |
---|
| 102 | + flags, magic, bp, \ |
---|
102 | 103 | eax, ebx, ecx, edx, si, di) \ |
---|
103 | 104 | ({ \ |
---|
104 | 105 | asm volatile ("push %%rbp;" \ |
---|
105 | 106 | "mov %12, %%rbp;" \ |
---|
106 | | - "rep outsb;" \ |
---|
| 107 | + VMWARE_HYPERCALL_HB_OUT \ |
---|
107 | 108 | "pop %%rbp;" : \ |
---|
108 | 109 | "=a"(eax), \ |
---|
109 | 110 | "=b"(ebx), \ |
---|
.. | .. |
---|
114 | 115 | "a"(magic), \ |
---|
115 | 116 | "b"(cmd), \ |
---|
116 | 117 | "c"(in_ecx), \ |
---|
117 | | - "d"(port_num), \ |
---|
| 118 | + "d"(flags), \ |
---|
118 | 119 | "S"(in_si), \ |
---|
119 | 120 | "D"(in_di), \ |
---|
120 | 121 | "r"(bp) : \ |
---|
.. | .. |
---|
123 | 124 | |
---|
124 | 125 | |
---|
125 | 126 | #define VMW_PORT_HB_IN(cmd, in_ecx, in_si, in_di, \ |
---|
126 | | - port_num, magic, bp, \ |
---|
| 127 | + flags, magic, bp, \ |
---|
127 | 128 | eax, ebx, ecx, edx, si, di) \ |
---|
128 | 129 | ({ \ |
---|
129 | 130 | asm volatile ("push %%rbp;" \ |
---|
130 | 131 | "mov %12, %%rbp;" \ |
---|
131 | | - "rep insb;" \ |
---|
| 132 | + VMWARE_HYPERCALL_HB_IN \ |
---|
132 | 133 | "pop %%rbp" : \ |
---|
133 | 134 | "=a"(eax), \ |
---|
134 | 135 | "=b"(ebx), \ |
---|
.. | .. |
---|
139 | 140 | "a"(magic), \ |
---|
140 | 141 | "b"(cmd), \ |
---|
141 | 142 | "c"(in_ecx), \ |
---|
142 | | - "d"(port_num), \ |
---|
| 143 | + "d"(flags), \ |
---|
143 | 144 | "S"(in_si), \ |
---|
144 | 145 | "D"(in_di), \ |
---|
145 | 146 | "r"(bp) : \ |
---|
.. | .. |
---|
157 | 158 | * just pushed it. |
---|
158 | 159 | */ |
---|
159 | 160 | #define VMW_PORT_HB_OUT(cmd, in_ecx, in_si, in_di, \ |
---|
160 | | - port_num, magic, bp, \ |
---|
| 161 | + flags, magic, bp, \ |
---|
161 | 162 | eax, ebx, ecx, edx, si, di) \ |
---|
162 | 163 | ({ \ |
---|
163 | 164 | asm volatile ("push %12;" \ |
---|
164 | 165 | "push %%ebp;" \ |
---|
165 | 166 | "mov 0x04(%%esp), %%ebp;" \ |
---|
166 | | - "rep outsb;" \ |
---|
| 167 | + VMWARE_HYPERCALL_HB_OUT \ |
---|
167 | 168 | "pop %%ebp;" \ |
---|
168 | 169 | "add $0x04, %%esp;" : \ |
---|
169 | 170 | "=a"(eax), \ |
---|
.. | .. |
---|
175 | 176 | "a"(magic), \ |
---|
176 | 177 | "b"(cmd), \ |
---|
177 | 178 | "c"(in_ecx), \ |
---|
178 | | - "d"(port_num), \ |
---|
| 179 | + "d"(flags), \ |
---|
179 | 180 | "S"(in_si), \ |
---|
180 | 181 | "D"(in_di), \ |
---|
181 | 182 | "m"(bp) : \ |
---|
.. | .. |
---|
184 | 185 | |
---|
185 | 186 | |
---|
186 | 187 | #define VMW_PORT_HB_IN(cmd, in_ecx, in_si, in_di, \ |
---|
187 | | - port_num, magic, bp, \ |
---|
| 188 | + flags, magic, bp, \ |
---|
188 | 189 | eax, ebx, ecx, edx, si, di) \ |
---|
189 | 190 | ({ \ |
---|
190 | 191 | asm volatile ("push %12;" \ |
---|
191 | 192 | "push %%ebp;" \ |
---|
192 | 193 | "mov 0x04(%%esp), %%ebp;" \ |
---|
193 | | - "rep insb;" \ |
---|
| 194 | + VMWARE_HYPERCALL_HB_IN \ |
---|
194 | 195 | "pop %%ebp;" \ |
---|
195 | 196 | "add $0x04, %%esp;" : \ |
---|
196 | 197 | "=a"(eax), \ |
---|
.. | .. |
---|
202 | 203 | "a"(magic), \ |
---|
203 | 204 | "b"(cmd), \ |
---|
204 | 205 | "c"(in_ecx), \ |
---|
205 | | - "d"(port_num), \ |
---|
| 206 | + "d"(flags), \ |
---|
206 | 207 | "S"(in_si), \ |
---|
207 | 208 | "D"(in_di), \ |
---|
208 | 209 | "m"(bp) : \ |
---|