forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-06 08f87f769b595151be1afeff53e144f543faa614
kernel/drivers/gpu/drm/vmwgfx/vmwgfx_msg.h
....@@ -32,6 +32,7 @@
3232 #ifndef _VMWGFX_MSG_H
3333 #define _VMWGFX_MSG_H
3434
35
+#include <asm/vmware.h>
3536
3637 /**
3738 * Hypervisor-specific bi-directional communication channel. Should never
....@@ -44,7 +45,7 @@
4445 * @in_ebx: [IN] Message Len, through EBX
4546 * @in_si: [IN] Input argument through SI, set to 0 if not used
4647 * @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]
4849 * @magic: [IN] hypervisor magic value
4950 * @eax: [OUT] value of EAX register
5051 * @ebx: [OUT] e.g. status from an HB message status command
....@@ -54,10 +55,10 @@
5455 * @di: [OUT]
5556 */
5657 #define VMW_PORT(cmd, in_ebx, in_si, in_di, \
57
- port_num, magic, \
58
+ flags, magic, \
5859 eax, ebx, ecx, edx, si, di) \
5960 ({ \
60
- asm volatile ("inl %%dx, %%eax;" : \
61
+ asm volatile (VMWARE_HYPERCALL : \
6162 "=a"(eax), \
6263 "=b"(ebx), \
6364 "=c"(ecx), \
....@@ -67,7 +68,7 @@
6768 "a"(magic), \
6869 "b"(in_ebx), \
6970 "c"(cmd), \
70
- "d"(port_num), \
71
+ "d"(flags), \
7172 "S"(in_si), \
7273 "D"(in_di) : \
7374 "memory"); \
....@@ -85,7 +86,7 @@
8586 * @in_ecx: [IN] Message Len, through ECX
8687 * @in_si: [IN] Input argument through SI, set to 0 if not used
8788 * @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]
8990 * @magic: [IN] hypervisor magic value
9091 * @bp: [IN]
9192 * @eax: [OUT] value of EAX register
....@@ -98,12 +99,12 @@
9899 #ifdef __x86_64__
99100
100101 #define VMW_PORT_HB_OUT(cmd, in_ecx, in_si, in_di, \
101
- port_num, magic, bp, \
102
+ flags, magic, bp, \
102103 eax, ebx, ecx, edx, si, di) \
103104 ({ \
104105 asm volatile ("push %%rbp;" \
105106 "mov %12, %%rbp;" \
106
- "rep outsb;" \
107
+ VMWARE_HYPERCALL_HB_OUT \
107108 "pop %%rbp;" : \
108109 "=a"(eax), \
109110 "=b"(ebx), \
....@@ -114,7 +115,7 @@
114115 "a"(magic), \
115116 "b"(cmd), \
116117 "c"(in_ecx), \
117
- "d"(port_num), \
118
+ "d"(flags), \
118119 "S"(in_si), \
119120 "D"(in_di), \
120121 "r"(bp) : \
....@@ -123,12 +124,12 @@
123124
124125
125126 #define VMW_PORT_HB_IN(cmd, in_ecx, in_si, in_di, \
126
- port_num, magic, bp, \
127
+ flags, magic, bp, \
127128 eax, ebx, ecx, edx, si, di) \
128129 ({ \
129130 asm volatile ("push %%rbp;" \
130131 "mov %12, %%rbp;" \
131
- "rep insb;" \
132
+ VMWARE_HYPERCALL_HB_IN \
132133 "pop %%rbp" : \
133134 "=a"(eax), \
134135 "=b"(ebx), \
....@@ -139,7 +140,7 @@
139140 "a"(magic), \
140141 "b"(cmd), \
141142 "c"(in_ecx), \
142
- "d"(port_num), \
143
+ "d"(flags), \
143144 "S"(in_si), \
144145 "D"(in_di), \
145146 "r"(bp) : \
....@@ -157,13 +158,13 @@
157158 * just pushed it.
158159 */
159160 #define VMW_PORT_HB_OUT(cmd, in_ecx, in_si, in_di, \
160
- port_num, magic, bp, \
161
+ flags, magic, bp, \
161162 eax, ebx, ecx, edx, si, di) \
162163 ({ \
163164 asm volatile ("push %12;" \
164165 "push %%ebp;" \
165166 "mov 0x04(%%esp), %%ebp;" \
166
- "rep outsb;" \
167
+ VMWARE_HYPERCALL_HB_OUT \
167168 "pop %%ebp;" \
168169 "add $0x04, %%esp;" : \
169170 "=a"(eax), \
....@@ -175,7 +176,7 @@
175176 "a"(magic), \
176177 "b"(cmd), \
177178 "c"(in_ecx), \
178
- "d"(port_num), \
179
+ "d"(flags), \
179180 "S"(in_si), \
180181 "D"(in_di), \
181182 "m"(bp) : \
....@@ -184,13 +185,13 @@
184185
185186
186187 #define VMW_PORT_HB_IN(cmd, in_ecx, in_si, in_di, \
187
- port_num, magic, bp, \
188
+ flags, magic, bp, \
188189 eax, ebx, ecx, edx, si, di) \
189190 ({ \
190191 asm volatile ("push %12;" \
191192 "push %%ebp;" \
192193 "mov 0x04(%%esp), %%ebp;" \
193
- "rep insb;" \
194
+ VMWARE_HYPERCALL_HB_IN \
194195 "pop %%ebp;" \
195196 "add $0x04, %%esp;" : \
196197 "=a"(eax), \
....@@ -202,7 +203,7 @@
202203 "a"(magic), \
203204 "b"(cmd), \
204205 "c"(in_ecx), \
205
- "d"(port_num), \
206
+ "d"(flags), \
206207 "S"(in_si), \
207208 "D"(in_di), \
208209 "m"(bp) : \