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