VirtualBox

Changeset 59310 in vbox


Ignore:
Timestamp:
Jan 12, 2016 12:55:58 AM (9 years ago)
Author:
vboxsync
Message:

iprt/*.h: 16-bit watcom / DOS adjustments.

Location:
trunk/include/iprt
Files:
4 edited

Legend:

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

    r58749 r59310  
    4848#undef      ASMGetIDTR
    4949#pragma aux ASMGetIDTR = \
     50    ".286p" \
    5051    "sidt fword ptr es:[bx]" \
    5152    parm [es bx] \
     
    5455#undef      ASMGetIdtrLimit
    5556#pragma aux ASMGetIdtrLimit = \
     57    ".286p" \
    5658    "sub  sp, 8" \
    5759    "mov  bx, sp" \
     
    6567#undef      ASMSetIDTR
    6668#pragma aux ASMSetIDTR = \
     69    ".286p" \
    6770    "lidt fword ptr es:[bx]" \
    6871    parm [es bx] nomemory \
     
    7174#undef      ASMGetGDTR
    7275#pragma aux ASMGetGDTR = \
     76    ".286p" \
    7377    "sgdt fword ptr es:[bx]" \
    7478    parm [es bx] \
     
    7781#undef      ASMSetGDTR
    7882#pragma aux ASMSetGDTR = \
     83    ".286p" \
    7984    "lgdt fword ptr es:[bx]" \
    8085    parm [es bx] nomemory \
     
    104109#undef      ASMGetFS
    105110#pragma aux ASMGetFS = \
     111    ".386" \
    106112    "mov ax, fs" \
    107113    parm [] nomemory \
     
    111117#undef      ASMGetGS
    112118#pragma aux ASMGetGS = \
     119    ".386" \
    113120    "mov ax, gs" \
    114121    parm [] nomemory \
     
    125132#undef      ASMGetTR
    126133#pragma aux ASMGetTR = \
     134    ".286" \
    127135    "str ax" \
    128136    parm [] nomemory \
     
    132140#undef      ASMGetLDTR
    133141#pragma aux ASMGetLDTR = \
     142    ".286" \
    134143    "sldt ax" \
    135144    parm [] nomemory \
     
    226235#undef      ASMGetCR0
    227236#pragma aux ASMGetCR0 = \
     237    ".386" \
    228238    "mov eax, cr0" \
    229239    "mov edx, eax" \
     
    235245#undef      ASMSetCR0
    236246#pragma aux ASMSetCR0 = \
     247    ".386" \
    237248    "shl edx, 16" \
    238249    "mov dx, ax" \
     
    243254#undef      ASMGetCR2
    244255#pragma aux ASMGetCR2 = \
     256    ".386" \
    245257    "mov eax, cr2" \
    246258    "mov edx, eax" \
     
    252264#undef      ASMSetCR2
    253265#pragma aux ASMSetCR2 = \
     266    ".386" \
    254267    "shl edx, 16" \
    255268    "mov dx, ax" \
     
    260273#undef      ASMGetCR3
    261274#pragma aux ASMGetCR3 = \
     275    ".386" \
    262276    "mov eax, cr3" \
    263277    "mov edx, eax" \
     
    269283#undef      ASMSetCR3
    270284#pragma aux ASMSetCR3 = \
     285    ".386" \
    271286    "shl edx, 16" \
    272287    "mov dx, ax" \
     
    277292#undef      ASMReloadCR3
    278293#pragma aux ASMReloadCR3 = \
     294    ".386" \
    279295    "mov eax, cr3" \
    280296    "mov cr3, eax" \
     
    284300#undef      ASMGetCR4
    285301#pragma aux ASMGetCR4 = \
     302    ".386" \
    286303    "mov eax, cr4" \
    287304    "mov edx, eax" \
     
    293310#undef      ASMSetCR4
    294311#pragma aux ASMSetCR4 = \
     312    ".386" \
    295313    "shl edx, 16" \
    296314    "mov dx, ax" \
     
    375393#undef      ASMGetDR0
    376394#pragma aux ASMGetDR0 = \
     395    ".386" \
    377396    "mov eax, dr0" \
    378397    "mov edx, eax" \
     
    384403#undef      ASMGetDR1
    385404#pragma aux ASMGetDR1 = \
     405    ".386" \
    386406    "mov eax, dr1" \
    387407    "mov edx, eax" \
     
    393413#undef      ASMGetDR2
    394414#pragma aux ASMGetDR2 = \
     415    ".386" \
    395416    "mov eax, dr2" \
    396417    "mov edx, eax" \
     
    402423#undef      ASMGetDR3
    403424#pragma aux ASMGetDR3 = \
     425    ".386" \
    404426    "mov eax, dr3" \
    405427    "mov edx, eax" \
     
    411433#undef      ASMGetDR6
    412434#pragma aux ASMGetDR6 = \
     435    ".386" \
    413436    "mov eax, dr6" \
    414437    "mov edx, eax" \
     
    420443#undef      ASMGetAndClearDR6
    421444#pragma aux ASMGetAndClearDR6 = \
     445    ".386" \
    422446    "mov edx, 0ffff0ff0h" \
    423447    "mov eax, dr6" \
     
    431455#undef      ASMGetDR7
    432456#pragma aux ASMGetDR7 = \
     457    ".386" \
    433458    "mov eax, dr7" \
    434459    "mov edx, eax" \
     
    440465#undef      ASMSetDR0
    441466#pragma aux ASMSetDR0 = \
     467    ".386" \
    442468    "shl edx, 16" \
    443469    "mov dx, ax" \
     
    448474#undef      ASMSetDR1
    449475#pragma aux ASMSetDR1 = \
     476    ".386" \
    450477    "shl edx, 16" \
    451478    "mov dx, ax" \
     
    456483#undef      ASMSetDR2
    457484#pragma aux ASMSetDR2 = \
     485    ".386" \
    458486    "shl edx, 16" \
    459487    "mov dx, ax" \
     
    464492#undef      ASMSetDR3
    465493#pragma aux ASMSetDR3 = \
     494    ".386" \
    466495    "shl edx, 16" \
    467496    "mov dx, ax" \
     
    472501#undef      ASMSetDR6
    473502#pragma aux ASMSetDR6 = \
     503    ".386" \
    474504    "shl edx, 16" \
    475505    "mov dx, ax" \
     
    480510#undef      ASMSetDR7
    481511#pragma aux ASMSetDR7 = \
     512    ".386" \
    482513    "shl edx, 16" \
    483514    "mov dx, ax" \
     
    516547#undef      ASMOutU32
    517548#pragma aux ASMOutU32 = \
     549    ".386" \
    518550    "shl ecx, 16" \
    519551    "mov cx, ax" \
     
    525557#undef      ASMInU32
    526558#pragma aux ASMInU32 = \
     559    ".386" \
    527560    "in eax, dx" \
    528561    "mov ecx, eax" \
     
    534567#undef      ASMOutStrU8
    535568#pragma aux ASMOutStrU8 = \
     569    ".186" \
    536570    "mov ds, bx" \
    537571    "rep outsb" \
     
    541575#undef      ASMInStrU8
    542576#pragma aux ASMInStrU8 = \
     577    ".186" \
    543578    "rep insb" \
    544579    parm [dx] [es di] [cx] \
     
    547582#undef      ASMOutStrU16
    548583#pragma aux ASMOutStrU16 = \
     584    ".186" \
    549585    "mov ds, bx" \
    550586    "rep outsw" \
     
    554590#undef      ASMInStrU16
    555591#pragma aux ASMInStrU16 = \
     592    ".186" \
    556593    "rep insw" \
    557594    parm [dx] [es di] [cx] \
     
    560597#undef      ASMOutStrU32
    561598#pragma aux ASMOutStrU32 = \
     599    ".386" \
    562600    "mov ds, bx" \
    563601    "rep outsd" \
     
    567605#undef      ASMInStrU32
    568606#pragma aux ASMInStrU32 = \
     607    ".386" \
    569608    "rep insd" \
    570609    parm [dx] [es di] [cx] \
  • trunk/include/iprt/asm-amd64-x86.h

    r58749 r59310  
    12701270 * @returns true if CPUID is supported.
    12711271 */
     1272#ifdef __WATCOMC__
     1273DECLASM(bool) ASMHasCpuId(void);
     1274#else
    12721275DECLINLINE(bool) ASMHasCpuId(void)
    12731276{
    1274 #ifdef RT_ARCH_AMD64
     1277# ifdef RT_ARCH_AMD64
    12751278    return true; /* ASSUME that all amd64 compatible CPUs have cpuid. */
    1276 #else /* !RT_ARCH_AMD64 */
     1279# else /* !RT_ARCH_AMD64 */
    12771280    bool        fRet = false;
    1278 # if RT_INLINE_ASM_GNU_STYLE
     1281#  if RT_INLINE_ASM_GNU_STYLE
    12791282    uint32_t    u1;
    12801283    uint32_t    u2;
     
    12921295             "popf\n\t"
    12931296             : "=m" (fRet), "=r" (u1), "=r" (u2));
    1294 # else
     1297#  else
    12951298    __asm
    12961299    {
     
    13081311        popfd
    13091312    }
    1310 # endif
     1313#  endif
    13111314    return fRet;
    1312 #endif /* !RT_ARCH_AMD64 */
    1313 }
     1315# endif /* !RT_ARCH_AMD64 */
     1316}
     1317#endif
    13141318
    13151319
  • trunk/include/iprt/cdefs.h

    r59002 r59310  
    411411# elif defined(_WIN32) || defined(_WIN64)
    412412#  define RT_OPSYS      RT_OPSYS_WINDOWS
     413# elif defined(MSDOS) || defined(_MSDOS) || defined(DOS16RM) /* OW+MSC || MSC || DMC */
     414#  define RT_OPSYS      RT_OPSYS_DOS
    413415# else
    414416#  error "Port Me"
  • trunk/include/iprt/types.h

    r58704 r59310  
    764764
    765765/** Signed integer which can contain both GC and HC pointers. */
    766 #if (HC_ARCH_BITS == 32 && GC_ARCH_BITS == 32)
     766#if (HC_ARCH_BITS == 32 && GC_ARCH_BITS == 32) || (HC_ARCH_BITS == 16 || GC_ARCH_BITS == 16)
    767767typedef int32_t         RTINTPTR;
    768768#elif (HC_ARCH_BITS == 64 || GC_ARCH_BITS == 64)
     
    776776typedef const RTINTPTR *PCRTINTPTR;
    777777/** The maximum value the RTINTPTR type can hold. */
    778 #if (HC_ARCH_BITS == 32 && GC_ARCH_BITS == 32)
     778#if (HC_ARCH_BITS == 32 && GC_ARCH_BITS == 32) || (HC_ARCH_BITS == 16 || GC_ARCH_BITS == 16)
    779779# define RTINTPTR_MAX   INT32_MAX
    780780#elif (HC_ARCH_BITS == 64 || GC_ARCH_BITS == 64)
     
    784784#endif
    785785/** The minimum value the RTINTPTR type can hold. */
    786 #if (HC_ARCH_BITS == 32 && GC_ARCH_BITS == 32)
     786#if (HC_ARCH_BITS == 32 && GC_ARCH_BITS == 32) || (HC_ARCH_BITS == 16 || GC_ARCH_BITS == 16)
    787787# define RTINTPTR_MIN   INT32_MIN
    788788#elif (HC_ARCH_BITS == 64 || GC_ARCH_BITS == 64)
     
    793793
    794794/** Unsigned integer which can contain both GC and HC pointers. */
    795 #if (HC_ARCH_BITS == 32 && GC_ARCH_BITS == 32)
     795#if (HC_ARCH_BITS == 32 && GC_ARCH_BITS == 32) || (HC_ARCH_BITS == 16 || GC_ARCH_BITS == 16)
    796796typedef uint32_t        RTUINTPTR;
    797797#elif (HC_ARCH_BITS == 64 || GC_ARCH_BITS == 64)
     
    805805typedef const RTUINTPTR *PCRTUINTPTR;
    806806/** The maximum value the RTUINTPTR type can hold. */
    807 #if (HC_ARCH_BITS == 32 && GC_ARCH_BITS == 32)
     807#if (HC_ARCH_BITS == 32 && GC_ARCH_BITS == 32) || (HC_ARCH_BITS == 16 || GC_ARCH_BITS == 16)
    808808# define RTUINTPTR_MAX  UINT32_MAX
    809809#elif (HC_ARCH_BITS == 64 || GC_ARCH_BITS == 64)
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