1 | /** @file
|
---|
2 | * IPRT - AMD64 and x86 Specific Assembly Functions, 32-bit Watcom C pragma aux.
|
---|
3 | */
|
---|
4 |
|
---|
5 | /*
|
---|
6 | * Copyright (C) 2006-2017 Oracle Corporation
|
---|
7 | *
|
---|
8 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
9 | * available from http://www.virtualbox.org. This file is free software;
|
---|
10 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
11 | * General Public License (GPL) as published by the Free Software
|
---|
12 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
13 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
14 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
15 | *
|
---|
16 | * The contents of this file may alternatively be used under the terms
|
---|
17 | * of the Common Development and Distribution License Version 1.0
|
---|
18 | * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
|
---|
19 | * VirtualBox OSE distribution, in which case the provisions of the
|
---|
20 | * CDDL are applicable instead of those of the GPL.
|
---|
21 | *
|
---|
22 | * You may elect to license modified versions of this file under the
|
---|
23 | * terms and conditions of either the GPL or the CDDL or both.
|
---|
24 | */
|
---|
25 |
|
---|
26 | #ifndef ___iprt_asm_amd64_x86_h
|
---|
27 | # error "Don't include this header directly."
|
---|
28 | #endif
|
---|
29 | #ifndef ___iprt_asm_amd64_x86_watcom_32_h
|
---|
30 | #define ___iprt_asm_amd64_x86_watcom_32_h
|
---|
31 |
|
---|
32 | #ifndef __FLAT__
|
---|
33 | # error "Only works with flat pointers! (-mf)"
|
---|
34 | #endif
|
---|
35 |
|
---|
36 | /*
|
---|
37 | * Note! The #undef that preceds the #pragma aux statements is for undoing
|
---|
38 | * the mangling, because the symbol in #pragma aux [symbol] statements
|
---|
39 | * doesn't get subjected to preprocessing. This is also why we include
|
---|
40 | * the watcom header at both the top and the bottom of asm-amd64-x86.h file.
|
---|
41 | */
|
---|
42 |
|
---|
43 | #undef ASMGetIDTR
|
---|
44 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
45 | #pragma aux ASMGetIDTR = \
|
---|
46 | "sidt fword ptr [ecx]" \
|
---|
47 | parm [ecx] \
|
---|
48 | modify exact [];
|
---|
49 | #endif
|
---|
50 |
|
---|
51 | #undef ASMGetIdtrLimit
|
---|
52 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
53 | #pragma aux ASMGetIdtrLimit = \
|
---|
54 | "sub esp, 8" \
|
---|
55 | "sidt fword ptr [esp]" \
|
---|
56 | "mov cx, [esp]" \
|
---|
57 | "add esp, 8" \
|
---|
58 | parm [] \
|
---|
59 | value [cx] \
|
---|
60 | modify exact [ecx];
|
---|
61 | #endif
|
---|
62 |
|
---|
63 | #undef ASMSetIDTR
|
---|
64 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
65 | #pragma aux ASMSetIDTR = \
|
---|
66 | "lidt fword ptr [ecx]" \
|
---|
67 | parm [ecx] nomemory \
|
---|
68 | modify nomemory;
|
---|
69 | #endif
|
---|
70 |
|
---|
71 | #undef ASMGetGDTR
|
---|
72 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
73 | #pragma aux ASMGetGDTR = \
|
---|
74 | "sgdt fword ptr [ecx]" \
|
---|
75 | parm [ecx] \
|
---|
76 | modify exact [];
|
---|
77 | #endif
|
---|
78 |
|
---|
79 | #undef ASMSetGDTR
|
---|
80 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
81 | #pragma aux ASMSetGDTR = \
|
---|
82 | "lgdt fword ptr [ecx]" \
|
---|
83 | parm [ecx] nomemory \
|
---|
84 | modify exact [] nomemory;
|
---|
85 | #endif
|
---|
86 |
|
---|
87 | #undef ASMGetCS
|
---|
88 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
89 | #pragma aux ASMGetCS = \
|
---|
90 | "mov ax, cs" \
|
---|
91 | parm [] nomemory \
|
---|
92 | value [ax] \
|
---|
93 | modify exact [eax] nomemory;
|
---|
94 | #endif
|
---|
95 |
|
---|
96 | #undef ASMGetDS
|
---|
97 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
98 | #pragma aux ASMGetDS = \
|
---|
99 | "mov ax, ds" \
|
---|
100 | parm [] nomemory \
|
---|
101 | value [ax] \
|
---|
102 | modify exact [eax] nomemory;
|
---|
103 | #endif
|
---|
104 |
|
---|
105 | #undef ASMGetES
|
---|
106 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
107 | #pragma aux ASMGetES = \
|
---|
108 | "mov ax, es" \
|
---|
109 | parm [] nomemory \
|
---|
110 | value [ax] \
|
---|
111 | modify exact [eax] nomemory;
|
---|
112 | #endif
|
---|
113 |
|
---|
114 | #undef ASMGetFS
|
---|
115 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
116 | #pragma aux ASMGetFS = \
|
---|
117 | "mov ax, fs" \
|
---|
118 | parm [] nomemory \
|
---|
119 | value [ax] \
|
---|
120 | modify exact [eax] nomemory;
|
---|
121 | #endif
|
---|
122 |
|
---|
123 | #undef ASMGetGS
|
---|
124 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
125 | #pragma aux ASMGetGS = \
|
---|
126 | "mov ax, gs" \
|
---|
127 | parm [] nomemory \
|
---|
128 | value [ax] \
|
---|
129 | modify exact [eax] nomemory;
|
---|
130 | #endif
|
---|
131 |
|
---|
132 | #undef ASMGetSS
|
---|
133 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
134 | #pragma aux ASMGetSS = \
|
---|
135 | "mov ax, ss" \
|
---|
136 | parm [] nomemory \
|
---|
137 | value [ax] \
|
---|
138 | modify exact [eax] nomemory;
|
---|
139 | #endif
|
---|
140 |
|
---|
141 | #undef ASMGetTR
|
---|
142 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
143 | #pragma aux ASMGetTR = \
|
---|
144 | "str ax" \
|
---|
145 | parm [] nomemory \
|
---|
146 | value [ax] \
|
---|
147 | modify exact [eax] nomemory;
|
---|
148 | #endif
|
---|
149 |
|
---|
150 | #undef ASMGetLDTR
|
---|
151 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
152 | #pragma aux ASMGetLDTR = \
|
---|
153 | "sldt ax" \
|
---|
154 | parm [] nomemory \
|
---|
155 | value [ax] \
|
---|
156 | modify exact [eax] nomemory;
|
---|
157 | #endif
|
---|
158 |
|
---|
159 | /** @todo ASMGetSegAttr */
|
---|
160 |
|
---|
161 | #undef ASMGetFlags
|
---|
162 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
163 | #pragma aux ASMGetFlags = \
|
---|
164 | "pushfd" \
|
---|
165 | "pop eax" \
|
---|
166 | parm [] nomemory \
|
---|
167 | value [eax] \
|
---|
168 | modify exact [eax] nomemory;
|
---|
169 | #endif
|
---|
170 |
|
---|
171 | #undef ASMSetFlags
|
---|
172 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
173 | #pragma aux ASMSetFlags = \
|
---|
174 | "push eax" \
|
---|
175 | "popfd" \
|
---|
176 | parm [eax] nomemory \
|
---|
177 | modify exact [] nomemory;
|
---|
178 | #endif
|
---|
179 |
|
---|
180 | #undef ASMChangeFlags
|
---|
181 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
182 | #pragma aux ASMChangeFlags = \
|
---|
183 | "pushfd" \
|
---|
184 | "pop eax" \
|
---|
185 | "and edx, eax" \
|
---|
186 | "or edx, ecx" \
|
---|
187 | "push edx" \
|
---|
188 | "popfd" \
|
---|
189 | parm [edx] [ecx] nomemory \
|
---|
190 | value [eax] \
|
---|
191 | modify exact [edx] nomemory;
|
---|
192 | #endif
|
---|
193 |
|
---|
194 | #undef ASMAddFlags
|
---|
195 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
196 | #pragma aux ASMAddFlags = \
|
---|
197 | "pushfd" \
|
---|
198 | "pop eax" \
|
---|
199 | "or edx, eax" \
|
---|
200 | "push edx" \
|
---|
201 | "popfd" \
|
---|
202 | parm [edx] nomemory \
|
---|
203 | value [eax] \
|
---|
204 | modify exact [edx] nomemory;
|
---|
205 | #endif
|
---|
206 |
|
---|
207 | #undef ASMClearFlags
|
---|
208 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
209 | #pragma aux ASMClearFlags = \
|
---|
210 | "pushfd" \
|
---|
211 | "pop eax" \
|
---|
212 | "and edx, eax" \
|
---|
213 | "push edx" \
|
---|
214 | "popfd" \
|
---|
215 | parm [edx] nomemory \
|
---|
216 | value [eax] \
|
---|
217 | modify exact [edx] nomemory;
|
---|
218 | #endif
|
---|
219 |
|
---|
220 | /* Note! Must use the 64-bit integer return value convension.
|
---|
221 | The order of registers in the value [set] does not seem to mean anything. */
|
---|
222 | #undef ASMReadTSC
|
---|
223 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
224 | #pragma aux ASMReadTSC = \
|
---|
225 | ".586" \
|
---|
226 | "rdtsc" \
|
---|
227 | parm [] nomemory \
|
---|
228 | value [eax edx] \
|
---|
229 | modify exact [edx eax] nomemory;
|
---|
230 | #endif
|
---|
231 |
|
---|
232 | #undef ASMReadTscWithAux
|
---|
233 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
234 | #pragma aux ASMReadTscWithAux = \
|
---|
235 | 0x0f 0x01 0xf9 \
|
---|
236 | "mov [ebx], ecx" \
|
---|
237 | parm [ebx] \
|
---|
238 | value [eax edx] \
|
---|
239 | modify exact [eax edx ecx];
|
---|
240 | #endif
|
---|
241 |
|
---|
242 | /* ASMCpuId: Implemented externally, too many parameters. */
|
---|
243 | /* ASMCpuId_Idx_ECX: Implemented externally, too many parameters. */
|
---|
244 | /* ASMCpuIdExSlow: Always implemented externally. */
|
---|
245 |
|
---|
246 | #undef ASMCpuId_ECX_EDX
|
---|
247 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
248 | #pragma aux ASMCpuId_ECX_EDX = \
|
---|
249 | ".586" \
|
---|
250 | "cpuid" \
|
---|
251 | "mov [edi], ecx" \
|
---|
252 | "mov [esi], edx" \
|
---|
253 | parm [eax] [edi] [esi] \
|
---|
254 | modify exact [eax ebx ecx edx];
|
---|
255 | #endif
|
---|
256 |
|
---|
257 | #undef ASMCpuId_EAX
|
---|
258 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
259 | #pragma aux ASMCpuId_EAX = \
|
---|
260 | ".586" \
|
---|
261 | "cpuid" \
|
---|
262 | parm [eax] \
|
---|
263 | value [eax] \
|
---|
264 | modify exact [eax ebx ecx edx];
|
---|
265 | #endif
|
---|
266 |
|
---|
267 | #undef ASMCpuId_EBX
|
---|
268 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
269 | #pragma aux ASMCpuId_EBX = \
|
---|
270 | ".586" \
|
---|
271 | "cpuid" \
|
---|
272 | parm [eax] \
|
---|
273 | value [ebx] \
|
---|
274 | modify exact [eax ebx ecx edx];
|
---|
275 | #endif
|
---|
276 |
|
---|
277 | #undef ASMCpuId_ECX
|
---|
278 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
279 | #pragma aux ASMCpuId_ECX = \
|
---|
280 | ".586" \
|
---|
281 | "cpuid" \
|
---|
282 | parm [eax] \
|
---|
283 | value [ecx] \
|
---|
284 | modify exact [eax ebx ecx edx];
|
---|
285 | #endif
|
---|
286 |
|
---|
287 | #undef ASMCpuId_EDX
|
---|
288 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
289 | #pragma aux ASMCpuId_EDX = \
|
---|
290 | ".586" \
|
---|
291 | "cpuid" \
|
---|
292 | parm [eax] \
|
---|
293 | value [edx] \
|
---|
294 | modify exact [eax ebx ecx edx];
|
---|
295 | #endif
|
---|
296 |
|
---|
297 | /* ASMHasCpuId: MSC inline in main source file. */
|
---|
298 |
|
---|
299 | #undef ASMGetApicId
|
---|
300 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
301 | #pragma aux ASMGetApicId = \
|
---|
302 | ".586" \
|
---|
303 | "xor eax, eax" \
|
---|
304 | "cpuid" \
|
---|
305 | "shr ebx,24" \
|
---|
306 | parm [] \
|
---|
307 | value [bl] \
|
---|
308 | modify exact [eax ebx ecx edx];
|
---|
309 | #endif
|
---|
310 |
|
---|
311 | #undef ASMGetCR0
|
---|
312 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
313 | #pragma aux ASMGetCR0 = \
|
---|
314 | "mov eax, cr0" \
|
---|
315 | parm [] nomemory \
|
---|
316 | value [eax] \
|
---|
317 | modify exact [eax] nomemory;
|
---|
318 | #endif
|
---|
319 |
|
---|
320 | #undef ASMSetCR0
|
---|
321 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
322 | #pragma aux ASMSetCR0 = \
|
---|
323 | "mov cr0, eax" \
|
---|
324 | parm [eax] nomemory \
|
---|
325 | modify exact [] nomemory;
|
---|
326 | #endif
|
---|
327 |
|
---|
328 | #undef ASMGetCR2
|
---|
329 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
330 | #pragma aux ASMGetCR2 = \
|
---|
331 | "mov eax, cr2" \
|
---|
332 | parm [] nomemory \
|
---|
333 | value [eax] \
|
---|
334 | modify exact [eax] nomemory;
|
---|
335 | #endif
|
---|
336 |
|
---|
337 | #undef ASMSetCR2
|
---|
338 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
339 | #pragma aux ASMSetCR2 = \
|
---|
340 | "mov cr2, eax" \
|
---|
341 | parm [eax] nomemory \
|
---|
342 | modify exact [] nomemory;
|
---|
343 | #endif
|
---|
344 |
|
---|
345 | #undef ASMGetCR3
|
---|
346 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
347 | #pragma aux ASMGetCR3 = \
|
---|
348 | "mov eax, cr3" \
|
---|
349 | parm [] nomemory \
|
---|
350 | value [eax] \
|
---|
351 | modify exact [eax] nomemory;
|
---|
352 | #endif
|
---|
353 |
|
---|
354 | #undef ASMSetCR3
|
---|
355 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
356 | #pragma aux ASMSetCR3 = \
|
---|
357 | "mov cr3, eax" \
|
---|
358 | parm [eax] nomemory \
|
---|
359 | modify exact [] nomemory;
|
---|
360 | #endif
|
---|
361 |
|
---|
362 | #undef ASMReloadCR3
|
---|
363 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
364 | #pragma aux ASMReloadCR3 = \
|
---|
365 | "mov eax, cr3" \
|
---|
366 | "mov cr3, eax" \
|
---|
367 | parm [] nomemory \
|
---|
368 | modify exact [eax] nomemory;
|
---|
369 | #endif
|
---|
370 |
|
---|
371 | #undef ASMGetCR4
|
---|
372 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
373 | #pragma aux ASMGetCR4 = \
|
---|
374 | "mov eax, cr4" \
|
---|
375 | parm [] nomemory \
|
---|
376 | value [eax] \
|
---|
377 | modify exact [eax] nomemory;
|
---|
378 | #endif
|
---|
379 |
|
---|
380 | #undef ASMSetCR4
|
---|
381 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
382 | #pragma aux ASMSetCR4 = \
|
---|
383 | "mov cr4, eax" \
|
---|
384 | parm [eax] nomemory \
|
---|
385 | modify exact [] nomemory;
|
---|
386 | #endif
|
---|
387 |
|
---|
388 | /* ASMGetCR8: Don't bother for 32-bit. */
|
---|
389 | /* ASMSetCR8: Don't bother for 32-bit. */
|
---|
390 |
|
---|
391 | #undef ASMIntEnable
|
---|
392 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
393 | #pragma aux ASMIntEnable = \
|
---|
394 | "sti" \
|
---|
395 | parm [] nomemory \
|
---|
396 | modify exact [] nomemory;
|
---|
397 | #endif
|
---|
398 |
|
---|
399 | #undef ASMIntDisable
|
---|
400 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
401 | #pragma aux ASMIntDisable = \
|
---|
402 | "cli" \
|
---|
403 | parm [] nomemory \
|
---|
404 | modify exact [] nomemory;
|
---|
405 | #endif
|
---|
406 |
|
---|
407 | #undef ASMIntDisableFlags
|
---|
408 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
409 | #pragma aux ASMIntDisableFlags = \
|
---|
410 | "pushfd" \
|
---|
411 | "cli" \
|
---|
412 | "pop eax" \
|
---|
413 | parm [] nomemory \
|
---|
414 | value [eax] \
|
---|
415 | modify exact [] nomemory;
|
---|
416 | #endif
|
---|
417 |
|
---|
418 | #undef ASMHalt
|
---|
419 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
420 | #pragma aux ASMHalt = \
|
---|
421 | "hlt" \
|
---|
422 | parm [] nomemory \
|
---|
423 | modify exact [] nomemory;
|
---|
424 | #endif
|
---|
425 |
|
---|
426 | #undef ASMRdMsr
|
---|
427 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
428 | #pragma aux ASMRdMsr = \
|
---|
429 | ".586" \
|
---|
430 | "rdmsr" \
|
---|
431 | parm [ecx] nomemory \
|
---|
432 | value [eax edx] \
|
---|
433 | modify exact [eax edx] nomemory;
|
---|
434 | #endif
|
---|
435 |
|
---|
436 | #undef ASMWrMsr
|
---|
437 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
438 | #pragma aux ASMWrMsr = \
|
---|
439 | ".586" \
|
---|
440 | "wrmsr" \
|
---|
441 | parm [ecx] [eax edx] nomemory \
|
---|
442 | modify exact [] nomemory;
|
---|
443 | #endif
|
---|
444 |
|
---|
445 | #undef ASMRdMsrEx
|
---|
446 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
447 | #pragma aux ASMRdMsrEx = \
|
---|
448 | ".586" \
|
---|
449 | "rdmsr" \
|
---|
450 | parm [ecx] [edi] nomemory \
|
---|
451 | value [eax edx] \
|
---|
452 | modify exact [eax edx] nomemory;
|
---|
453 | #endif
|
---|
454 |
|
---|
455 | #undef ASMWrMsrEx
|
---|
456 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
457 | #pragma aux ASMWrMsrEx = \
|
---|
458 | ".586" \
|
---|
459 | "wrmsr" \
|
---|
460 | parm [ecx] [edi] [eax edx] nomemory \
|
---|
461 | modify exact [] nomemory;
|
---|
462 | #endif
|
---|
463 |
|
---|
464 | #undef ASMRdMsr_Low
|
---|
465 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
466 | #pragma aux ASMRdMsr_Low = \
|
---|
467 | ".586" \
|
---|
468 | "rdmsr" \
|
---|
469 | parm [ecx] nomemory \
|
---|
470 | value [eax] \
|
---|
471 | modify exact [eax edx] nomemory;
|
---|
472 | #endif
|
---|
473 |
|
---|
474 | #undef ASMRdMsr_High
|
---|
475 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
476 | #pragma aux ASMRdMsr_High = \
|
---|
477 | ".586" \
|
---|
478 | "rdmsr" \
|
---|
479 | parm [ecx] nomemory \
|
---|
480 | value [edx] \
|
---|
481 | modify exact [eax edx] nomemory;
|
---|
482 | #endif
|
---|
483 |
|
---|
484 |
|
---|
485 | #undef ASMGetDR0
|
---|
486 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
487 | #pragma aux ASMGetDR0 = \
|
---|
488 | "mov eax, dr0" \
|
---|
489 | parm [] nomemory \
|
---|
490 | value [eax] \
|
---|
491 | modify exact [eax] nomemory;
|
---|
492 | #endif
|
---|
493 |
|
---|
494 | #undef ASMGetDR1
|
---|
495 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
496 | #pragma aux ASMGetDR1 = \
|
---|
497 | "mov eax, dr1" \
|
---|
498 | parm [] nomemory \
|
---|
499 | value [eax] \
|
---|
500 | modify exact [eax] nomemory;
|
---|
501 | #endif
|
---|
502 |
|
---|
503 | #undef ASMGetDR2
|
---|
504 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
505 | #pragma aux ASMGetDR2 = \
|
---|
506 | "mov eax, dr2" \
|
---|
507 | parm [] nomemory \
|
---|
508 | value [eax] \
|
---|
509 | modify exact [eax] nomemory;
|
---|
510 | #endif
|
---|
511 |
|
---|
512 | #undef ASMGetDR3
|
---|
513 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
514 | #pragma aux ASMGetDR3 = \
|
---|
515 | "mov eax, dr3" \
|
---|
516 | parm [] nomemory \
|
---|
517 | value [eax] \
|
---|
518 | modify exact [eax] nomemory;
|
---|
519 | #endif
|
---|
520 |
|
---|
521 | #undef ASMGetDR6
|
---|
522 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
523 | #pragma aux ASMGetDR6 = \
|
---|
524 | "mov eax, dr6" \
|
---|
525 | parm [] nomemory \
|
---|
526 | value [eax] \
|
---|
527 | modify exact [eax] nomemory;
|
---|
528 | #endif
|
---|
529 |
|
---|
530 | #undef ASMGetAndClearDR6
|
---|
531 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
532 | #pragma aux ASMGetAndClearDR6 = \
|
---|
533 | "mov edx, 0ffff0ff0h" \
|
---|
534 | "mov eax, dr6" \
|
---|
535 | "mov dr6, edx" \
|
---|
536 | parm [] nomemory \
|
---|
537 | value [eax] \
|
---|
538 | modify exact [eax edx] nomemory;
|
---|
539 | #endif
|
---|
540 |
|
---|
541 | #undef ASMGetDR7
|
---|
542 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
543 | #pragma aux ASMGetDR7 = \
|
---|
544 | "mov eax, dr7" \
|
---|
545 | parm [] nomemory \
|
---|
546 | value [eax] \
|
---|
547 | modify exact [eax] nomemory;
|
---|
548 | #endif
|
---|
549 |
|
---|
550 | #undef ASMSetDR0
|
---|
551 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
552 | #pragma aux ASMSetDR0 = \
|
---|
553 | "mov dr0, eax" \
|
---|
554 | parm [eax] nomemory \
|
---|
555 | modify exact [] nomemory;
|
---|
556 | #endif
|
---|
557 |
|
---|
558 | #undef ASMSetDR1
|
---|
559 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
560 | #pragma aux ASMSetDR1 = \
|
---|
561 | "mov dr1, eax" \
|
---|
562 | parm [eax] nomemory \
|
---|
563 | modify exact [] nomemory;
|
---|
564 | #endif
|
---|
565 |
|
---|
566 | #undef ASMSetDR2
|
---|
567 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
568 | #pragma aux ASMSetDR2 = \
|
---|
569 | "mov dr2, eax" \
|
---|
570 | parm [eax] nomemory \
|
---|
571 | modify exact [] nomemory;
|
---|
572 | #endif
|
---|
573 |
|
---|
574 | #undef ASMSetDR3
|
---|
575 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
576 | #pragma aux ASMSetDR3 = \
|
---|
577 | "mov dr3, eax" \
|
---|
578 | parm [eax] nomemory \
|
---|
579 | modify exact [] nomemory;
|
---|
580 | #endif
|
---|
581 |
|
---|
582 | #undef ASMSetDR6
|
---|
583 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
584 | #pragma aux ASMSetDR6 = \
|
---|
585 | "mov dr6, eax" \
|
---|
586 | parm [eax] nomemory \
|
---|
587 | modify exact [] nomemory;
|
---|
588 | #endif
|
---|
589 |
|
---|
590 | #undef ASMSetDR7
|
---|
591 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
592 | #pragma aux ASMSetDR7 = \
|
---|
593 | "mov dr7, eax" \
|
---|
594 | parm [eax] nomemory \
|
---|
595 | modify exact [] nomemory;
|
---|
596 | #endif
|
---|
597 |
|
---|
598 | /* Yeah, could've used outp here, but this keeps the main file simpler. */
|
---|
599 | #undef ASMOutU8
|
---|
600 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
601 | #pragma aux ASMOutU8 = \
|
---|
602 | "out dx, al" \
|
---|
603 | parm [dx] [al] nomemory \
|
---|
604 | modify exact [] nomemory;
|
---|
605 | #endif
|
---|
606 |
|
---|
607 | #undef ASMInU8
|
---|
608 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
609 | #pragma aux ASMInU8 = \
|
---|
610 | "in al, dx" \
|
---|
611 | parm [dx] nomemory \
|
---|
612 | value [al] \
|
---|
613 | modify exact [] nomemory;
|
---|
614 | #endif
|
---|
615 |
|
---|
616 | #undef ASMOutU16
|
---|
617 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
618 | #pragma aux ASMOutU16 = \
|
---|
619 | "out dx, ax" \
|
---|
620 | parm [dx] [ax] nomemory \
|
---|
621 | modify exact [] nomemory;
|
---|
622 | #endif
|
---|
623 |
|
---|
624 | #undef ASMInU16
|
---|
625 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
626 | #pragma aux ASMInU16 = \
|
---|
627 | "in ax, dx" \
|
---|
628 | parm [dx] nomemory \
|
---|
629 | value [ax] \
|
---|
630 | modify exact [] nomemory;
|
---|
631 | #endif
|
---|
632 |
|
---|
633 | #undef ASMOutU32
|
---|
634 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
635 | #pragma aux ASMOutU32 = \
|
---|
636 | "out dx, eax" \
|
---|
637 | parm [dx] [eax] nomemory \
|
---|
638 | modify exact [] nomemory;
|
---|
639 | #endif
|
---|
640 |
|
---|
641 | #undef ASMInU32
|
---|
642 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
643 | #pragma aux ASMInU32 = \
|
---|
644 | "in eax, dx" \
|
---|
645 | parm [dx] nomemory \
|
---|
646 | value [eax] \
|
---|
647 | modify exact [] nomemory;
|
---|
648 | #endif
|
---|
649 |
|
---|
650 | #undef ASMOutStrU8
|
---|
651 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
652 | #pragma aux ASMOutStrU8 = \
|
---|
653 | "rep outsb" \
|
---|
654 | parm [dx] [esi] [ecx] nomemory \
|
---|
655 | modify exact [esi ecx] nomemory;
|
---|
656 | #endif
|
---|
657 |
|
---|
658 | #undef ASMInStrU8
|
---|
659 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
660 | #pragma aux ASMInStrU8 = \
|
---|
661 | "rep insb" \
|
---|
662 | parm [dx] [edi] [ecx] \
|
---|
663 | modify exact [edi ecx];
|
---|
664 | #endif
|
---|
665 |
|
---|
666 | #undef ASMOutStrU16
|
---|
667 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
668 | #pragma aux ASMOutStrU16 = \
|
---|
669 | "rep outsw" \
|
---|
670 | parm [dx] [esi] [ecx] nomemory \
|
---|
671 | modify exact [esi ecx] nomemory;
|
---|
672 | #endif
|
---|
673 |
|
---|
674 | #undef ASMInStrU16
|
---|
675 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
676 | #pragma aux ASMInStrU16 = \
|
---|
677 | "rep insw" \
|
---|
678 | parm [dx] [edi] [ecx] \
|
---|
679 | modify exact [edi ecx];
|
---|
680 | #endif
|
---|
681 |
|
---|
682 | #undef ASMOutStrU32
|
---|
683 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
684 | #pragma aux ASMOutStrU32 = \
|
---|
685 | "rep outsd" \
|
---|
686 | parm [dx] [esi] [ecx] nomemory \
|
---|
687 | modify exact [esi ecx] nomemory;
|
---|
688 | #endif
|
---|
689 |
|
---|
690 | #undef ASMInStrU32
|
---|
691 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
692 | #pragma aux ASMInStrU32 = \
|
---|
693 | "rep insd" \
|
---|
694 | parm [dx] [edi] [ecx] \
|
---|
695 | modify exact [edi ecx];
|
---|
696 | #endif
|
---|
697 |
|
---|
698 | #undef ASMInvalidatePage
|
---|
699 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
700 | #pragma aux ASMInvalidatePage = \
|
---|
701 | "invlpg [eax]" \
|
---|
702 | parm [eax] \
|
---|
703 | modify exact [];
|
---|
704 | #endif
|
---|
705 |
|
---|
706 | #undef ASMWriteBackAndInvalidateCaches
|
---|
707 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
708 | #pragma aux ASMWriteBackAndInvalidateCaches = \
|
---|
709 | ".486" \
|
---|
710 | "wbinvd" \
|
---|
711 | parm [] nomemory \
|
---|
712 | modify exact [] nomemory;
|
---|
713 | #endif
|
---|
714 |
|
---|
715 | #undef ASMInvalidateInternalCaches
|
---|
716 | #ifdef IPRT_ASM_AMD64_X86_WATCOM_32_INSTANTIATE
|
---|
717 | #pragma aux ASMInvalidateInternalCaches = \
|
---|
718 | ".486" \
|
---|
719 | "invd" \
|
---|
720 | parm [] \
|
---|
721 | modify exact [];
|
---|
722 | #endif
|
---|
723 |
|
---|
724 | #endif
|
---|
725 |
|
---|