VirtualBox

Ignore:
Timestamp:
Nov 18, 2015 7:46:11 PM (9 years ago)
Author:
vboxsync
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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" \
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