VirtualBox

Changeset 58749 in vbox


Ignore:
Timestamp:
Nov 18, 2015 7:46:11 PM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
104190
Message:

iprt/asm*.h: Watcom & RT_MANGLER, include #pragma aux before function prototypes so we can #undef the mangled symbol.

Location:
trunk/include/iprt
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/asm-amd64-x86-watcom-16.h

    r58707 r58749  
    3838 * seems to insists on loading the DGROUP segment into 'ds' before calling
    3939 * stuff when using -ecc.  Using 'es' instead as this seems to work fine.
     40 *
     41 * Note! The #undef that preceds the #pragma aux statements is for undoing
     42 *       the mangling, because the symbol in #pragma aux [symbol] statements
     43 *       doesn't get subjected to preprocessing.  This is also why we include
     44 *       the watcom header at the top rather than at the bottom of the
     45 *       asm-amd64-x86.h file.
    4046 */
    4147
     48#undef      ASMGetIDTR
    4249#pragma aux ASMGetIDTR = \
    4350    "sidt fword ptr es:[bx]" \
     
    4552    modify exact [];
    4653
     54#undef      ASMGetIdtrLimit
    4755#pragma aux ASMGetIdtrLimit = \
    4856    "sub  sp, 8" \
     
    5563    modify exact [bx];
    5664
     65#undef      ASMSetIDTR
    5766#pragma aux ASMSetIDTR = \
    5867    "lidt fword ptr es:[bx]" \
     
    6069    modify nomemory;
    6170
     71#undef      ASMGetGDTR
    6272#pragma aux ASMGetGDTR = \
    6373    "sgdt fword ptr es:[bx]" \
     
    6575    modify exact [];
    6676
     77#undef      ASMSetGDTR
    6778#pragma aux ASMSetGDTR = \
    6879    "lgdt fword ptr es:[bx]" \
     
    7081    modify exact [] nomemory;
    7182
     83#undef      ASMGetCS
    7284#pragma aux ASMGetCS = \
    7385    "mov ax, cs" \
     
    7688    modify exact [ax] nomemory;
    7789
     90#undef      ASMGetDS
    7891#pragma aux ASMGetDS = \
    7992    "mov ax, ds" \
     
    8295    modify exact [ax] nomemory;
    8396
     97#undef      ASMGetES
    8498#pragma aux ASMGetES = \
    8599    "mov ax, es" \
     
    88102    modify exact [ax] nomemory;
    89103
     104#undef      ASMGetFS
    90105#pragma aux ASMGetFS = \
    91106    "mov ax, fs" \
     
    94109    modify exact [ax] nomemory;
    95110
     111#undef      ASMGetGS
    96112#pragma aux ASMGetGS = \
    97113    "mov ax, gs" \
     
    100116    modify exact [ax] nomemory;
    101117
     118#undef      ASMGetSS
    102119#pragma aux ASMGetSS = \
    103120    "mov ax, ss" \
     
    106123    modify exact [ax] nomemory;
    107124
     125#undef      ASMGetTR
    108126#pragma aux ASMGetTR = \
    109127    "str ax" \
     
    112130    modify exact [ax] nomemory;
    113131
     132#undef      ASMGetLDTR
    114133#pragma aux ASMGetLDTR = \
    115134    "sldt ax" \
     
    120139/** @todo ASMGetSegAttr   */
    121140
     141#undef      ASMGetFlags
    122142#pragma aux ASMGetFlags = \
    123143    "pushf" \
     
    127147    modify exact [ax] nomemory;
    128148
     149#undef      ASMSetFlags
    129150#pragma aux ASMSetFlags = \
    130151    "push ax" \
     
    133154    modify exact [] nomemory;
    134155
     156#undef      ASMChangeFlags
    135157#pragma aux ASMChangeFlags = \
    136158    "pushf" \
     
    144166    modify exact [dx] nomemory;
    145167
     168#undef      ASMAddFlags
    146169#pragma aux ASMAddFlags = \
    147170    "pushf" \
     
    154177    modify exact [dx] nomemory;
    155178
     179#undef      ASMClearFlags
    156180#pragma aux ASMClearFlags = \
    157181    "pushf" \
     
    166190/* Note! Must use the 64-bit integer return value convension.
    167191         The order of registers in the value [set] does not seem to mean anything. */
     192#undef      ASMReadTSC
    168193#pragma aux ASMReadTSC = \
    169194    ".586" \
     
    199224            si:di
    200225         This ordering seems to apply to parameter values too. */
     226#undef      ASMGetCR0
    201227#pragma aux ASMGetCR0 = \
    202228    "mov eax, cr0" \
     
    207233    modify exact [ax dx] nomemory;
    208234
     235#undef      ASMSetCR0
    209236#pragma aux ASMSetCR0 = \
    210237    "shl edx, 16" \
     
    214241    modify exact [dx] nomemory;
    215242
     243#undef      ASMGetCR2
    216244#pragma aux ASMGetCR2 = \
    217245    "mov eax, cr2" \
     
    222250    modify exact [ax dx] nomemory;
    223251
     252#undef      ASMSetCR2
    224253#pragma aux ASMSetCR2 = \
    225254    "shl edx, 16" \
     
    229258    modify exact [dx] nomemory;
    230259
     260#undef      ASMGetCR3
    231261#pragma aux ASMGetCR3 = \
    232262    "mov eax, cr3" \
     
    237267    modify exact [ax dx] nomemory;
    238268
     269#undef      ASMSetCR3
    239270#pragma aux ASMSetCR3 = \
    240271    "shl edx, 16" \
     
    244275    modify exact [dx] nomemory;
    245276
     277#undef      ASMReloadCR3
    246278#pragma aux ASMReloadCR3 = \
    247279    "mov eax, cr3" \
     
    250282    modify exact [ax] nomemory;
    251283
     284#undef      ASMGetCR4
    252285#pragma aux ASMGetCR4 = \
    253286    "mov eax, cr4" \
     
    258291    modify exact [ax dx] nomemory;
    259292
     293#undef      ASMSetCR4
    260294#pragma aux ASMSetCR4 = \
    261295    "shl edx, 16" \
     
    268302/* ASMSetCR8: Don't bother for 16-bit. */
    269303
     304#undef      ASMIntEnable
    270305#pragma aux ASMIntEnable = \
    271306    "sti" \
     
    273308    modify exact [] nomemory;
    274309
     310#undef      ASMIntDisable
    275311#pragma aux ASMIntDisable = \
    276312    "cli" \
     
    278314    modify exact [] nomemory;
    279315
     316#undef      ASMIntDisableFlags
    280317#pragma aux ASMIntDisableFlags = \
    281318    "pushf" \
     
    286323    modify exact [] nomemory;
    287324
     325#undef      ASMHalt
    288326#pragma aux ASMHalt = \
    289327    "hlt" \
     
    291329    modify exact [] nomemory;
    292330
     331#undef      ASMRdMsr
    293332#pragma aux ASMRdMsr = \
    294333    ".586" \
     
    309348/* ASMWrMsrEx: Implemented externally, lazy bird. */
    310349
     350#undef      ASMRdMsr_Low
    311351#pragma aux ASMRdMsr_Low = \
    312352    ".586" \
     
    320360    modify exact [ax bx cx dx] nomemory;
    321361
     362#undef      ASMRdMsr_High
    322363#pragma aux ASMRdMsr_High = \
    323364    ".586" \
     
    332373
    333374
     375#undef      ASMGetDR0
    334376#pragma aux ASMGetDR0 = \
    335377    "mov eax, dr0" \
     
    340382    modify exact [ax dx] nomemory;
    341383
     384#undef      ASMGetDR1
    342385#pragma aux ASMGetDR1 = \
    343386    "mov eax, dr1" \
     
    348391    modify exact [ax dx] nomemory;
    349392
     393#undef      ASMGetDR2
    350394#pragma aux ASMGetDR2 = \
    351395    "mov eax, dr2" \
     
    356400    modify exact [ax dx] nomemory;
    357401
     402#undef      ASMGetDR3
    358403#pragma aux ASMGetDR3 = \
    359404    "mov eax, dr3" \
     
    364409    modify exact [ax dx] nomemory;
    365410
     411#undef      ASMGetDR6
    366412#pragma aux ASMGetDR6 = \
    367413    "mov eax, dr6" \
     
    372418    modify exact [ax dx] nomemory;
    373419
     420#undef      ASMGetAndClearDR6
    374421#pragma aux ASMGetAndClearDR6 = \
    375422    "mov edx, 0ffff0ff0h" \
     
    382429    modify exact [ax dx] nomemory;
    383430
     431#undef      ASMGetDR7
    384432#pragma aux ASMGetDR7 = \
    385433    "mov eax, dr7" \
     
    390438    modify exact [ax dx] nomemory;
    391439
     440#undef      ASMSetDR0
    392441#pragma aux ASMSetDR0 = \
    393442    "shl edx, 16" \
     
    397446    modify exact [dx] nomemory;
    398447
     448#undef      ASMSetDR1
    399449#pragma aux ASMSetDR1 = \
    400450    "shl edx, 16" \
     
    404454    modify exact [dx] nomemory;
    405455
     456#undef      ASMSetDR2
    406457#pragma aux ASMSetDR2 = \
    407458    "shl edx, 16" \
     
    411462    modify exact [dx] nomemory;
    412463
     464#undef      ASMSetDR3
    413465#pragma aux ASMSetDR3 = \
    414466    "shl edx, 16" \
     
    418470    modify exact [dx] nomemory;
    419471
     472#undef      ASMSetDR6
    420473#pragma aux ASMSetDR6 = \
    421474    "shl edx, 16" \
     
    425478    modify exact [dx] nomemory;
    426479
     480#undef      ASMSetDR7
    427481#pragma aux ASMSetDR7 = \
    428482    "shl edx, 16" \
     
    433487
    434488/* Yeah, could've used outp here, but this keeps the main file simpler. */
     489#undef      ASMOutU8
    435490#pragma aux ASMOutU8 = \
    436491    "out dx, al" \
     
    438493    modify exact [] nomemory;
    439494
     495#undef      ASMInU8
    440496#pragma aux ASMInU8 = \
    441497    "in al, dx" \
     
    444500    modify exact [] nomemory;
    445501
     502#undef      ASMOutU16
     503#undef      ASMOutU16
    446504#pragma aux ASMOutU16 = \
    447505    "out dx, ax" \
     
    449507    modify exact [] nomemory;
    450508
     509#undef      ASMInU16
    451510#pragma aux ASMInU16 = \
    452511    "in ax, dx" \
     
    455514    modify exact [] nomemory;
    456515
     516#undef      ASMOutU32
    457517#pragma aux ASMOutU32 = \
    458518    "shl ecx, 16" \
     
    463523    modify exact [] nomemory;
    464524
     525#undef      ASMInU32
    465526#pragma aux ASMInU32 = \
    466527    "in eax, dx" \
     
    471532    modify exact [] nomemory;
    472533
     534#undef      ASMOutStrU8
    473535#pragma aux ASMOutStrU8 = \
    474536    "mov ds, bx" \
     
    477539    modify exact [si cx ds] nomemory;
    478540
     541#undef      ASMInStrU8
    479542#pragma aux ASMInStrU8 = \
    480543    "rep insb" \
     
    482545    modify exact [di cx];
    483546
     547#undef      ASMOutStrU16
    484548#pragma aux ASMOutStrU16 = \
    485549    "mov ds, bx" \
     
    488552    modify exact [si cx ds] nomemory;
    489553
     554#undef      ASMInStrU16
    490555#pragma aux ASMInStrU16 = \
    491556    "rep insw" \
     
    493558    modify exact [di cx];
    494559
     560#undef      ASMOutStrU32
    495561#pragma aux ASMOutStrU32 = \
    496562    "mov ds, bx" \
     
    499565    modify exact [si cx ds] nomemory;
    500566
     567#undef      ASMInStrU32
    501568#pragma aux ASMInStrU32 = \
    502569    "rep insd" \
     
    506573/* ASMInvalidatePage: When needed. */
    507574
     575#undef      ASMWriteBackAndInvalidateCaches
    508576#pragma aux ASMWriteBackAndInvalidateCaches = \
    509577    ".486" \
     
    512580    modify exact [] nomemory;
    513581
     582#undef      ASMInvalidateInternalCaches
    514583#pragma aux ASMInvalidateInternalCaches = \
    515584    ".486" \
  • trunk/include/iprt/asm-amd64-x86-watcom-32.h

    r58701 r58749  
    3434#endif
    3535
    36 
     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 the top rather than at the bottom of the
     41 *       asm-amd64-x86.h file.
     42 */
     43
     44#undef      ASMGetIDTR
    3745#pragma aux ASMGetIDTR = \
    3846    "sidt fword ptr [ecx]" \
     
    4048    modify exact [];
    4149
     50#undef      ASMGetIdtrLimit
    4251#pragma aux ASMGetIdtrLimit = \
    4352    "sub  esp, 8" \
     
    4958    modify exact [ecx];
    5059
     60#undef      ASMSetIDTR
    5161#pragma aux ASMSetIDTR = \
    5262    "lidt fword ptr [ecx]" \
     
    5464    modify nomemory;
    5565
     66#undef      ASMGetGDTR
    5667#pragma aux ASMGetGDTR = \
    5768    "sgdt fword ptr [ecx]" \
     
    5970    modify exact [];
    6071
     72#undef      ASMSetGDTR
    6173#pragma aux ASMSetGDTR = \
    6274    "lgdt fword ptr [ecx]" \
     
    6476    modify exact [] nomemory;
    6577
     78#undef      ASMGetCS
    6679#pragma aux ASMGetCS = \
    6780    "mov ax, cs" \
     
    7083    modify exact [eax] nomemory;
    7184
     85#undef      ASMGetDS
    7286#pragma aux ASMGetDS = \
    7387    "mov ax, ds" \
     
    7690    modify exact [eax] nomemory;
    7791
     92#undef      ASMGetES
    7893#pragma aux ASMGetES = \
    7994    "mov ax, es" \
     
    8297    modify exact [eax] nomemory;
    8398
     99#undef      ASMGetFS
    84100#pragma aux ASMGetFS = \
    85101    "mov ax, fs" \
     
    88104    modify exact [eax] nomemory;
    89105
     106#undef      ASMGetGS
    90107#pragma aux ASMGetGS = \
    91108    "mov ax, gs" \
     
    94111    modify exact [eax] nomemory;
    95112
     113#undef      ASMGetSS
    96114#pragma aux ASMGetSS = \
    97115    "mov ax, ss" \
     
    100118    modify exact [eax] nomemory;
    101119
     120#undef      ASMGetTR
    102121#pragma aux ASMGetTR = \
    103122    "str ax" \
     
    106125    modify exact [eax] nomemory;
    107126
     127#undef      ASMGetLDTR
    108128#pragma aux ASMGetLDTR = \
    109129    "sldt ax" \
     
    114134/** @todo ASMGetSegAttr   */
    115135
     136#undef      ASMGetFlags
    116137#pragma aux ASMGetFlags = \
    117138    "pushfd" \
     
    121142    modify exact [eax] nomemory;
    122143
     144#undef      ASMSetFlags
    123145#pragma aux ASMSetFlags = \
    124146    "push eax" \
     
    127149    modify exact [] nomemory;
    128150
     151#undef      ASMChangeFlags
    129152#pragma aux ASMChangeFlags = \
    130153    "pushfd" \
     
    138161    modify exact [edx] nomemory;
    139162
     163#undef      ASMAddFlags
    140164#pragma aux ASMAddFlags = \
    141165    "pushfd" \
     
    148172    modify exact [edx] nomemory;
    149173
     174#undef      ASMClearFlags
    150175#pragma aux ASMClearFlags = \
    151176    "pushfd" \
     
    160185/* Note! Must use the 64-bit integer return value convension.
    161186         The order of registers in the value [set] does not seem to mean anything. */
     187#undef      ASMReadTSC
    162188#pragma aux ASMReadTSC = \
    163189    ".586" \
     
    167193    modify exact [edx eax] nomemory;
    168194
     195#undef      ASMReadTscWithAux
    169196#pragma aux ASMReadTscWithAux = \
    170197    0x0f 0x01 0xf9 \
     
    177204/* ASMCpuIdExSlow: Always implemented externally. */
    178205
     206#undef      ASMCpuId_ECX_EDX
    179207#pragma aux ASMCpuId_ECX_EDX = \
    180208    "cpuid" \
     
    184212    modify exact [eax ebx ecx edx];
    185213
     214#undef      ASMCpuId_EAX
    186215#pragma aux ASMCpuId_EAX = \
    187216    "cpuid" \
     
    190219    modify exact [eax ebx ecx edx];
    191220
     221#undef      ASMCpuId_EBX
    192222#pragma aux ASMCpuId_EBX = \
    193223    "cpuid" \
     
    196226    modify exact [eax ebx ecx edx];
    197227
     228#undef      ASMCpuId_ECX
    198229#pragma aux ASMCpuId_ECX = \
    199230    "cpuid" \
     
    202233    modify exact [eax ebx ecx edx];
    203234
     235#undef      ASMCpuId_EDX
    204236#pragma aux ASMCpuId_EDX = \
    205237    "cpuid" \
     
    211243/* ASMGetApicId: Implemented externally, lazy bird. */
    212244
     245#undef      ASMGetCR0
    213246#pragma aux ASMGetCR0 = \
    214247    "mov eax, cr0" \
     
    217250    modify exact [eax] nomemory;
    218251
     252#undef      ASMSetCR0
    219253#pragma aux ASMSetCR0 = \
    220254    "mov cr0, eax" \
     
    222256    modify exact [] nomemory;
    223257
     258#undef      ASMGetCR2
    224259#pragma aux ASMGetCR2 = \
    225260    "mov eax, cr2" \
     
    228263    modify exact [eax] nomemory;
    229264
     265#undef      ASMSetCR2
    230266#pragma aux ASMSetCR2 = \
    231267    "mov cr2, eax" \
     
    233269    modify exact [] nomemory;
    234270
     271#undef      ASMGetCR3
    235272#pragma aux ASMGetCR3 = \
    236273    "mov eax, cr3" \
     
    239276    modify exact [eax] nomemory;
    240277
     278#undef      ASMSetCR3
    241279#pragma aux ASMSetCR3 = \
    242280    "mov cr3, eax" \
     
    244282    modify exact [] nomemory;
    245283
     284#undef      ASMReloadCR3
    246285#pragma aux ASMReloadCR3 = \
    247286    "mov eax, cr3" \
     
    250289    modify exact [eax] nomemory;
    251290
     291#undef      ASMGetCR4
    252292#pragma aux ASMGetCR4 = \
    253293    "mov eax, cr4" \
     
    256296    modify exact [eax] nomemory;
    257297
     298#undef      ASMSetCR4
    258299#pragma aux ASMSetCR4 = \
    259300    "mov cr4, eax" \
     
    264305/* ASMSetCR8: Don't bother for 32-bit. */
    265306
     307#undef      ASMIntEnable
    266308#pragma aux ASMIntEnable = \
    267309    "sti" \
     
    269311    modify exact [] nomemory;
    270312
     313#undef      ASMIntDisable
    271314#pragma aux ASMIntDisable = \
    272315    "cli" \
     
    274317    modify exact [] nomemory;
    275318
     319#undef      ASMIntDisableFlags
    276320#pragma aux ASMIntDisableFlags = \
    277321    "pushfd" \
     
    282326    modify exact [] nomemory;
    283327
     328#undef      ASMHalt
    284329#pragma aux ASMHalt = \
    285330    "hlt" \
     
    287332    modify exact [] nomemory;
    288333
     334#undef      ASMRdMsr
    289335#pragma aux ASMRdMsr = \
    290336    ".586" \
     
    294340    modify exact [eax edx] nomemory;
    295341
     342#undef      ASMWrMsr
    296343#pragma aux ASMWrMsr = \
    297344    ".586" \
     
    300347    modify exact [] nomemory;
    301348
     349#undef      ASMRdMsrEx
    302350#pragma aux ASMRdMsrEx = \
    303351    ".586" \
     
    307355    modify exact [eax edx] nomemory;
    308356
     357#undef      ASMWrMsrEx
    309358#pragma aux ASMWrMsrEx = \
    310359    ".586" \
     
    313362    modify exact [] nomemory;
    314363
     364#undef      ASMRdMsr_Low
    315365#pragma aux ASMRdMsr_Low = \
    316366    ".586" \
     
    320370    modify exact [eax edx] nomemory;
    321371
     372#undef      ASMRdMsr_High
    322373#pragma aux ASMRdMsr_High = \
    323374    ".586" \
     
    328379
    329380
     381#undef      ASMGetDR0
    330382#pragma aux ASMGetDR0 = \
    331383    "mov eax, dr0" \
     
    334386    modify exact [eax] nomemory;
    335387
     388#undef      ASMGetDR1
    336389#pragma aux ASMGetDR1 = \
    337390    "mov eax, dr1" \
     
    340393    modify exact [eax] nomemory;
    341394
     395#undef      ASMGetDR2
    342396#pragma aux ASMGetDR2 = \
    343397    "mov eax, dr2" \
     
    346400    modify exact [eax] nomemory;
    347401
     402#undef      ASMGetDR3
    348403#pragma aux ASMGetDR3 = \
    349404    "mov eax, dr3" \
     
    352407    modify exact [eax] nomemory;
    353408
     409#undef      ASMGetDR6
    354410#pragma aux ASMGetDR6 = \
    355411    "mov eax, dr6" \
     
    358414    modify exact [eax] nomemory;
    359415
     416#undef      ASMGetAndClearDR6
    360417#pragma aux ASMGetAndClearDR6 = \
    361418    "mov edx, 0ffff0ff0h" \
     
    366423    modify exact [eax edx] nomemory;
    367424
     425#undef      ASMGetDR7
    368426#pragma aux ASMGetDR7 = \
    369427    "mov eax, dr7" \
     
    372430    modify exact [eax] nomemory;
    373431
     432#undef      ASMSetDR0
    374433#pragma aux ASMSetDR0 = \
    375434    "mov dr0, eax" \
     
    377436    modify exact [] nomemory;
    378437
     438#undef      ASMSetDR1
    379439#pragma aux ASMSetDR1 = \
    380440    "mov dr1, eax" \
     
    382442    modify exact [] nomemory;
    383443
     444#undef      ASMSetDR2
    384445#pragma aux ASMSetDR2 = \
    385446    "mov dr2, eax" \
     
    387448    modify exact [] nomemory;
    388449
     450#undef      ASMSetDR3
    389451#pragma aux ASMSetDR3 = \
    390452    "mov dr3, eax" \
     
    392454    modify exact [] nomemory;
    393455
     456#undef      ASMSetDR6
    394457#pragma aux ASMSetDR6 = \
    395458    "mov dr6, eax" \
     
    397460    modify exact [] nomemory;
    398461
     462#undef      ASMSetDR7
    399463#pragma aux ASMSetDR7 = \
    400464    "mov dr7, eax" \
     
    403467
    404468/* Yeah, could've used outp here, but this keeps the main file simpler. */
     469#undef      ASMOutU8
    405470#pragma aux ASMOutU8 = \
    406471    "out dx, al" \
     
    408473    modify exact [] nomemory;
    409474
     475#undef      ASMInU8
    410476#pragma aux ASMInU8 = \
    411477    "in al, dx" \
     
    414480    modify exact [] nomemory;
    415481
     482#undef      ASMOutU16
    416483#pragma aux ASMOutU16 = \
    417484    "out dx, ax" \
     
    419486    modify exact [] nomemory;
    420487
     488#undef      ASMInU16
    421489#pragma aux ASMInU16 = \
    422490    "in ax, dx" \
     
    425493    modify exact [] nomemory;
    426494
     495#undef      ASMOutU32
    427496#pragma aux ASMOutU32 = \
    428497    "out dx, eax" \
     
    430499    modify exact [] nomemory;
    431500
     501#undef      ASMInU32
    432502#pragma aux ASMInU32 = \
    433503    "in eax, dx" \
     
    436506    modify exact [] nomemory;
    437507
     508#undef      ASMOutStrU8
    438509#pragma aux ASMOutStrU8 = \
    439510    "rep outsb" \
     
    441512    modify exact [esi ecx] nomemory;
    442513
     514#undef      ASMInStrU8
    443515#pragma aux ASMInStrU8 = \
    444516    "rep insb" \
     
    446518    modify exact [edi ecx];
    447519
     520#undef      ASMOutStrU16
    448521#pragma aux ASMOutStrU16 = \
    449522    "rep outsw" \
     
    451524    modify exact [esi ecx] nomemory;
    452525
     526#undef      ASMInStrU16
    453527#pragma aux ASMInStrU16 = \
    454528    "rep insw" \
     
    456530    modify exact [edi ecx];
    457531
     532#undef      ASMOutStrU32
    458533#pragma aux ASMOutStrU32 = \
    459534    "rep outsd" \
     
    461536    modify exact [esi ecx] nomemory;
    462537
     538#undef      ASMInStrU32
    463539#pragma aux ASMInStrU32 = \
    464540    "rep insd" \
     
    466542    modify exact [edi ecx];
    467543
     544#undef      ASMInvalidatePage
    468545#pragma aux ASMInvalidatePage = \
    469546    "invlpg [eax]" \
     
    471548    modify exact [];
    472549
     550#undef      ASMWriteBackAndInvalidateCaches
    473551#pragma aux ASMWriteBackAndInvalidateCaches = \
    474552    ".486" \
     
    477555    modify exact [] nomemory;
    478556
     557#undef      ASMInvalidateInternalCaches
    479558#pragma aux ASMInvalidateInternalCaches = \
    480559    ".486" \
  • trunk/include/iprt/asm-amd64-x86.h

    r58711 r58749  
    7878
    7979
     80/*
     81 * Include #pragma aux definitions for Watcom C/C++.
     82 */
     83#if defined(__WATCOMC__) && ARCH_BITS == 16
     84# include "asm-amd64-x86-watcom-16.h"
     85#elif defined(__WATCOMC__) && ARCH_BITS == 32
     86# include "asm-amd64-x86-watcom-32.h"
     87#endif
     88
    8089
    8190/** @defgroup grp_rt_asm_amd64_x86  AMD64 and x86 Specific ASM Routines
     
    33223331#endif /* !_MSC_VER) || !RT_ARCH_AMD64 */
    33233332
    3324 /*
    3325  * Include #pragma aux definitions for Watcom C/C++.
    3326  */
    3327 #if defined(__WATCOMC__) && ARCH_BITS == 16
    3328 # include "asm-amd64-x86-watcom-16.h"
    3329 #elif defined(__WATCOMC__) && ARCH_BITS == 32
    3330 # include "asm-amd64-x86-watcom-32.h"
    3331 #endif
    3332 
    33333333/** @} */
    33343334#endif
  • trunk/include/iprt/asm-watcom-x86-16.h

    r58710 r58749  
    3838 * seems to insists on loading the DGROUP segment into 'ds' before calling
    3939 * stuff when using -ecc.  Using 'es' instead as this seems to work fine.
     40 *
     41 * Note! The #undef that preceds the #pragma aux statements is for undoing
     42 *       the mangling, because the symbol in #pragma aux [symbol] statements
     43 *       doesn't get subjected to preprocessing.  This is also why we include
     44 *       the watcom header at the top rather than at the bottom of the
     45 *       asm-amd64-x86.h file.
    4046 */
    4147
     48#undef       ASMCompilerBarrier
    4249#if 0 /* overkill version. */
    4350# pragma aux ASMCompilerBarrier = \
     
    5259#endif
    5360
     61#undef      ASMNopPause
    5462#pragma aux ASMNopPause = \
    5563    ".686p" \
     
    5967    modify exact [] nomemory;
    6068
     69#undef      ASMAtomicXchgU8
    6170#pragma aux ASMAtomicXchgU8 = \
    6271    "xchg es:[bx], al" \
     
    6574    modify exact [al];
    6675
     76#undef      ASMAtomicXchgU16
    6777#pragma aux ASMAtomicXchgU16 = \
    6878    "xchg es:[bx], ax" \
     
    7181    modify exact [ax];
    7282
     83#undef      ASMAtomicXchgU32
    7384#pragma aux ASMAtomicXchgU32 = \
    7485    "shl  ecx, 16" \
     
    8192    modify exact [ax cx];
    8293
     94#undef      ASMAtomicXchgU64
    8395#pragma aux ASMAtomicXchgU64 = \
    8496    ".586" \
     
    101113    modify exact [dx cx bx ax];
    102114
     115#undef      ASMAtomicCmpXchgU8
    103116#pragma aux ASMAtomicCmpXchgU8 = \
    104117    ".486" \
     
    109122    modify exact [al];
    110123
     124#undef      ASMAtomicCmpXchgU16
    111125#pragma aux ASMAtomicCmpXchgU16 = \
    112126    ".486" \
     
    117131    modify exact [ax];
    118132
     133#undef      ASMAtomicCmpXchgU32
    119134#pragma aux ASMAtomicCmpXchgU32 = \
    120135    ".486" \
     
    134149/* ASMAtomicCmpXchgExU64: External assembly implementation, too few registers for parameters.  */
    135150
     151#undef      ASMSerializeInstruction
    136152#pragma aux ASMSerializeInstruction = \
    137153    ".586" \
     
    141157    modify exact [ax bx cx dx];
    142158
     159#undef      ASMAtomicReadU64
    143160#pragma aux ASMAtomicReadU64 = \
    144161    ".586" \
     
    157174    modify exact [dx cx bx ax];
    158175
     176#undef      ASMAtomicUoReadU64
    159177#pragma aux ASMAtomicUoReadU64 = \
    160178    ".586" \
     
    173191    modify exact [dx cx bx ax];
    174192
     193#undef      ASMAtomicAddU16
    175194#pragma aux ASMAtomicAddU16 = \
    176195    ".486" \
     
    180199    modify exact [ax];
    181200
     201#undef      ASMAtomicAddU32
    182202#pragma aux ASMAtomicAddU32 = \
    183203    ".486" \
     
    191211    modify exact [ax dx];
    192212
     213#undef      ASMAtomicIncU16
    193214#pragma aux ASMAtomicIncU16 = \
    194215    ".486" \
     
    200221    modify exact [ax];
    201222
     223#undef      ASMAtomicIncU32
    202224#pragma aux ASMAtomicIncU32 = \
    203225    ".486" \
     
    213235/* ASMAtomicIncU64: Should be done by C inline or in external file. */
    214236
     237#undef      ASMAtomicDecU16
    215238#pragma aux ASMAtomicDecU16 = \
    216239    ".486" \
     
    222245    modify exact [ax];
    223246
     247#undef      ASMAtomicDecU32
    224248#pragma aux ASMAtomicDecU32 = \
    225249    ".486" \
     
    235259/* ASMAtomicDecU64: Should be done by C inline or in external file. */
    236260
     261#undef      ASMAtomicOrU32
    237262#pragma aux ASMAtomicOrU32 = \
    238263    "shl edx, 16" \
     
    244269/* ASMAtomicOrU64: Should be done by C inline or in external file. */
    245270
     271#undef      ASMAtomicAndU32
    246272#pragma aux ASMAtomicAndU32 = \
    247273    "shl edx, 16" \
     
    253279/* ASMAtomicAndU64: Should be done by C inline or in external file. */
    254280
     281#undef      ASMAtomicUoOrU32
    255282#pragma aux ASMAtomicUoOrU32 = \
    256283    "shl edx, 16" \
     
    262289/* ASMAtomicUoOrU64: Should be done by C inline or in external file. */
    263290
     291#undef      ASMAtomicUoAndU32
    264292#pragma aux ASMAtomicUoAndU32 = \
    265293    "shl edx, 16" \
     
    271299/* ASMAtomicUoAndU64: Should be done by C inline or in external file. */
    272300
     301#undef      ASMAtomicUoIncU32
    273302#pragma aux ASMAtomicUoIncU32 = \
    274303    ".486" \
     
    282311    modify exact [ax dx];
    283312
     313#undef      ASMAtomicUoDecU32
    284314#pragma aux ASMAtomicUoDecU32 = \
    285315    ".486" \
     
    293323    modify exact [ax dx];
    294324
     325#undef      ASMMemZeroPage
    295326#pragma aux ASMMemZeroPage = \
    296327    "mov ecx, 1024" \
     
    300331    modify exact [ax cx di];
    301332
     333#undef      ASMMemZero32
    302334#pragma aux ASMMemZero32 = \
    303335    "and ecx, 0ffffh" /* probably not necessary, lazy bird should check... */ \
     
    308340    modify exact [ax cx di];
    309341
     342#undef      ASMMemZero32
    310343#pragma aux ASMMemZero32 = \
    311344    "and ecx, 0ffffh" /* probably not necessary, lazy bird should check... */ \
     
    318351    modify exact [ax cx di];
    319352
     353#undef      ASMProbeReadByte
    320354#pragma aux ASMProbeReadByte = \
    321355    "mov al, es:[bx]" \
     
    324358    modify exact [al];
    325359
     360#undef      ASMBitSet
    326361#pragma aux ASMBitSet = \
    327362    "shl edx, 16" \
     
    331366    modify exact [dx];
    332367
     368#undef      ASMAtomicBitSet
    333369#pragma aux ASMAtomicBitSet = \
    334370    "shl edx, 16" \
     
    338374    modify exact [dx];
    339375
     376#undef      ASMBitClear
    340377#pragma aux ASMBitClear = \
    341378    "shl edx, 16" \
     
    345382    modify exact [dx];
    346383
     384#undef      ASMAtomicBitClear
    347385#pragma aux ASMAtomicBitClear = \
    348386    "shl edx, 16" \
     
    352390    modify exact [dx];
    353391
     392#undef      ASMBitToggle
    354393#pragma aux ASMBitToggle = \
    355394    "shl edx, 16" \
     
    359398    modify exact [dx];
    360399
     400#undef      ASMAtomicBitToggle
    361401#pragma aux ASMAtomicBitToggle = \
    362402    "shl edx, 16" \
     
    365405    parm [es bx] [ax dx] \
    366406    modify exact [dx];
    367 ///
    368 ///
     407
     408#undef      ASMBitTestAndSet
    369409#pragma aux ASMBitTestAndSet = \
    370410    "shl edx, 16" \
     
    376416    modify exact [ax dx];
    377417
     418#undef      ASMAtomicBitTestAndSet
    378419#pragma aux ASMAtomicBitTestAndSet = \
    379420    "shl edx, 16" \
     
    385426    modify exact [ax dx];
    386427
     428#undef      ASMBitTestAndClear
    387429#pragma aux ASMBitTestAndClear = \
    388430    "shl edx, 16" \
     
    394436    modify exact [ax dx];
    395437
     438#undef      ASMAtomicBitTestAndClear
    396439#pragma aux ASMAtomicBitTestAndClear = \
    397440    "shl edx, 16" \
     
    403446    modify exact [ax dx];
    404447
     448#undef      ASMBitTestAndToggle
    405449#pragma aux ASMBitTestAndToggle = \
    406450    "shl edx, 16" \
     
    412456    modify exact [ax dx];
    413457
     458#undef      ASMAtomicBitTestAndToggle
    414459#pragma aux ASMAtomicBitTestAndToggle = \
    415460    "shl edx, 16" \
     
    422467
    423468/** @todo this is way to much inline assembly, better off in an external function. */
     469#undef      ASMBitFirstClear
    424470#pragma aux ASMBitFirstClear = \
    425471    "mov bx, di" /* save start of bitmap for later */ \
     
    449495
    450496/** @todo this is way to much inline assembly, better off in an external function. */
     497#undef      ASMBitFirstSet
    451498#pragma aux ASMBitFirstSet = \
    452499    "mov bx, di" /* save start of bitmap for later */ \
     
    475522/* ASMBitNextSet: Too much work, do when needed. */
    476523
     524#undef      ASMBitFirstSetU32
    477525#pragma aux ASMBitFirstSetU32 = \
    478526    "shl edx, 16" \
     
    489537    modify exact [ax dx] nomemory;
    490538
     539#undef      ASMBitLastSetU32
    491540#pragma aux ASMBitLastSetU32 = \
    492541    "shl edx, 16" \
     
    503552    modify exact [ax dx] nomemory;
    504553
     554#undef      ASMByteSwapU16
    505555#pragma aux ASMByteSwapU16 = \
    506556    "ror ax, 8" \
     
    509559    modify exact [ax] nomemory;
    510560
     561#undef      ASMByteSwapU32
    511562#pragma aux ASMByteSwapU32 = \
    512563    "xchg ax, dx" \
     
    515566    modify exact [ax dx] nomemory;
    516567
     568#undef      ASMRotateLeftU32
    517569#pragma aux ASMRotateLeftU32 = \
    518570    "shl    edx, 16" \
     
    525577    modify exact [ax dx] nomemory;
    526578
     579#undef      ASMRotateRightU32
    527580#pragma aux ASMRotateRightU32 = \
    528581    "shl    edx, 16" \
  • trunk/include/iprt/asm-watcom-x86-32.h

    r58709 r58749  
    3535
    3636/*
    37  * Turns out we cannot use 'ds' for segment stuff here because the compiler
    38  * seems to insists on loading the DGROUP segment into 'ds' before calling
    39  * stuff when using -ecc.  Using 'es' instead as this seems to work fine.
     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 the top rather than at the bottom of the
     41 *       asm-amd64-x86.h file.
    4042 */
    4143
     44#undef       ASMCompilerBarrier
    4245#if 0 /* overkill version. */
    4346# pragma aux ASMCompilerBarrier = \
     
    5255#endif
    5356
     57#undef      ASMNopPause
    5458#pragma aux ASMNopPause = \
    5559    ".686p" \
     
    5963    modify exact [] nomemory;
    6064
     65#undef      ASMAtomicXchgU8
    6166#pragma aux ASMAtomicXchgU8 = \
    6267    "xchg [ecx], al" \
     
    6570    modify exact [al];
    6671
     72#undef      ASMAtomicXchgU16
    6773#pragma aux ASMAtomicXchgU16 = \
    6874    "xchg [ecx], ax" \
     
    7177    modify exact [ax];
    7278
     79#undef      ASMAtomicXchgU32
    7380#pragma aux ASMAtomicXchgU32 = \
    7481    "xchg [ecx], eax" \
     
    7784    modify exact [eax];
    7885
     86#undef      ASMAtomicXchgU64
    7987#pragma aux ASMAtomicXchgU64 = \
    8088    ".586" \
     
    8694    modify exact [edx ecx ebx eax];
    8795
     96#undef      ASMAtomicCmpXchgU8
    8897#pragma aux ASMAtomicCmpXchgU8 = \
    8998    ".486" \
     
    94103    modify exact [al];
    95104
     105#undef      ASMAtomicCmpXchgU16
    96106#pragma aux ASMAtomicCmpXchgU16 = \
    97107    ".486" \
     
    102112    modify exact [ax];
    103113
     114#undef      ASMAtomicCmpXchgU32
    104115#pragma aux ASMAtomicCmpXchgU32 = \
    105116    ".486" \
     
    110121    modify exact [eax];
    111122
     123#undef      ASMAtomicCmpXchgU64
    112124#pragma aux ASMAtomicCmpXchgU64 = \
    113125    ".586" \
     
    118130    modify exact [eax edx];
    119131
     132#undef      ASMAtomicCmpXchgExU32
    120133#pragma aux ASMAtomicCmpXchgExU32 = \
    121134    ".586" \
     
    127140    modify exact [eax];
    128141
     142#undef      ASMAtomicCmpXchgExU64
    129143#pragma aux ASMAtomicCmpXchgExU64 = \
    130144    ".586" \
     
    137151    modify exact [eax edx];
    138152
     153#undef      ASMSerializeInstruction
    139154#pragma aux ASMSerializeInstruction = \
    140155    ".586" \
     
    144159    modify exact [eax ebx ecx edx];
    145160
     161#undef      ASMAtomicReadU64
    146162#pragma aux ASMAtomicReadU64 = \
    147163    ".586" \
     
    155171    modify exact [eax ebx ecx edx];
    156172
     173#undef      ASMAtomicUoReadU64
    157174#pragma aux ASMAtomicUoReadU64 = \
    158175    ".586" \
     
    166183    modify exact [eax ebx ecx edx];
    167184
     185#undef      ASMAtomicAddU16
    168186#pragma aux ASMAtomicAddU16 = \
    169187    ".486" \
     
    173191    modify exact [ax];
    174192
     193#undef      ASMAtomicAddU32
    175194#pragma aux ASMAtomicAddU32 = \
    176195    ".486" \
     
    180199    modify exact [eax];
    181200
     201#undef      ASMAtomicIncU16
    182202#pragma aux ASMAtomicIncU16 = \
    183203    ".486" \
     
    189209    modify exact [ax];
    190210
     211#undef      ASMAtomicIncU32
    191212#pragma aux ASMAtomicIncU32 = \
    192213    ".486" \
     
    200221/* ASMAtomicIncU64: Should be done by C inline or in external file. */
    201222
     223#undef      ASMAtomicDecU16
    202224#pragma aux ASMAtomicDecU16 = \
    203225    ".486" \
     
    209231    modify exact [ax];
    210232
     233#undef      ASMAtomicDecU32
    211234#pragma aux ASMAtomicDecU32 = \
    212235    ".486" \
     
    220243/* ASMAtomicDecU64: Should be done by C inline or in external file. */
    221244
     245#undef      ASMAtomicOrU32
    222246#pragma aux ASMAtomicOrU32 = \
    223247    "lock or [ecx], eax" \
     
    227251/* ASMAtomicOrU64: Should be done by C inline or in external file. */
    228252
     253#undef      ASMAtomicAndU32
    229254#pragma aux ASMAtomicAndU32 = \
    230255    "lock and [ecx], eax" \
     
    234259/* ASMAtomicAndU64: Should be done by C inline or in external file. */
    235260
     261#undef      ASMAtomicUoOrU32
    236262#pragma aux ASMAtomicUoOrU32 = \
    237263    "or [ecx], eax" \
     
    241267/* ASMAtomicUoOrU64: Should be done by C inline or in external file. */
    242268
     269#undef      ASMAtomicUoAndU32
    243270#pragma aux ASMAtomicUoAndU32 = \
    244271    "and [ecx], eax" \
     
    248275/* ASMAtomicUoAndU64: Should be done by C inline or in external file. */
    249276
     277#undef      ASMAtomicUoIncU32
    250278#pragma aux ASMAtomicUoIncU32 = \
    251279    ".486" \
     
    256284    modify exact [eax];
    257285
     286#undef      ASMAtomicUoDecU32
    258287#pragma aux ASMAtomicUoDecU32 = \
    259288    ".486" \
     
    265294    modify exact [eax];
    266295
     296#undef      ASMMemZeroPage
    267297#pragma aux ASMMemZeroPage = \
    268298    "mov ecx, 1024" \
     
    272302    modify exact [eax ecx edi];
    273303
     304#undef      ASMMemZero32
    274305#pragma aux ASMMemZero32 = \
    275306    "shr ecx, 2" \
     
    279310    modify exact [eax ecx edi];
    280311
     312#undef      ASMMemZero32
    281313#pragma aux ASMMemZero32 = \
    282314    "shr ecx, 2" \
     
    285317    modify exact [ecx edi];
    286318
     319#undef      ASMProbeReadByte
    287320#pragma aux ASMProbeReadByte = \
    288321    "mov al, [ecx]" \
     
    291324    modify exact [al];
    292325
     326#undef      ASMBitSet
    293327#pragma aux ASMBitSet = \
    294328    "bts [ecx], eax" \
     
    296330    modify exact [];
    297331
     332#undef      ASMAtomicBitSet
    298333#pragma aux ASMAtomicBitSet = \
    299334    "lock bts [ecx], eax" \
     
    301336    modify exact [];
    302337
     338#undef      ASMBitClear
    303339#pragma aux ASMBitClear = \
    304340    "btr [ecx], eax" \
     
    306342    modify exact [];
    307343
     344#undef      ASMAtomicBitClear
    308345#pragma aux ASMAtomicBitClear = \
    309346    "lock btr [ecx], eax" \
     
    311348    modify exact [];
    312349
     350#undef      ASMBitToggle
    313351#pragma aux ASMBitToggle = \
    314352    "btc [ecx], eax" \
     
    316354    modify exact [];
    317355
     356#undef      ASMAtomicBitToggle
    318357#pragma aux ASMAtomicBitToggle = \
    319358    "lock btc [ecx], eax" \
     
    322361
    323362
     363#undef      ASMBitTestAndSet
    324364#pragma aux ASMBitTestAndSet = \
    325365    "bts [ecx], eax" \
     
    329369    modify exact [eax];
    330370
     371#undef      ASMAtomicBitTestAndSet
    331372#pragma aux ASMAtomicBitTestAndSet = \
    332373    "lock bts [ecx], eax" \
     
    336377    modify exact [eax];
    337378
     379#undef      ASMBitTestAndClear
    338380#pragma aux ASMBitTestAndClear = \
    339381    "btr [ecx], eax" \
     
    343385    modify exact [eax];
    344386
     387#undef      ASMAtomicBitTestAndClear
    345388#pragma aux ASMAtomicBitTestAndClear = \
    346389    "lock btr [ecx], eax" \
     
    350393    modify exact [eax];
    351394
     395#undef      ASMBitTestAndToggle
    352396#pragma aux ASMBitTestAndToggle = \
    353397    "btc [ecx], eax" \
     
    357401    modify exact [eax];
    358402
     403#undef      ASMAtomicBitTestAndToggle
    359404#pragma aux ASMAtomicBitTestAndToggle = \
    360405    "lock btc [ecx], eax" \
     
    365410
    366411/** @todo this is way to much inline assembly, better off in an external function. */
     412#undef      ASMBitFirstClear
    367413#pragma aux ASMBitFirstClear = \
    368414    "mov edx, edi" /* save start of bitmap for later */ \
     
    387433
    388434/** @todo this is way to much inline assembly, better off in an external function. */
     435#undef      ASMBitFirstSet
    389436#pragma aux ASMBitFirstSet = \
    390437    "mov edx, edi" /* save start of bitmap for later */ \
     
    408455/* ASMBitNextSet: Too much work, do when needed. */
    409456
     457#undef      ASMBitFirstSetU32
    410458#pragma aux ASMBitFirstSetU32 = \
    411459    "bsf eax, eax" \
     
    420468    modify exact [eax] nomemory;
    421469
     470#undef      ASMBitLastSetU32
    422471#pragma aux ASMBitLastSetU32 = \
    423472    "bsr eax, eax" \
     
    432481    modify exact [eax] nomemory;
    433482
     483#undef      ASMByteSwapU16
    434484#pragma aux ASMByteSwapU16 = \
    435485    "ror ax, 8" \
     
    438488    modify exact [ax] nomemory;
    439489
     490#undef      ASMByteSwapU32
    440491#pragma aux ASMByteSwapU32 = \
    441492    "bswap eax" \
     
    444495    modify exact [eax] nomemory;
    445496
     497#undef      ASMRotateLeftU32
    446498#pragma aux ASMRotateLeftU32 = \
    447499    "rol    eax, cl" \
     
    450502    modify exact [eax] nomemory;
    451503
     504#undef      ASMRotateRightU32
    452505#pragma aux ASMRotateRightU32 = \
    453506    "ror    eax, cl" \
  • trunk/include/iprt/asm.h

    r58718 r58749  
    8282#endif
    8383
     84/*
     85 * Include #pragma aux definitions for Watcom C/C++.
     86 */
     87#if defined(__WATCOMC__) && ARCH_BITS == 16 && defined(RT_ARCH_X86)
     88# include "asm-watcom-x86-16.h"
     89#elif defined(__WATCOMC__) && ARCH_BITS == 32 && defined(RT_ARCH_X86)
     90# include "asm-watcom-x86-32.h"
     91#endif
     92
     93
    8494
    8595/** @defgroup grp_rt_asm    ASM - Assembly Routines
     
    51095119
    51105120
    5111 /*
    5112  * Include #pragma aux definitions for Watcom C/C++.
    5113  */
    5114 #if defined(__WATCOMC__) && ARCH_BITS == 16 && defined(RT_ARCH_X86)
    5115 # include "asm-watcom-x86-16.h"
    5116 #elif defined(__WATCOMC__) && ARCH_BITS == 32 && defined(RT_ARCH_X86)
    5117 # include "asm-watcom-x86-32.h"
    5118 #endif
    5119 
    5120 
    51215121/** @} */
    51225122
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette