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