VirtualBox

Changeset 3672 in vbox for trunk


Ignore:
Timestamp:
Jul 17, 2007 12:39:30 PM (17 years ago)
Author:
vboxsync
Message:

RT_OS_* and RT_ARCH_* for Runtime/ and Support/

Location:
trunk/src/VBox
Files:
100 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/SUPDRV.h

    r3621 r3672  
    4141
    4242
    43 #if defined(__WIN__)
     43#if defined(RT_OS_WINDOWS)
    4444    __BEGIN_DECLS
    4545#   if (_MSC_VER >= 1400) && !defined(VBOX_WITH_PATCHED_DDK)
     
    6161    __END_DECLS
    6262
    63 #elif defined(__LINUX__)
     63#elif defined(RT_OS_LINUX)
    6464#   include <linux/autoconf.h>
    6565#   include <linux/version.h>
     
    8686#   include <linux/timer.h>
    8787
    88 #elif defined(__DARWIN__)
     88#elif defined(RT_OS_DARWIN)
    8989#   include <libkern/libkern.h>
    9090#   include <iprt/string.h>
    9191
    92 #elif defined(__OS2__)
    93 
    94 #elif defined(__FREEBSD__)
     92#elif defined(RT_OS_OS2)
     93
     94#elif defined(RT_OS_FREEBSD)
    9595#   include <sys/libkern.h>
    9696#   include <iprt/string.h>
     
    117117 * Win32
    118118 */
    119 #if defined(__WIN__)
     119#if defined(RT_OS_WINDOWS)
    120120
    121121/* debug printf */
     
    126126 * to actually be much lower. The values here have been determined experimentally.
    127127 */
    128 #ifdef __X86__
     128#ifdef RT_ARCH_X86
    129129# define MAX_LOCK_MEM_SIZE   (32*1024*1024) /* 32mb */
    130130#endif
    131 #ifdef __AMD64__
     131#ifdef RT_ARCH_AMD64
    132132# define MAX_LOCK_MEM_SIZE   (24*1024*1024) /* 24mb */
    133133#endif
     
    137137 * Linux
    138138 */
    139 #elif defined(__LINUX__)
     139#elif defined(RT_OS_LINUX)
    140140
    141141/* check kernel version */
     
    155155 * Darwin
    156156 */
    157 #elif defined(__DARWIN__)
     157#elif defined(RT_OS_DARWIN)
    158158
    159159/* debug printf */
     
    164164 * OS/2
    165165 */
    166 #elif defined(__OS2__)
     166#elif defined(RT_OS_OS2)
    167167
    168168/* No log API in OS/2 only COM port. */
     
    173173 * FreeBSD
    174174 */
    175 #elif defined(__FREEBSD__)
     175#elif defined(RT_OS_FREEBSD)
    176176
    177177/* No log API in OS/2 only COM port. */
     
    198198
    199199/* dprintf2 - extended logging. */
    200 #if defined(__DARWIN__) || defined(__OS2__)
     200#if defined(RT_OS_DARWIN) || defined(RT_OS_OS2)
    201201# define dprintf2 dprintf
    202202#else
     
    250250    /** Segment Selector. */
    251251    uint32_t    u16SegSel : 16;
    252 #ifdef __AMD64__
     252#ifdef RT_ARCH_AMD64
    253253    /** Interrupt Stack Table index. */
    254254    uint32_t    u3IST : 3;
     
    269269    /** High offset word. */
    270270    uint32_t    u16OffsetHigh : 16;
    271 #ifdef __AMD64__
     271#ifdef RT_ARCH_AMD64
    272272    /** The upper top part of the address. */
    273273    uint32_t    u32OffsetTop;
     
    381381        struct
    382382        {
    383 #if defined(__WIN__)
     383#if defined(RT_OS_WINDOWS)
    384384            /** Pointer to memory descriptor list (MDL). */
    385385            PMDL               *papMdl;
    386386            unsigned            cMdls;
    387 #elif defined(__LINUX__)
     387#elif defined(RT_OS_LINUX)
    388388            struct page       **papPages;
    389389            unsigned            cPages;
     
    394394        struct
    395395        {
    396 #if defined(__WIN__)
     396#if defined(RT_OS_WINDOWS)
    397397            /** Pointer to memory descriptor list (MDL). */
    398398            PMDL                pMdl;
    399 #elif defined(__LINUX__)
     399#elif defined(RT_OS_LINUX)
    400400            struct page        *paPages;
    401401            unsigned            cPages;
     
    406406        struct
    407407        {
    408 #if defined(__WIN__)
     408#if defined(RT_OS_WINDOWS)
    409409            /** Pointer to memory descriptor list (MDL). */
    410410            PMDL                pMdl;
    411 #elif defined(__LINUX__)
     411#elif defined(RT_OS_LINUX)
    412412            /** Pointer to the array of page pointers. */
    413413            struct page       **papPages;
     
    572572    /** Which process this session is associated with. */
    573573    RTR0PROCESS                 R0Process;
    574 #if defined(__OS2__)
     574#if defined(RT_OS_OS2)
    575575    /** The system file number of this session. */
    576576    uint16_t                    sfn;
    577577    uint16_t                    Alignment; /**< Alignment */
    578578#endif
    579 #if defined(__DARWIN__) || defined(__OS2__)
     579#if defined(RT_OS_DARWIN) || defined(RT_OS_OS2)
    580580    /** Pointer to the next session with the same hash. */
    581581    PSUPDRVSESSION              pNextHash;
     
    644644    uint32_t                u32SystemTimerGranularityGrant;
    645645#endif
    646 #ifdef __WIN__
     646#ifdef RT_OS_WINDOWS
    647647    /** The GIP timer object. */
    648648    KTIMER                  GipTimer;
     
    656656    ULONG                   ulGipTimerInterval;
    657657#endif
    658 #ifdef __LINUX__
     658#ifdef RT_OS_LINUX
    659659    /** The last jiffies. */
    660660    unsigned long           ulLastJiffies;
  • trunk/src/VBox/HostDrivers/Support/SUPDRVIOC.h

    r3537 r3672  
    3434 * and 64-bit processes.
    3535 */
    36 #ifdef __AMD64__
     36#ifdef RT_ARCH_AMD64
    3737# define SUP_IOCTL_FLAG     128
    38 #elif defined(__X86__)
     38#elif defined(RT_ARCH_X86)
    3939# define SUP_IOCTL_FLAG     0
    4040#else
     
    4242#endif
    4343
    44 #ifdef __WIN__
     44#ifdef RT_OS_WINDOWS
    4545# define SUP_CTL_CODE(Function)         CTL_CODE(FILE_DEVICE_UNKNOWN, (Function) | SUP_IOCTL_FLAG, METHOD_BUFFERED, FILE_WRITE_ACCESS)
    4646# define SUP_CTL_CODE_FAST(Function)    CTL_CODE(FILE_DEVICE_UNKNOWN, (Function) | SUP_IOCTL_FLAG, METHOD_NEITHER, FILE_WRITE_ACCESS)
     
    6464# endif
    6565
    66 #elif defined(__OS2__)
     66#elif defined(RT_OS_OS2)
    6767# define SUP_CTL_CATEGORY               0xc0
    6868# define SUP_CTL_CODE(Function)         ((unsigned char)(Function))
     
    7070# define SUP_CTL_CODE_FAST(Function)    ((unsigned char)(Function))
    7171
    72 #elif defined(__LINUX__)
    73 # ifdef __X86__ /** @todo With the next major version change, drop this branch. */
     72#elif defined(RT_OS_LINUX)
     73# ifdef RT_ARCH_X86 /** @todo With the next major version change, drop this branch. */
    7474#  define SUP_CTL_CODE(Function) \
    7575    ( (3U << 30) | ((0x22) << 8) | ((Function) | SUP_IOCTL_FLAG) | (sizeof(SUPDRVIOCTLDATA) << 16) )
     
    8787# endif
    8888
    89 #elif defined(__L4__)
     89#elif defined(RT_OS_L4)
    9090# define SUP_CTL_CODE(Function) \
    9191    ( (3U << 30) | ((0x22) << 8) | ((Function) | SUP_IOCTL_FLAG) | (sizeof(SUPDRVIOCTLDATA) << 16) )
     
    150150*   Structures and Typedefs                                                    *
    151151*******************************************************************************/
    152 #ifdef __AMD64__
     152#ifdef RT_ARCH_AMD64
    153153# pragma pack(8)                        /* paranoia. */
    154154#else
     
    156156#endif
    157157
    158 #ifndef __WIN__
     158#ifndef RT_OS_WINDOWS
    159159/**
    160160 * Structure used by OSes with less advanced ioctl interfaces, i.e. most
     
    167167    void           *pvOut;
    168168    unsigned long   cbOut;
    169 #ifdef __OS2__
     169#ifdef RT_OS_OS2
    170170    int             rc;
    171171#endif
  • trunk/src/VBox/HostDrivers/Support/SUPDRVShared.c

    r3537 r3672  
    260260    /* objects. */
    261261    pObj = pDevExt->pObjs;
    262 #if !defined(DEBUG_bird) || !defined(__LINUX__) /* breaks unloading, temporary, remove me! */
     262#if !defined(DEBUG_bird) || !defined(RT_OS_LINUX) /* breaks unloading, temporary, remove me! */
    263263    Assert(!pObj);                      /* (can trigger on forced unloads) */
    264264#endif
     
    27622762        static uint8_t au8Ints[] =
    27632763        {
    2764 #ifdef __WIN__   /* We don't use 0xef and above because they are system stuff on linux (ef is IPI,
     2764#ifdef RT_OS_WINDOWS   /* We don't use 0xef and above because they are system stuff on linux (ef is IPI,
    27652765                  * local apic timer, or some other frequently fireing thing). */
    27662766            0xef, 0xee, 0xed, 0xec,
     
    27712771            0xbf, 0xbe, 0xbd, 0xbc,
    27722772        };
    2773 #if defined(__AMD64__) && defined(DEBUG)
     2773#if defined(RT_ARCH_AMD64) && defined(DEBUG)
    27742774        static int  s_iWobble = 0;
    27752775        unsigned    iMax = !(s_iWobble++ % 2) ? 0x80 : 0x100;
     
    28262826    pPatch->ChangedIdt.u16OffsetLow     = (uint32_t)((uintptr_t)&pPatch->auCode[0] & 0xffff);
    28272827    pPatch->ChangedIdt.u16OffsetHigh    = (uint32_t)((uintptr_t)&pPatch->auCode[0] >> 16);
    2828 #ifdef __AMD64__
     2828#ifdef RT_ARCH_AMD64
    28292829    pPatch->ChangedIdt.u32OffsetTop     = (uint32_t)((uintptr_t)&pPatch->auCode[0] >> 32);
    28302830#endif
    28312831    pPatch->ChangedIdt.u16SegSel        = ASMGetCS();
    2832 #ifdef __AMD64__
     2832#ifdef RT_ARCH_AMD64
    28332833    pPatch->ChangedIdt.u3IST            = 0;
    28342834    pPatch->ChangedIdt.u5Reserved       = 0;
     
    28452845     */
    28462846  {
    2847 #ifdef __AMD64__
     2847#ifdef RT_ARCH_AMD64
    28482848    union
    28492849    {
     
    28762876     *      reserve some stack space for the interrupt forwarding.
    28772877     */
    2878 # ifdef __WIN__
     2878# ifdef RT_OS_WINDOWS
    28792879    *u.pb++ = 0x50;                     //  push    rax                             ; alignment filler.
    28802880    *u.pb++ = 0x41;                     //  push    r8                              ; uArg
     
    29502950    *u.pb++ = 0xcb;
    29512951
    2952 #else /* __X86__ */
     2952#else /* RT_ARCH_X86 */
    29532953
    29542954    union
     
    30013001    *u.pb++ = 0xc0;
    30023002
    3003 #ifdef __WIN__
     3003#ifdef RT_OS_WINDOWS
    30043004    *u.pb++ = 0xb8;                     //  mov     eax, KernelFS
    30053005    *u.pu32++ = ASMGetFS();
     
    30563056        *uFixJmpNotNested.pu16++ = pPatch->SavedIdt.u16SegSel;
    30573057    }
    3058 #endif /* __X86__ */
     3058#endif /* RT_ARCH_X86 */
    30593059    Assert(u.pb <= &pPatch->auCode[sizeof(pPatch->auCode)]);
    30603060#if 0
     
    32343234
    32353235    /* Update IDT Entry */
    3236 #ifdef __AMD64__
     3236#ifdef RT_ARCH_AMD64
    32373237    ASMAtomicXchgU128((volatile uint128_t *)pvIdtEntry, *(uint128_t *)(uintptr_t)pNewIDTEntry);
    32383238#else
     
    36293629        for (pPatch = pDevExt->pIdtPatches; pPatch; pPatch = pPatch->pNext)
    36303630        {
    3631 # ifdef __AMD64__
     3631# ifdef RT_ARCH_AMD64
    36323632            ASMAtomicXchgU64((volatile uint64_t *)&pPatch->auCode[pPatch->offVMMR0EntryFixup], (uint64_t)pvVMMR0);
    3633 # else /* __X86__ */
     3633# else /* RT_ARCH_X86 */
    36343634            ASMAtomicXchgU32((volatile uint32_t *)&pPatch->auCode[pPatch->offVMMR0EntryFixup],
    36353635                             (uint32_t)pvVMMR0 - (uint32_t)&pPatch->auCode[pPatch->offVMMR0EntryFixup + 4]);
     
    36723672    for (pPatch = pDevExt->pIdtPatches; pPatch; pPatch = pPatch->pNext)
    36733673    {
    3674 # ifdef __AMD64__
     3674# ifdef RT_ARCH_AMD64
    36753675        ASMAtomicXchgU64((volatile uint64_t *)&pPatch->auCode[pPatch->offVMMR0EntryFixup],
    36763676                         (uint64_t)&pPatch->auCode[pPatch->offStub]);
    3677 # else /* __X86__ */
     3677# else /* RT_ARCH_X86 */
    36783678        ASMAtomicXchgU32((volatile uint32_t *)&pPatch->auCode[pPatch->offVMMR0EntryFixup],
    36793679                         (uint32_t)&pPatch->auCode[pPatch->offStub] - (uint32_t)&pPatch->auCode[pPatch->offVMMR0EntryFixup + 4]);
     
    42984298        if (pGip->u64NanoTSLastUpdateHz)
    42994299        {
    4300 #ifdef __AMD64__ /** @todo fix 64-bit div here to work on x86 linux. */
     4300#ifdef RT_ARCH_AMD64 /** @todo fix 64-bit div here to work on x86 linux. */
    43014301            uint64_t u64Delta = u64NanoTS - pGip->u64NanoTSLastUpdateHz;
    43024302            uint32_t u32UpdateHz = (uint32_t)((UINT64_C(1000000000) * GIP_UPDATEHZ_RECALC_FREQ) / u64Delta);
  • trunk/src/VBox/HostDrivers/Support/SUPLib.cpp

    r3537 r3672  
    807807     * Generate the code.
    808808     */
    809 #ifdef __AMD64__
     809#ifdef RT_ARCH_AMD64
    810810    /*
    811811     * reg params:
  • trunk/src/VBox/HostDrivers/Support/linux/Makefile

    r3400 r3672  
    123123 export INCL
    124124endif
    125 KFLAGS   := -D__KERNEL__ -DMODULE -D__LINUX__ -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0
     125KFLAGS   := -D__KERNEL__ -DMODULE -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0
    126126ifndef CONFIG_VBOXDRV_FIXEDMAJOR
    127127 KFLAGS  += -DCONFIG_VBOXDRV_AS_MISC
    128128endif
    129129ifeq ($(BUILD_TARGET_ARCH),amd64)
    130  KFLAGS  += -D__AMD64__
     130 KFLAGS  += -DRT_ARCH_AMD64
    131131else
    132  KFLAGS  += -D__X86__
     132 KFLAGS  += -DRT_ARCH_X86
    133133endif
    134134#ifeq ($(BUILD_TYPE),debug) - you'll have to enable this manually to get debug stuff.
  • trunk/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c

    r3393 r3672  
    121121 * This sucks soooo badly on x86! Why don't they export __PAGE_KERNEL_EXEC so PAGE_KERNEL_EXEC would be usable?
    122122 */
    123 #if defined(__AMD64__)
     123#if defined(RT_ARCH_AMD64)
    124124# define MY_PAGE_KERNEL_EXEC    PAGE_KERNEL_EXEC
    125125#elif defined(PAGE_KERNEL_EXEC) && defined(CONFIG_X86_PAE)
     
    149149# endif
    150150
    151 # ifndef __AMD64__
     151# ifndef RT_ARCH_AMD64
    152152/* In 2.6.9-22.ELsmp we have to call change_page_attr() twice when changing
    153153 * the page attributes from PAGE_KERNEL to something else, because there appears
     
    170170
    171171#ifndef MY_CHANGE_PAGE_ATTR
    172 # ifdef __AMD64__ /** @todo This is a cheap hack, but it'll get around that 'else BUG();' in __change_page_attr().  */
     172# ifdef RT_ARCH_AMD64 /** @todo This is a cheap hack, but it'll get around that 'else BUG();' in __change_page_attr().  */
    173173#  define MY_CHANGE_PAGE_ATTR(pPages, cPages, prot) \
    174174    do { \
     
    205205 *                    and disabled on i386.
    206206 */
    207 # if defined(__AMD64__)
     207# if defined(RT_ARCH_AMD64)
    208208#  if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 21)
    209209#   define DO_DISABLE_NMI 1
     
    267267#define DEVICE_NAME    "vboxdrv"
    268268
    269 #ifdef __AMD64__
     269#ifdef RT_ARCH_AMD64
    270270/**
    271271 * Memory for the executable memory heap (in IPRT).
     
    608608        if (RT_SUCCESS(rc))
    609609        {
    610 #ifdef __AMD64__
     610#ifdef RT_ARCH_AMD64
    611611            rc = RTR0MemExecDonate(&g_abExecMemory[0], sizeof(g_abExecMemory));
    612612#endif
     
    10251025     * Allocate page pointer array.
    10261026     */
    1027 #ifdef __AMD64__ /** @todo check out if there is a correct way of getting memory below 4GB (physically). */
     1027#ifdef RT_ARCH_AMD64 /** @todo check out if there is a correct way of getting memory below 4GB (physically). */
    10281028    paPages = alloc_pages(GFP_DMA, cOrder);
    10291029#else
  • trunk/src/VBox/HostDrivers/Support/win/SUPDrv-win.cpp

    r3542 r3672  
    4949*   Structures and Typedefs                                                    *
    5050*******************************************************************************/
    51 #if 0 //def __AMD64__
     51#if 0 //def RT_ARCH_AMD64
    5252typedef struct SUPDRVEXECMEM
    5353{
     
    328328             pStack->Parameters.DeviceIoControl.OutputBufferLength, pSession));
    329329
    330 #ifdef __AMD64__
     330#ifdef RT_ARCH_AMD64
    331331    /* Don't allow 32-bit processes to do any I/O controls. */
    332332    if (!IoIs32bitProcess(pIrp))
     
    360360                     pStack->Parameters.DeviceIoControl.IoControlCode));
    361361    }
    362 #ifdef __AMD64__
     362#ifdef RT_ARCH_AMD64
    363363    else
    364364        dprintf(("VBoxSupDrvDeviceControlSlow: WOW64 req - not supported\n"));
     
    613613                 * Done, setup pMem and return values.
    614614                 */
    615 #ifdef __AMD64__
     615#ifdef RT_ARCH_AMD64
    616616                 MmProtectMdlSystemAddress(pMem->u.cont.pMdl, PAGE_EXECUTE_READWRITE);
    617617#endif
     
    10691069    dprintf2(("supdrvOSGipSuspend:\n"));
    10701070    KeCancelTimer(&pDevExt->GipTimer);
    1071 #ifdef __AMD64__
     1071#ifdef RT_ARCH_AMD64
    10721072    ExSetTimerResolution(0, FALSE);
    10731073#endif
     
    10841084void *VBOXCALL  supdrvOSExecAlloc(size_t cb)
    10851085{
    1086 #if 0 //def __AMD64__
     1086#if 0 //def RT_ARCH_AMD64
    10871087    cb = RT_ALIGN_Z(cb, PAGE_SIZE);
    10881088    void *pv = ExAllocatePoolWithTag(NonPagedPool, cb, SUPDRV_NT_POOL_TAG);
  • trunk/src/VBox/HostDrivers/Support/win/SUPDrvA-win.asm

    r3542 r3672  
    2626
    2727BEGINCODE
    28 %ifdef __AMD64__
     28%ifdef RT_ARCH_AMD64
    2929%define _DbgPrint DbgPrint
    3030%endif
  • trunk/src/VBox/Runtime/RTErrConvertFromErrno.cpp

    r2981 r3672  
    2828#include <iprt/err.h>
    2929
    30 #if defined(__DARWIN__) && defined(KERNEL)
     30#if defined(RT_OS_DARWIN) && defined(KERNEL)
    3131# include <sys/errno.h>
    3232#else
  • trunk/src/VBox/Runtime/VBox/RTAssertDoBreakpoint-vbox.cpp

    r2981 r3672  
    3333#if !defined(VBOX_RTASSERT_WITH_GDB) \
    3434    && !defined(IN_GUEST) \
    35     && ((!defined(__OS2__) && !defined(__WIN__)) || defined(__DOXGYEN__))
     35    && ((!defined(RT_OS_OS2) && !defined(RT_OS_WINDOWS)) || defined(__DOXGYEN__))
    3636# define VBOX_ASSERT_WITH_GDB
    3737#endif
  • trunk/src/VBox/Runtime/VBox/log-vbox.cpp

    r2981 r3672  
    124124*******************************************************************************/
    125125#ifdef IN_RING3
    126 # if defined(__WIN__)
     126# if defined(RT_OS_WINDOWS)
    127127#  include <Windows.h>
    128 # elif defined(__LINUX__)
     128# elif defined(RT_OS_LINUX)
    129129#  include <unistd.h>
    130 # elif defined(__L4__)
     130# elif defined(RT_OS_L4)
    131131#  include <l4/vboxserver/vboxserver.h>
    132 # elif defined(__OS2__)
     132# elif defined(RT_OS_OS2)
    133133#  include <stdlib.h>
    134134# endif
     
    297297
    298298        /* executable and arguments - tricky and all platform specific. */
    299 # if defined(__WIN__)
     299# if defined(RT_OS_WINDOWS)
    300300        RTLogLoggerEx(pLogger, 0, ~0U, "Commandline: %ls\n", GetCommandLineW());
    301301
    302 # elif defined(__LINUX__) || defined(__FREEBSD__)
    303 #  ifdef __LINUX__
     302# elif defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD)
     303#  ifdef RT_OS_LINUX
    304304        FILE *pFile = fopen("/proc/self/cmdline", "r");
    305305#  else       
     
    332332        }
    333333
    334 # elif defined(__L4__) || defined(__OS2__) || defined(__DARWIN__)
     334# elif defined(RT_OS_L4) || defined(RT_OS_OS2) || defined(RT_OS_DARWIN)
    335335        /* commandline? */
    336336# else
  • trunk/src/VBox/Runtime/dir.cpp

    r3364 r3672  
    2525*******************************************************************************/
    2626#define LOG_GROUP RTLOGGROUP_DIR
    27 #ifdef __WIN__
     27#ifdef RT_OS_WINDOWS
    2828# include <Windows.h>
    2929#else
     
    7171    /* skip the root slash if any */
    7272    if (    psz[0] == '/'
    73 #if defined(__WIN__) || defined(__OS2__)
     73#if defined(RT_OS_WINDOWS) || defined(RT_OS_OS2)
    7474        ||  psz[0] == '\\'
    7575#endif
     
    8383        if (!*psz)
    8484            break;
    85 #if defined(__WIN__) || defined(__OS2__)
     85#if defined(RT_OS_WINDOWS) || defined(RT_OS_OS2)
    8686        psz = strpbrk(psz, "\\/");
    8787#else
  • trunk/src/VBox/Runtime/errmsg.cpp

    r2981 r3672  
    9191     */
    9292    int iMsg = ASMAtomicXchgU32(&g_iUnknownMsgs, (g_iUnknownMsgs + 1) % ELEMENTS(g_aUnknownMsgs));
    93     RTStrPrintf(&g_aszUnknownStr[iMsg][0], sizeof(g_aszUnknownStr[iMsg]), "Unknown Status %d\n", rc);
     93    RTStrPrintf(&g_aszUnknownStr[iMsg][0], sizeof(g_aszUnknownStr[iMsg]), "Unknown Status 0x%X\n", rc);
    9494    return &g_aUnknownMsgs[iMsg];
    9595}
  • trunk/src/VBox/Runtime/fs.cpp

    r2981 r3672  
    2424*   Header Files                                                               *
    2525*******************************************************************************/
    26 #ifndef __WIN__
     26#ifndef RT_OS_WINDOWS
    2727# define RTTIME_INCL_TIMESPEC
    2828# include <sys/time.h>
     
    169169
    170170
    171 #ifndef __WIN__
     171#ifndef RT_OS_WINDOWS
    172172/**
    173173 * Internal worker function which setups RTFSOBJINFO based on a UNIX stat struct.
     
    275275}
    276276
    277 #endif /* !__WIN__ */
     277#endif /* !RT_OS_WINDOWS */
  • trunk/src/VBox/Runtime/generic/RTDirQueryInfo-generic.cpp

    r2981 r3672  
    2626*******************************************************************************/
    2727#define LOG_GROUP RTLOGGROUP_DIR
    28 #ifdef __WIN__ /* dir.h has host specific stuff */
     28#ifdef RT_OS_WINDOWS /* dir.h has host specific stuff */
    2929# include <Windows.h>
    3030#else
  • trunk/src/VBox/Runtime/generic/RTDirSetTimes-generic.cpp

    r2981 r3672  
    2626*******************************************************************************/
    2727#define LOG_GROUP RTLOGGROUP_DIR
    28 #ifdef __WIN__ /* dir.h has host specific stuff */
     28#ifdef RT_OS_WINDOWS /* dir.h has host specific stuff */
    2929# include <Windows.h>
    3030#else
  • trunk/src/VBox/Runtime/generic/critsect-generic.cpp

    r2981 r3672  
    3838 *          protected by a critsect atm.
    3939 */
    40 #if !defined(RTCRITSECT_STRICT) && defined(RT_STRICT) && !defined(__L4ENV__)
     40#if !defined(RTCRITSECT_STRICT) && defined(RT_STRICT) && !defined(RT_OS_L4)
    4141# define RTCRITSECT_STRICT
    4242#endif
  • trunk/src/VBox/Runtime/generic/semrw-generic.cpp

    r1 r3672  
    2424*   Header Files                                                               *
    2525*******************************************************************************/
    26 #if defined(__WIN__)
     26#if defined(RT_OS_WINDOWS)
    2727# include <windows.h>
    2828# include <psapi.h>
     
    3535# endif
    3636
    37 #elif defined(__LINUX__) || defined(__FREEBSD__)
     37#elif defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD)
    3838# define KPRF_USE_PTHREAD
    3939# include <pthread.h>
     
    4848# endif
    4949
    50 #elif defined(__OS2__)
     50#elif defined(RT_OS_OS2)
    5151# define INCL_BASE
    5252# include <os2s.h>
     
    6464#define KPRF_NAME(Suffix)               KPrf##Suffix
    6565#define KPRF_TYPE(Prefix,Suffix)        Prefix##KPRF##Suffix
    66 #if defined(__OS2__) || defined(__WIN__)
     66#if defined(RT_OS_OS2) || defined(RT_OS_WINDOWS)
    6767# define KPRF_DECL_FUNC(type, name)     extern "C"  __declspec(dllexport) type __cdecl KPRF_NAME(name)
    6868#else
     
    9090#if defined(KPRF_USE_PTHREAD)
    9191typedef pthread_mutex_t     KPRF_TYPE(,MUTEX);
    92 #elif defined(__WIN__)
     92#elif defined(RT_OS_WINDOWS)
    9393typedef CRITICAL_SECTION    KPRF_TYPE(,MUTEX);
    94 #elif defined(__OS2__)
     94#elif defined(RT_OS_OS2)
    9595typedef struct _fmutex      KPRF_TYPE(,MUTEX);
    9696#endif
     
    102102/** Read/Write lock type. */
    103103typedef pthread_rwlock_t    KPRF_TYPE(,RWLOCK);
    104 #elif defined(__OS2__) || defined(__WIN__)
     104#elif defined(RT_OS_OS2) || defined(RT_OS_WINDOWS)
    105105/** Read/Write lock state. */
    106106typedef enum KPRF_TYPE(,RWLOCKSTATE)
     
    128128    /** The current number of waiting writers. */
    129129    uint32_t                cWritersWaiting;
    130 # if defined(__WIN__)
     130# if defined(RT_OS_WINDOWS)
    131131    /** The handle of the event object on which the waiting readers block. (manual reset). */
    132132    HANDLE                  hevReaders;
    133133    /** The handle of the event object on which the waiting writers block. (manual reset). */
    134134    HANDLE                  hevWriters;
    135 # elif defined(__OS2__)
     135# elif defined(RT_OS_OS2)
    136136    /** The handle of the event semaphore on which the waiting readers block. */
    137137    HEV                     hevReaders;
     
    162162    return -1;
    163163
    164 #elif defined(__WIN__)
     164#elif defined(RT_OS_WINDOWS)
    165165    InitializeCriticalSection(pMutex);
    166166    return 0;
    167167
    168 #elif defined(__OS2__)
     168#elif defined(RT_OS_OS2)
    169169    if (!_fmutex_create(pMutex, 0))
    170170        return 0;
     
    183183    pthread_mutex_destroy(pMutex);
    184184
    185 #elif defined(__WIN__)
     185#elif defined(RT_OS_WINDOWS)
    186186    DeleteCriticalSection(pMutex);
    187187
    188 #elif defined(__OS2__)
     188#elif defined(RT_OS_OS2)
    189189    _fmutex_close(pMutex);
    190190#endif
     
    197197static inline void kPrfMutexAcquire(KPRF_TYPE(P,MUTEX) pMutex)
    198198{
    199 #if defined(__WIN__)
     199#if defined(RT_OS_WINDOWS)
    200200    EnterCriticalSection(pMutex);
    201201
     
    203203    pthread_mutex_lock(pMutex);
    204204
    205 #elif defined(__OS2__)
     205#elif defined(RT_OS_OS2)
    206206    fmutex_request(pMutex);
    207207#endif
     
    215215static inline void kPrfMutexRelease(KPRF_TYPE(P,MUTEX) pMutex)
    216216{
    217 #if defined(__WIN__)
     217#if defined(RT_OS_WINDOWS)
    218218    LeaveCriticalSection(pMutex);
    219219
     
    221221    pthread_mutex_lock(pMutex);
    222222
    223 #elif defined(__OS2__)
     223#elif defined(RT_OS_OS2)
    224224    fmutex_request(pMutex);
    225225#endif
     
    242242    return -1;
    243243
    244 #elif defined(__WIN__) || defined(__OS2__)
     244#elif defined(RT_OS_WINDOWS) || defined(RT_OS_OS2)
    245245    if (kPrfMutexInit(&pRWLock->Mutex))
    246246        return -1;
     
    249249    pRWLock->cWritersWaiting = 0;
    250250    pRWLock->enmState = RWLOCK_STATE_SHARED;
    251 # if defined(__WIN__)
     251# if defined(RT_OS_WINDOWS)
    252252    pRWLock->hevReaders = CreateEvent(NULL, TRUE, TRUE, NULL);
    253253    pRWLock->hevWriters = CreateEvent(NULL, FALSE, FALSE, NULL);
     
    258258    CloseHandle(pRWLock->hevWriters);
    259259
    260 # elif defined(__OS2__)
     260# elif defined(RT_OS_OS2)
    261261    APIRET rc = DosCreateEventSem(NULL, &pRWLock->hevReaders, 0, TRUE);
    262262    if (!rc)
     
    288288    pthread_rwlock_destroy(pRWLock);
    289289
    290 #elif defined(__WIN__) || defined(__OS2__)
     290#elif defined(RT_OS_WINDOWS) || defined(RT_OS_OS2)
    291291    if (pRWLock->enmState == RWLOCK_STATE_UNINITIALIZED)
    292292        return;
     
    297297    pRWLock->cReadersWaiting = 0;
    298298    pRWLock->cWritersWaiting = 0;
    299 # if defined(__WIN__)
     299# if defined(RT_OS_WINDOWS)
    300300    CloseHandle(pRWLock->hevReaders);
    301301    pRWLock->hevReaders = INVALID_HANDLE_VALUE;
     
    303303    pRWLock->hevWriters = INVALID_HANDLE_VALUE;
    304304
    305 # elif defined(__OS2__)
     305# elif defined(RT_OS_OS2)
    306306    DosCloseEventSem(pRWLock->hevReaders);
    307307    pRWLock->hevReaders = NULLHANDLE;
     
    322322    pthread_rwlock_rdlock(pRWLock);
    323323
    324 #elif defined(__WIN__) || defined(__OS2__)
     324#elif defined(RT_OS_WINDOWS) || defined(RT_OS_OS2)
    325325    if (pRWLock->enmState == RWLOCK_STATE_UNINITIALIZED)
    326326        return;
     
    338338        /* have to wait */
    339339        KPRF_ATOMIC_INC32(&pRWLock->cReadersWaiting);
    340 # if defined(__WIN__)
     340# if defined(RT_OS_WINDOWS)
    341341        HANDLE hev = pRWLock->hevReaders;
    342342        ResetEvent(hev);
    343343
    344 # elif defined(__OS2__)
     344# elif defined(RT_OS_OS2)
    345345        HEV    hev = pRWLock->hevReaders;
    346346        ULONG cIgnored;
     
    350350        kPrfMutexRelease(&pRWLock->Mutex);
    351351
    352 # if defined(__WIN__)
     352# if defined(RT_OS_WINDOWS)
    353353        switch (WaitForSingleObject(hev, INFINITE))
    354354        {
     
    362362        }
    363363
    364 # elif defined(__OS2__)
     364# elif defined(RT_OS_OS2)
    365365        switch (DosWaitEventSem(hev, SEM_INDEFINITE_WAIT))
    366366        {
     
    397397    pthread_rwlock_unlock(pRWLock);
    398398
    399 #elif defined(__WIN__) || defined(__OS2__)
     399#elif defined(RT_OS_WINDOWS) || defined(RT_OS_OS2)
    400400    if (pRWLock->enmState == RWLOCK_STATE_UNINITIALIZED)
    401401        return;
     
    421421     * Wake up one (or more on OS/2) waiting writers.
    422422     */
    423 # if defined(__WIN__)
     423# if defined(RT_OS_WINDOWS)
    424424    SetEvent(pRWLock->hevWriters);
    425 # elif defined(__OS2__)
     425# elif defined(RT_OS_OS2)
    426426    DosPostEvent(pRWLock->hevwriters);
    427427# endif
     
    441441    pthread_rwlock_wrlock(pRWLock);
    442442
    443 #elif defined(__WIN__) || defined(__OS2__)
     443#elif defined(RT_OS_WINDOWS) || defined(RT_OS_OS2)
    444444    if (pRWLock->enmState == RWLOCK_STATE_UNINITIALIZED)
    445445        return;
     
    464464    for (;;)
    465465    {
    466 # if defined(__WIN__)
     466# if defined(RT_OS_WINDOWS)
    467467        HANDLE hev = pRWLock->hevWriters;
    468 # elif defined(__OS2__)
     468# elif defined(RT_OS_OS2)
    469469        HEV    hev = pRWLock->hevWriters;
    470470# endif
    471471        kPrfMutexRelease(&pRWLock->Mutex);
    472 # if defined(__WIN__)
     472# if defined(RT_OS_WINDOWS)
    473473        switch (WaitForSingleObject(hev, INFINITE))
    474474        {
     
    483483        }
    484484
    485 # elif defined(__OS2__)
     485# elif defined(RT_OS_OS2)
    486486        switch (DosWaitEventSem(hev, SEM_INDEFINITE_WAIT))
    487487        {
     
    527527    pthread_rwlock_unlock(pRWLock);
    528528
    529 #elif defined(__WIN__) || defined(__OS2__)
     529#elif defined(RT_OS_WINDOWS) || defined(RT_OS_OS2)
    530530    if (pRWLock->enmState == RWLOCK_STATE_UNINITIALIZED)
    531531        return;
     
    552552     * Someone is waiting, wake them up as we change the state.
    553553     */
    554 # if defined(__WIN__)
     554# if defined(RT_OS_WINDOWS)
    555555    HANDLE hev = INVALID_HANDLE_VALUE;
    556 # elif defined(__OS2__)
     556# elif defined(RT_OS_OS2)
    557557    HEV    hev = NULLHANDLE;
    558558# endif
     
    568568        hev = pRWLock->hevReaders;
    569569    }
    570 # if defined(__WIN__)
     570# if defined(RT_OS_WINDOWS)
    571571    SetEvent(hev);
    572 # elif defined(__OS2__)
     572# elif defined(RT_OS_OS2)
    573573    DosPostEvent(pRWLock->hevwriters);
    574574# endif
  • trunk/src/VBox/Runtime/include/internal/dir.h

    r2981 r3672  
    7979#endif
    8080
    81 #ifdef __WIN__
     81#ifdef RT_OS_WINDOWS
    8282    /** Handle to the opened directory search. */
    8383    HANDLE              hDir;
  • trunk/src/VBox/Runtime/include/internal/fs.h

    r2981 r3672  
    2424
    2525#include <iprt/types.h>
    26 #ifndef __WIN__
     26#ifndef RT_OS_WINDOWS
    2727# include <sys/stat.h>
    2828#endif
     
    3737
    3838size_t  rtPathVolumeSpecLen(const char *pszPath);
    39 #ifndef __WIN__
     39#ifndef RT_OS_WINDOWS
    4040void    rtFsConvertStatToObjInfo(PRTFSOBJINFO pObjInfo, const struct stat *pStat, const char *pszName, unsigned cbName);
    4141#endif
    4242
    43 #ifdef __LINUX__
     43#ifdef RT_OS_LINUX
    4444# ifdef __USE_MISC
    4545#  define HAVE_STAT_TIMESPEC_BRIEF
  • trunk/src/VBox/Runtime/include/internal/path.h

    r2981 r3672  
    2929extern char g_szrtProgramPath[RTPATH_MAX];
    3030
    31 #if defined(__OS2__) || defined(__WIN__)
     31#if defined(RT_OS_OS2) || defined(RT_OS_WINDOWS)
    3232# define HAVE_UNC 1
    3333# define HAVE_DRIVE 1
  • trunk/src/VBox/Runtime/include/internal/thread.h

    r2981 r3672  
    8888    /** The current thread state. */
    8989    RTTHREADSTATE volatile  enmState;
    90 #if defined(__WIN__) && defined(IN_RING3)
     90#if defined(RT_OS_WINDOWS) && defined(IN_RING3)
    9191    /** The thread handle.
    9292     * This is not valid until the create function has returned! */
     
    190190
    191191#ifdef IN_RING3
    192 # ifdef __WIN__
     192# ifdef RT_OS_WINDOWS
    193193/**
    194194 * Callback for when a native thread is detaching.
  • trunk/src/VBox/Runtime/ldrkLdr.cpp

    r2981 r3672  
    557557    }
    558558
    559 #if defined(__OS2__) || (defined(__DARWIN__) && defined(__X86__))
     559#if defined(RT_OS_OS2) || (defined(RT_OS_DARWIN) && defined(RT_ARCH_X86))
    560560    /* skip the underscore prefix. */
    561561    if (*pszSymbol == '_')
     
    624624    }
    625625
    626 #if defined(__OS2__) || (defined(__DARWIN__) && defined(__X86__))
     626#if defined(RT_OS_OS2) || (defined(RT_OS_DARWIN) && defined(RT_ARCH_X86))
    627627    /* skip the underscore prefix. */
    628628    if (*pszSymbol == '_')
     
    661661    KLDRADDR uValue;
    662662
    663 #if defined(__OS2__) || (defined(__DARWIN__) && defined(__X86__))
     663#if defined(RT_OS_OS2) || (defined(RT_OS_DARWIN) && defined(RT_ARCH_X86))
    664664    /*
    665665     * Add underscore prefix.
  • trunk/src/VBox/Runtime/log.cpp

    r3502 r3672  
    226226        {
    227227            pLogger->pfnLogger = *(PFNRTLOGGER*)&pu8Code;
    228 #ifdef __AMD64__
     228#ifdef RT_ARCH_AMD64
    229229            /* this wrapper will not be used on AMD64, we will be requiring C99 compilers there. */
    230230            *pu8Code++ = 0xcc;
     
    14681468    va_list args;
    14691469    va_start(args, pszFormat);
    1470 #if defined(__DARWIN__) && defined(__X86__) && defined(IN_RING3)
     1470#if defined(RT_OS_DARWIN) && defined(RT_ARCH_X86) && defined(IN_RING3)
    14711471    /* manually align the stack before doing the call.
    14721472     * We boldly assume that there is a stack frame here! */
  • trunk/src/VBox/Runtime/math/ceill.asm

    r2988 r3672  
    2525BEGINCODE
    2626
    27 %ifdef __AMD64__
     27%ifdef RT_ARCH_AMD64
    2828 %define _SP rsp
    2929 %define _BP rbp
  • trunk/src/VBox/Runtime/math/cosl.asm

    r2988 r3672  
    2424BEGINCODE
    2525
    26 %ifdef __AMD64__
     26%ifdef RT_ARCH_AMD64
    2727 %define _SP rsp
    2828 %define _BP rbp
  • trunk/src/VBox/Runtime/math/fabs.asm

    r2988 r3672  
    2424BEGINCODE
    2525
    26 %ifdef __AMD64__
     26%ifdef RT_ARCH_AMD64
    2727 %define _SP rsp
    2828 %define _BP rbp
     
    4242    mov     _BP, _SP
    4343
    44 %ifdef __AMD64__
     44%ifdef RT_ARCH_AMD64
    4545    sub     _SP, 10h
    4646
  • trunk/src/VBox/Runtime/math/fabsf.asm

    r2988 r3672  
    2424BEGINCODE
    2525
    26 %ifdef __AMD64__
     26%ifdef RT_ARCH_AMD64
    2727 %define _SP rsp
    2828 %define _BP rbp
     
    4242    mov     _BP, _SP
    4343
    44 %ifdef __AMD64__
     44%ifdef RT_ARCH_AMD64
    4545    sub     _SP, 10h
    4646
  • trunk/src/VBox/Runtime/math/fabsl.asm

    r2988 r3672  
    2525BEGINCODE
    2626
    27 %ifdef __AMD64__
     27%ifdef RT_ARCH_AMD64
    2828 %define _SP rsp
    2929 %define _BP rbp
  • trunk/src/VBox/Runtime/math/floor.asm

    r2988 r3672  
    2424BEGINCODE
    2525
    26 %ifdef __AMD64__
     26%ifdef RT_ARCH_AMD64
    2727 %define _SP rsp
    2828 %define _BP rbp
     
    4343    sub     _SP, 10h
    4444
    45 %ifdef __AMD64__
     45%ifdef RT_ARCH_AMD64
    4646    movsd   [_SP], xmm0
    4747    fld     qword [_SP]
     
    6464    fldcw   [_BP - 10h]
    6565
    66 %ifdef __AMD64__
     66%ifdef RT_ARCH_AMD64
    6767    fstp    qword [_SP]
    6868    movsd   xmm0, [_SP]
  • trunk/src/VBox/Runtime/math/floorf.asm

    r2988 r3672  
    2424BEGINCODE
    2525
    26 %ifdef __AMD64__
     26%ifdef RT_ARCH_AMD64
    2727 %define _SP rsp
    2828 %define _BP rbp
     
    4343    sub     _SP, 10h
    4444
    45 %ifdef __AMD64__
     45%ifdef RT_ARCH_AMD64
    4646    movss   [_SP], xmm0
    4747    fld     dword [_SP]
     
    6464    fldcw   [_BP - 10h]
    6565
    66 %ifdef __AMD64__
     66%ifdef RT_ARCH_AMD64
    6767    fstp    dword [_SP]
    6868    movss   xmm0, [_SP]
  • trunk/src/VBox/Runtime/math/floorl.asm

    r2988 r3672  
    2424BEGINCODE
    2525
    26 %ifdef __AMD64__
     26%ifdef RT_ARCH_AMD64
    2727 %define _SP rsp
    2828 %define _BP rbp
  • trunk/src/VBox/Runtime/math/ldexpl.asm

    r2988 r3672  
    2424BEGINCODE
    2525
    26 %ifdef __AMD64__
     26%ifdef RT_ARCH_AMD64
    2727 %define _SP rsp
    2828 %define _BP rbp
     
    4545
    4646    ; load exp
    47 %ifdef __AMD64__ ; ASSUMES ONLY GCC HERE!
     47%ifdef RT_ARCH_AMD64 ; ASSUMES ONLY GCC HERE!
    4848    mov     [rsp], edi
    4949    fild    dword [rsp]
  • trunk/src/VBox/Runtime/math/llrint.asm

    r2988 r3672  
    2929; @param    rd     32-bit: [esp + 4h]  64-bit: xmm0
    3030BEGINPROC RT_NOCRT(llrint)
    31 %ifdef __AMD64__
     31%ifdef RT_ARCH_AMD64
    3232    cvtsd2si rax, xmm0
    3333%else
  • trunk/src/VBox/Runtime/math/llrintf.asm

    r2988 r3672  
    2929; @param    rf     32-bit: [esp + 4h]  64-bit: xmm0
    3030BEGINPROC RT_NOCRT(llrintf)
    31 %ifdef __AMD64__
     31%ifdef RT_ARCH_AMD64
    3232    cvtss2si rax, xmm0
    3333%else
  • trunk/src/VBox/Runtime/math/llrintl.asm

    r2988 r3672  
    2424BEGINCODE
    2525
    26 %ifdef __AMD64__
     26%ifdef RT_ARCH_AMD64
    2727 %define _SP rsp
    2828 %define _BP rbp
     
    4646    fistp   qword [_SP]
    4747    fwait
    48 %ifdef __AMD64__
     48%ifdef RT_ARCH_AMD64
    4949    mov     rax, [_SP]
    5050%else
  • trunk/src/VBox/Runtime/math/logl.asm

    r2988 r3672  
    2424BEGINCODE
    2525
    26 %ifdef __AMD64__
     26%ifdef RT_ARCH_AMD64
    2727 %define _SP rsp
    2828 %define _BP rbp
  • trunk/src/VBox/Runtime/math/lrint.asm

    r2988 r3672  
    2929; @param    rd     32-bit: [esp + 4h]  64-bit: xmm0
    3030BEGINPROC RT_NOCRT(lrint)
    31 %ifdef __AMD64__
     31%ifdef RT_ARCH_AMD64
    3232    cvtsd2si rax, xmm0
    3333%else
  • trunk/src/VBox/Runtime/math/lrintf.asm

    r2988 r3672  
    2929; @param    rf     32-bit: [esp + 4h]  64-bit: xmm0
    3030BEGINPROC RT_NOCRT(lrintf)
    31 %ifdef __AMD64__
     31%ifdef RT_ARCH_AMD64
    3232    cvtss2si rax, xmm0
    3333%else
  • trunk/src/VBox/Runtime/math/lrintl.asm

    r2988 r3672  
    2525BEGINCODE
    2626
    27 %ifdef __AMD64__
     27%ifdef RT_ARCH_AMD64
    2828 %define _SP rsp
    2929 %define _BP rbp
     
    4545
    4646    fld     tword [_BP + _S*2]
    47 %ifdef __AMD64__
     47%ifdef RT_ARCH_AMD64
    4848    fistp   qword [_SP]
    4949    fwait
  • trunk/src/VBox/Runtime/math/remainder.asm

    r2988 r3672  
    2424BEGINCODE
    2525
    26 %ifdef __AMD64__
     26%ifdef RT_ARCH_AMD64
    2727 %define _SP rsp
    2828 %define _BP rbp
     
    4343;int3
    4444
    45 %ifdef __AMD64__
     45%ifdef RT_ARCH_AMD64
    4646    movsd   [rsp + 10h], xmm1
    4747    movsd   [rsp], xmm0
     
    6060
    6161.done:
    62 %ifdef __AMD64__
     62%ifdef RT_ARCH_AMD64
    6363    fstp    qword [rsp]
    6464    movsd   xmm0, [rsp]
  • trunk/src/VBox/Runtime/math/remainderf.asm

    r2988 r3672  
    2424BEGINCODE
    2525
    26 %ifdef __AMD64__
     26%ifdef RT_ARCH_AMD64
    2727 %define _SP rsp
    2828 %define _BP rbp
     
    4242    sub     _SP, 20h
    4343
    44 %ifdef __AMD64__
     44%ifdef RT_ARCH_AMD64
    4545    movss   [rsp], xmm1
    4646    movss   [rsp + 10h], xmm0
     
    5959
    6060.done:
    61 %ifdef __AMD64__
     61%ifdef RT_ARCH_AMD64
    6262    fstp    dword [rsp]
    6363    movss   xmm0, [rsp]
  • trunk/src/VBox/Runtime/math/remainderl.asm

    r2988 r3672  
    2424BEGINCODE
    2525
    26 %ifdef __AMD64__
     26%ifdef RT_ARCH_AMD64
    2727 %define _SP rsp
    2828 %define _BP rbp
     
    4141    mov     _BP, _SP
    4242
    43 %ifdef __AMD64__
     43%ifdef RT_ARCH_AMD64
    4444    fld     tword [rbp + 10h + RTLRD_CB]
    4545    fld     tword [rbp + 10h]
  • trunk/src/VBox/Runtime/math/sinl.asm

    r2988 r3672  
    2525BEGINCODE
    2626
    27 %ifdef __AMD64__
     27%ifdef RT_ARCH_AMD64
    2828 %define _SP rsp
    2929 %define _BP rbp
  • trunk/src/VBox/Runtime/math/tanl.asm

    r2988 r3672  
    2424BEGINCODE
    2525
    26 %ifdef __AMD64__
     26%ifdef RT_ARCH_AMD64
    2727 %define _SP rsp
    2828 %define _BP rbp
  • trunk/src/VBox/Runtime/math/trunc.asm

    r2988 r3672  
    2525BEGINCODE
    2626
    27 %ifdef __AMD64__
     27%ifdef RT_ARCH_AMD64
    2828 %define _SP rsp
    2929 %define _BP rbp
     
    4444    sub     _SP, 10h
    4545
    46 %ifdef __AMD64__
     46%ifdef RT_ARCH_AMD64
    4747    movsd   [_SP], xmm0
    4848    fld     qword [_SP]
     
    6464    fldcw   [_BP - 10h]
    6565
    66 %ifdef __AMD64__
     66%ifdef RT_ARCH_AMD64
    6767    fstp    qword [_SP]
    6868    movsd   xmm0, [_SP]
  • trunk/src/VBox/Runtime/math/truncf.asm

    r2988 r3672  
    2525BEGINCODE
    2626
    27 %ifdef __AMD64__
     27%ifdef RT_ARCH_AMD64
    2828 %define _SP rsp
    2929 %define _BP rbp
     
    4444    sub     _SP, 10h
    4545
    46 %ifdef __AMD64__
     46%ifdef RT_ARCH_AMD64
    4747    movss   [_SP], xmm0
    4848    fld     dword [_SP]
     
    6464    fldcw   [_BP - 10h]
    6565
    66 %ifdef __AMD64__
     66%ifdef RT_ARCH_AMD64
    6767    fstp    dword [_SP]
    6868    movss   xmm0, [_SP]
  • trunk/src/VBox/Runtime/math/truncl.asm

    r2988 r3672  
    2525BEGINCODE
    2626
    27 %ifdef __AMD64__
     27%ifdef RT_ARCH_AMD64
    2828 %define _SP rsp
    2929 %define _BP rbp
  • trunk/src/VBox/Runtime/misc/setjmp.asm

    r2988 r3672  
    2727
    2828BEGINPROC RT_NOCRT(setjmp)
    29 %ifdef __AMD64__
     29%ifdef RT_ARCH_AMD64
    3030        mov     rax, [rsp]
    3131        mov     [rdi + 00h], rax        ; rip
     
    5555
    5656BEGINPROC RT_NOCRT(longjmp)
    57 %ifdef __AMD64__
     57%ifdef RT_ARCH_AMD64
    5858        mov     rbx, [rdi + 38h]
    5959        mov     r12, [rdi + 30h]
  • trunk/src/VBox/Runtime/path.cpp

    r2981 r3672  
    5252        {
    5353            /* handle separators. */
    54 #if defined(__WIN__) || defined(__OS2__)
     54#if defined(RT_OS_WINDOWS) || defined(RT_OS_OS2)
    5555            case ':':
    5656                pszLastSep = psz + 1;
     
    8888        {
    8989            /* handle separators. */
    90 #if defined(__WIN__) || defined(__OS2__)
     90#if defined(RT_OS_WINDOWS) || defined(RT_OS_OS2)
    9191            case ':':
    9292            case '\\':
     
    127127        {
    128128            /* handle separators. */
    129 #if defined(__WIN__) || defined(__OS2__)
     129#if defined(RT_OS_WINDOWS) || defined(RT_OS_OS2)
    130130            case ':':
    131131                pszLastComp = psz + 1;
     
    164164        {
    165165            case '/':
    166 #if defined(__WIN__) || defined(__OS2__)
     166#if defined(RT_OS_WINDOWS) || defined(RT_OS_OS2)
    167167            case '\\':
    168168#endif
     
    194194        {
    195195            /* handle separators. */
    196 #if defined(__WIN__) || defined(__OS2__)
     196#if defined(RT_OS_WINDOWS) || defined(RT_OS_OS2)
    197197            case ':':
    198198                pszExt = NULL;
     
    243243RTDECL(bool) RTPathHavePath(const char *pszPath)
    244244{
    245 #if defined(__WIN__) || defined(__OS2__)
     245#if defined(RT_OS_WINDOWS) || defined(RT_OS_OS2)
    246246    return strpbrk(pszPath, "/\\:") != NULL;
    247247#else
     
    269269        return 1;
    270270
    271 #if defined(__WIN__) || defined(__OS2__)
     271#if defined(RT_OS_WINDOWS) || defined(RT_OS_OS2)
    272272    PRTUNICP puszPath1;
    273273    int rc = RTStrToUni(pszPath1, &puszPath1);
     
    435435size_t rtPathVolumeSpecLen(const char *pszPath)
    436436{
    437 #if defined (__OS2__) || defined (__WIN__)
     437#if defined (RT_OS_OS2) || defined (RT_OS_WINDOWS)
    438438    if (pszPath && *pszPath)
    439439    {
     
    477477    if (pszBase && pszPath && !rtPathVolumeSpecLen(pszPath))
    478478    {
    479 #if defined(__WIN__)
     479#if defined(RT_OS_WINDOWS)
    480480        /* The format for very long paths is not supported. */
    481481        if (    (pszBase[0] == '/' || pszBase[0] == '\\')
     
    501501
    502502        bool fRootSpec = pszPath[0] == '/'
    503 #if defined(__WIN__) || defined(__OS2__)
     503#if defined(RT_OS_WINDOWS) || defined(RT_OS_OS2)
    504504            || pszPath[0] == '\\'
    505505#endif
  • trunk/src/VBox/Runtime/r0drv/alloc-r0drv.h

    r2981 r3672  
    4949#define RTMEMHDR_FLAG_ZEROED    BIT(0)
    5050#define RTMEMHDR_FLAG_EXEC      BIT(1)
    51 #ifdef __LINUX__
     51#ifdef RT_OS_LINUX
    5252#define RTMEMHDR_FLAG_EXEC_HEAP BIT(30)
    5353#define RTMEMHDR_FLAG_KMALLOC   BIT(31)
  • trunk/src/VBox/Runtime/r0drv/darwin/the-darwin-kernel.h

    r2981 r3672  
    4141
    4242/* After including cdefs, we can check that this really is Darwin. */
    43 #ifndef __DARWIN__
    44 # error "__DARWIN__ must be defined!"
     43#ifndef RT_OS_DARWIN
     44# error "RT_OS_DARWIN must be defined!"
    4545#endif
    4646
  • trunk/src/VBox/Runtime/r0drv/initterm-r0drv.cpp

    r2981 r3672  
    4545    if (RT_SUCCESS(rc))
    4646    {
    47 #if !defined(__LINUX__) && !defined(__WIN__)
     47#if !defined(RT_OS_LINUX) && !defined(RT_OS_WINDOWS)
    4848        rc = rtThreadInit();
    4949#endif
     
    6262RTR0DECL(void) RTR0Term(void)
    6363{
    64 #if !defined(__LINUX__) && !defined(__WIN__)
     64#if !defined(RT_OS_LINUX) && !defined(RT_OS_WINDOWS)
    6565    rtThreadTerm();
    6666#endif
  • trunk/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c

    r3305 r3672  
    2929#include "r0drv/alloc-r0drv.h"
    3030
    31 #if defined(__AMD64__) || defined(__DOXYGEN__)
     31#if defined(RT_ARCH_AMD64) || defined(__DOXYGEN__)
    3232/**
    3333 * We need memory in the module range (~2GB to ~0) this can only be obtained
     
    112112    if (fFlags & RTMEMHDR_FLAG_EXEC)
    113113    {
    114 #if defined(__AMD64__)
     114#if defined(RT_ARCH_AMD64)
    115115# ifdef RTMEMALLOC_EXEC_HEAP
    116116        if (g_HeapExec != NIL_RTHEAPSIMPLE)
     
    227227    cPages = cb >> PAGE_SHIFT;
    228228    cOrder = CalcPowerOf2Order(cPages);
    229 #ifdef __AMD64__ /** @todo check out if there is a correct way of getting memory below 4GB (physically). */
     229#ifdef RT_ARCH_AMD64 /** @todo check out if there is a correct way of getting memory below 4GB (physically). */
    230230    paPages = alloc_pages(GFP_DMA, cOrder);
    231231#else
  • trunk/src/VBox/Runtime/r0drv/linux/initterm-r0drv-linux.c

    r2981 r3672  
    3333*   Internal Functions                                                         *
    3434*******************************************************************************/
    35 #ifdef __AMD64__
     35#ifdef RT_ARCH_AMD64
    3636/* in alloc-r0drv0-linux.c */
    3737extern void rtR0MemExecCleanup(void);
     
    4747void rtR0TermNative(void)
    4848{
    49 #ifdef __AMD64__
     49#ifdef RT_ARCH_AMD64
    5050    rtR0MemExecCleanup();
    5151#endif
  • trunk/src/VBox/Runtime/r0drv/linux/spinlock-r0drv-linux.c

    r2981 r3672  
    4848    /** The linux spinlock structure. */
    4949    spinlock_t          Spinlock;
    50 #if !defined(CONFIG_SMP) || defined(__AMD64__)
     50#if !defined(CONFIG_SMP) || defined(RT_ARCH_AMD64)
    5151    /** A placeholder on Uni systems so we won't piss off RTMemAlloc(). */
    5252    void                *pvUniDummy;
  • trunk/src/VBox/Runtime/r0drv/linux/the-linux-kernel.h

    r2981 r3672  
    179179# endif
    180180
    181 # ifndef __AMD64__
     181# ifndef RT_ARCH_AMD64
    182182/* In 2.6.9-22.ELsmp we have to call change_page_attr() twice when changing
    183183 * the page attributes from PAGE_KERNEL to something else, because there appears
     
    191191        change_page_attr(pPages, cPages, prot); \
    192192    } while (0)
    193 # endif  /* !__AMD64__ */
     193# endif  /* !RT_ARCH_AMD64 */
    194194#endif /* !NO_REDHAT_HACKS */
    195195
     
    200200
    201201#ifndef MY_CHANGE_PAGE_ATTR
    202 # ifdef __AMD64__ /** @todo This is a cheap hack, but it'll get around that 'else BUG();' in __change_page_attr().  */
     202# ifdef RT_ARCH_AMD64 /** @todo This is a cheap hack, but it'll get around that 'else BUG();' in __change_page_attr().  */
    203203#  define MY_CHANGE_PAGE_ATTR(pPages, cPages, prot) \
    204204    do { \
  • trunk/src/VBox/Runtime/r0drv/nt/the-nt-kernel.h

    r2981 r3672  
    4848# error "__WIN32__ or __WIN64__ must be defined!"
    4949#endif
    50 #if !defined(__WIN__)
    51 # error "__WIN__ must be defined!"
     50#if !defined(RT_OS_WINDOWS)
     51# error "RT_OS_WINDOWS must be defined!"
    5252#endif
    5353
  • trunk/src/VBox/Runtime/r3/alloc-ef.h

    r2981 r3672  
    7272 * Requires RTALLOC_EFENCE_TRACE.
    7373 */
    74 #if defined(__LINUX__)
     74#if defined(RT_OS_LINUX)
    7575# define RTALLOC_EFENCE_FREE_FILL       'f'
    7676#endif
     
    9494*   Header Files                                                               *
    9595*******************************************************************************/
    96 #ifdef __WIN__
     96#ifdef RT_OS_WINDOWS
    9797# include <Windows.h>
    9898#else
  • trunk/src/VBox/Runtime/r3/alloc.cpp

    r2981 r3672  
    9494    void *pv = malloc(cb);
    9595    AssertMsg(pv, ("malloc(%d) failed!!!\n", cb));
    96 #ifdef __OS2__ /* temporary workaround until libc062. */
     96#ifdef RT_OS_OS2 /* temporary workaround until libc062. */
    9797    AssertMsg(   cb < 32
    9898              || !((uintptr_t)pv & (RTMEM_ALIGNMENT - 1)), ("pv=%p RTMEM_ALIGNMENT=%#x\n", pv, RTMEM_ALIGNMENT));
     
    128128    void *pv = calloc(1, cb);
    129129    AssertMsg(pv, ("calloc(1,%d) failed!!!\n", cb));
    130 #ifdef __OS2__ /* temporary workaround until libc062. */
     130#ifdef RT_OS_OS2 /* temporary workaround until libc062. */
    131131    AssertMsg(   cb < 32
    132132              || !((uintptr_t)pv & (RTMEM_ALIGNMENT - 1)), ("pv=%p RTMEM_ALIGNMENT=%#x\n", pv, RTMEM_ALIGNMENT));
     
    157157    void *pv = realloc(pvOld, cbNew);
    158158    AssertMsg(pv && cbNew, ("realloc(%p, %d) failed!!!\n", pvOld, cbNew));
    159 #ifdef __OS2__ /* temporary workaround until libc062. */
     159#ifdef RT_OS_OS2 /* temporary workaround until libc062. */
    160160    AssertMsg(   cbNew < 32
    161161              || !((uintptr_t)pv & (RTMEM_ALIGNMENT - 1)), ("pv=%p RTMEM_ALIGNMENT=%#x\n", pv, RTMEM_ALIGNMENT));
  • trunk/src/VBox/Runtime/r3/init.cpp

    r3123 r3672  
    2626*******************************************************************************/
    2727#define LOG_GROUP RTLOGGROUP_DEFAULT
    28 #ifdef __WIN__
     28#ifdef RT_OS_WINDOWS
    2929# include <process.h>
    3030#else
  • trunk/src/VBox/Runtime/r3/posix/alloc-posix.cpp

    r2981 r3672  
    3535#include <sys/mman.h>
    3636
    37 #if !defined(RT_USE_MMAP) && (defined(__LINUX__))
     37#if !defined(RT_USE_MMAP) && (defined(RT_OS_LINUX))
    3838# define RT_USE_MMAP
    3939#endif
     
    8383    size_t cbAlloc = RT_ALIGN_Z(cb + sizeof(RTMEMEXECHDR), PAGE_SIZE);
    8484    void *pv = mmap(NULL, cbAlloc, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANONYMOUS
    85 #if defined(__AMD64__) && defined(MAP_32BIT)
     85#if defined(RT_ARCH_AMD64) && defined(MAP_32BIT)
    8686                    | MAP_32BIT
    8787#endif
  • trunk/src/VBox/Runtime/r3/posix/fileio-posix.cpp

    r2981 r3672  
    3939# include <sys/time.h>
    4040#endif
    41 #if defined(__OS2__) && (!defined(__INNOTEK_LIBC__) || __INNOTEK_LIBC__ < 0x006)
     41#if defined(RT_OS_OS2) && (!defined(__INNOTEK_LIBC__) || __INNOTEK_LIBC__ < 0x006)
    4242# include <io.h>
    4343#endif
    44 #ifdef __L4__
     44#ifdef RT_OS_L4
    4545/* This is currently ifdef'ed out in the relevant L4 header file */
    4646/* Same as `utimes', but takes an open file descriptor instead of a name.  */
     
    334334    }
    335335
    336 #if defined(_MSC_VER) || (defined(__OS2__) && (!defined(__INNOTEK_LIBC__) || __INNOTEK_LIBC__ < 0x006))
     336#if defined(_MSC_VER) || (defined(RT_OS_OS2) && (!defined(__INNOTEK_LIBC__) || __INNOTEK_LIBC__ < 0x006))
    337337    if (chsize((int)File, (off_t)cbSize) == 0)
    338338#else
  • trunk/src/VBox/Runtime/r3/posix/ldrNative-posix.cpp

    r2981 r3672  
    4343    if (!RTPathHaveExt(pszFilename))
    4444    {
    45 #if defined(__OS2__) || defined(__WIN__)
     45#if defined(RT_OS_OS2) || defined(RT_OS_WINDOWS)
    4646        static const char s_szSuff[] = ".DLL";
    47 #elif defined(__L4__)
     47#elif defined(RT_OS_L4)
    4848        static const char s_szSuff[] = ".s.so";
    49 #elif defined(__DARWIN__)
     49#elif defined(RT_OS_DARWIN)
    5050        static const char s_szSuff[] = ".dylib";
    5151#else
     
    7979{
    8080    PRTLDRMODNATIVE pModNative = (PRTLDRMODNATIVE)pMod;
    81 #ifdef __OS2__
     81#ifdef RT_OS_OS2
    8282    /* Prefix the symbol with an underscore (assuming __cdecl/gcc-default). */
    8383    size_t cch = strlen(pszSymbol);
  • trunk/src/VBox/Runtime/r3/posix/path-posix.cpp

    r3365 r3672  
    3232#include <sys/time.h>
    3333#include <stdio.h>
    34 #ifdef __DARWIN__
     34#ifdef RT_OS_DARWIN
    3535# include <mach-o/dyld.h>
    3636#endif
     
    4444#include "internal/fs.h"
    4545
    46 #ifdef __L4__
     46#ifdef RT_OS_L4
    4747# include <l4/vboxserver/vboxserver.h>
    4848#endif
     
    182182    {
    183183        if (errno == ENOENT || errno == ENOTDIR
    184 #ifdef __OS2__
     184#ifdef RT_OS_OS2
    185185            /// @todo realpath() returns EIO for non-existent UNC paths like
    186186            //  //server/share/subdir (i.e. when a subdir is specified within
     
    315315                                {
    316316                                    if (errno != ENOENT && errno != ENOTDIR
    317 #ifdef __OS2__
     317#ifdef RT_OS_OS2
    318318                                        /// @todo see above
    319319                                        && errno != EIO
     
    408408         */
    409409/** @todo use RTProcGetExecutableName() */
    410 #if defined(__LINUX__) || defined(__FREEBSD__)
    411 # ifdef __LINUX__
     410#if defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD)
     411# ifdef RT_OS_LINUX
    412412        int cchLink = readlink("/proc/self/exe", &g_szrtProgramPath[0], sizeof(g_szrtProgramPath) - 1);
    413413# else
     
    423423        g_szrtProgramPath[cchLink] = '\0';
    424424
    425 #elif defined(__OS2__) || defined(__L4__)
     425#elif defined(RT_OS_OS2) || defined(RT_OS_L4)
    426426        _execname(g_szrtProgramPath, sizeof(g_szrtProgramPath));
    427427
    428 #elif defined(__DARWIN__)
     428#elif defined(RT_OS_DARWIN)
    429429        const char *pszImageName = _dyld_get_image_name(0);
    430430        AssertReturn(pszImageName, VERR_INTERNAL_ERROR);
  • trunk/src/VBox/Runtime/r3/posix/process-posix.cpp

    r2981 r3672  
    3232#include <sys/wait.h>
    3333#include <signal.h>
    34 #if defined(__LINUX__) || defined(__OS2__)
     34#if defined(RT_OS_LINUX) || defined(RT_OS_OS2)
    3535# define HAVE_POSIX_SPAWN 1
    3636#endif
     
    3838# include <spawn.h>
    3939#endif
    40 #ifdef __DARWIN__
     40#ifdef RT_OS_DARWIN
    4141# include <mach-o/dyld.h>
    4242#endif
     
    237237     * files and code for this.
    238238     */
    239 #if defined(__LINUX__) || defined(__FREEBSD__)
    240 # ifdef __LINUX__
     239#if defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD)
     240# ifdef RT_OS_LINUX
    241241    int cchLink = readlink("/proc/self/exe", pszExecName, cchExecName - 1);
    242242# else   
     
    249249    }
    250250
    251 #elif defined(__OS2__) || defined(__L4__)
     251#elif defined(RT_OS_OS2) || defined(RT_OS_L4)
    252252    if (!_execname(pszExecName, cchExecName))
    253253        return pszExecName;
    254254
    255 #elif defined(__DARWIN__)
     255#elif defined(RT_OS_DARWIN)
    256256    const char *pszImageName = _dyld_get_image_name(0);
    257257    if (pszImageName)
  • trunk/src/VBox/Runtime/r3/posix/sems-posix.cpp

    r2981 r3672  
    3434#include <sys/time.h>
    3535
    36 #ifdef __DARWIN__
     36#ifdef RT_OS_DARWIN
    3737# define pthread_yield() pthread_yield_np()
    3838#endif
     
    366366         */
    367367        struct timespec     ts = {0,0};
    368 #ifdef __DARWIN__
     368#ifdef RT_OS_DARWIN
    369369        struct timeval      tv = {0,0};
    370370        gettimeofday(&tv, NULL);
     
    390390
    391391        /* take mutex */
    392 #ifdef __DARWIN__
     392#ifdef RT_OS_DARWIN
    393393        int rc = pthread_mutex_lock(&pIntEventSem->Mutex);
    394394#else
     
    601601         */
    602602        struct timespec     ts = {0,0};
    603 #ifdef __DARWIN__
     603#ifdef RT_OS_DARWIN
    604604        struct timeval      tv = {0,0};
    605605        gettimeofday(&tv, NULL);
     
    621621
    622622        /* take mutex */
    623 #ifdef __DARWIN__
     623#ifdef RT_OS_DARWIN
    624624        int rc = pthread_mutex_lock(&pIntEventMultiSem->Mutex);
    625625#else
     
    812812    else
    813813    {
    814 #ifdef __DARWIN__
     814#ifdef RT_OS_DARWIN
    815815        AssertMsgFailed(("Not implemented on Darwin yet because of incomplete pthreads API."));
    816816        return VERR_NOT_IMPLEMENTED;
    817 #else /* !__DARWIN__ */
     817#else /* !RT_OS_DARWIN */
    818818        /*
    819819         * Get current time and calc end of wait time.
     
    839839            return RTErrConvertFromErrno(rc);
    840840        }
    841 #endif /* !__DARWIN__ */
     841#endif /* !RT_OS_DARWIN */
    842842    }
    843843
     
    10301030    else
    10311031    {
    1032 #ifdef __DARWIN__
     1032#ifdef RT_OS_DARWIN
    10331033        AssertMsgFailed(("Not implemented on Darwin yet because of incomplete pthreads API."));
    10341034        return VERR_NOT_IMPLEMENTED;
    1035 #else /* !__DARWIN__ */
     1035#else /* !RT_OS_DARWIN */
    10361036        /*
    10371037         * Get current time and calc end of wait time.
     
    10571057            return RTErrConvertFromErrno(rc);
    10581058        }
    1059 #endif /* !__DARWIN__ */
     1059#endif /* !RT_OS_DARWIN */
    10601060    }
    10611061
     
    11291129    else
    11301130    {
    1131 #ifdef __DARWIN__
     1131#ifdef RT_OS_DARWIN
    11321132        AssertMsgFailed(("Not implemented on Darwin yet because of incomplete pthreads API."));
    11331133        return VERR_NOT_IMPLEMENTED;
    1134 #else /* !__DARWIN__ */
     1134#else /* !RT_OS_DARWIN */
    11351135        /*
    11361136         * Get current time and calc end of wait time.
     
    11561156            return RTErrConvertFromErrno(rc);
    11571157        }
    1158 #endif /* !__DARWIN__ */
     1158#endif /* !RT_OS_DARWIN */
    11591159    }
    11601160
  • trunk/src/VBox/Runtime/r3/posix/thread-posix.cpp

    r2981 r3672  
    201201    {
    202202        /* pthread_yield() isn't part of SuS, thus this fun. */
    203 #ifdef __DARWIN__
     203#ifdef RT_OS_DARWIN
    204204        pthread_yield_np();
    205 #elif defined(__FREEBSD__) /* void pthread_yield */
     205#elif defined(RT_OS_FREEBSD) /* void pthread_yield */
    206206        pthread_yield();
    207207#else
     
    236236{
    237237    uint64_t u64TS = ASMReadTSC();
    238 #ifdef __DARWIN__
     238#ifdef RT_OS_DARWIN
    239239    pthread_yield_np();
    240240#else
  • trunk/src/VBox/Runtime/r3/posix/time-posix.cpp

    r2981 r3672  
    3535DECLINLINE(uint64_t) rtTimeGetSystemNanoTS(void)
    3636{
    37 #if defined(CLOCK_MONOTONIC) && !defined(__L4__) && !defined(__OS2__)
     37#if defined(CLOCK_MONOTONIC) && !defined(RT_OS_L4) && !defined(RT_OS_OS2)
    3838    /* check monotonic clock first. */
    3939    static bool s_fMonoClock = true;
  • trunk/src/VBox/Runtime/r3/posix/timer-posix.cpp

    r2981 r3672  
    3838#include <sys/fcntl.h>
    3939#include <sys/ioctl.h>
    40 #ifdef __LINUX__
     40#ifdef RT_OS_LINUX
    4141# include <linux/rtc.h>
    4242#endif
     
    4444#include <signal.h>
    4545#include <errno.h>
    46 #ifndef __OS2__
     46#ifndef RT_OS_OS2
    4747# include <pthread.h>
    4848#endif
     
    216216        {
    217217            siginfo_t SigInfo = {0};
    218 #ifdef __DARWIN__
     218#ifdef RT_OS_DARWIN
    219219            if (RT_LIKELY(sigwait(&SigSet, &SigInfo.si_signo) >= 0))
    220220            {
     
    318318             */
    319319            Log(("RTTimerCreate: interval={%ld,%ld} trying to adjust /dev/rtc!\n", TimerVal.it_interval.tv_sec, TimerVal.it_interval.tv_usec));
    320 #ifdef __LINUX__
     320#ifdef RT_OS_LINUX
    321321            int fh = open("/dev/rtc", O_RDONLY);
    322322            if (fh >= 0)
     
    424424    if (!pTimer->fSuspended)
    425425    {
    426 #ifndef __OS2__
     426#ifndef RT_OS_OS2
    427427        pthread_kill((pthread_t)RTThreadGetNative(pTimer->Thread), SIGALRM);
    428428#endif
     
    498498    if (RTThreadSelf() != pTimer->Thread)
    499499    {
    500 #ifndef __OS2__
     500#ifndef RT_OS_OS2
    501501        pthread_kill((pthread_t)RTThreadGetNative(pTimer->Thread), SIGALRM);
    502502#endif
  • trunk/src/VBox/Runtime/r3/posix/utf8-posix.cpp

    r2981 r3672  
    9696            const void *pvInputLeft = pvInput;
    9797            void       *pvOutputLeft = pvOutput;
    98 #ifdef __LINUX__ /* glibc has an incorrect declaration of the api. */
     98#ifdef RT_OS_LINUX /* glibc has an incorrect declaration of the api. */
    9999            if (iconv(icHandle, (char **)&pvInputLeft, &cbInLeft, (char **)&pvOutputLeft, &cbOutLeft) != (size_t)-1)
    100100#else
  • trunk/src/VBox/Runtime/r3/process.cpp

    r2981 r3672  
    3131#include "internal/thread.h"
    3232
    33 #ifdef __WIN__
     33#ifdef RT_OS_WINDOWS
    3434# include <process.h>
    3535#else
  • trunk/src/VBox/Runtime/r3/stream.cpp

    r2981 r3672  
    3838#include <errno.h>
    3939
    40 #if defined(__LINUX__) /* PORTME: check for the _unlocked functions in stdio.h */
     40#if defined(RT_OS_LINUX) /* PORTME: check for the _unlocked functions in stdio.h */
    4141#define HAVE_FWRITE_UNLOCKED
    4242#endif
  • trunk/src/VBox/Runtime/r3/tcp.cpp

    r2981 r3672  
    2424*   Header Files                                                               *
    2525*******************************************************************************/
    26 #ifdef __WIN__
     26#ifdef RT_OS_WINDOWS
    2727#include <winsock.h>
    28 #else /* !__WIN__ */
     28#else /* !RT_OS_WINDOWS */
    2929#include <errno.h>
    3030#include <sys/stat.h>
     
    3636#include <netdb.h>
    3737#include <unistd.h>
    38 #endif /* !__WIN__ */
     38#endif /* !RT_OS_WINDOWS */
    3939
    4040#include <iprt/tcp.h>
     
    6060
    6161/* fixup backlevel OSes. */
    62 #if defined(__OS2__) || defined(__WIN__)
     62#if defined(RT_OS_OS2) || defined(RT_OS_WINDOWS)
    6363# define socklen_t  int
    6464#endif
     
    139139DECLINLINE(int) rtTcpError(void)
    140140{
    141 #ifdef __WIN__
     141#ifdef RT_OS_WINDOWS
    142142    return RTErrConvertFromWin32(WSAGetLastError());
    143143#else
     
    280280    }
    281281
    282 #ifdef __WIN__
     282#ifdef RT_OS_WINDOWS
    283283    /*
    284284     * Initialize WinSock and check version.
     
    475475        if (Socket == -1)
    476476        {
    477 #ifndef __WIN__
     477#ifndef RT_OS_WINDOWS
    478478            /* These are typical for what can happen during destruction. */
    479479            if (errno == EBADF || errno == EINVAL || errno == ENOTSOCK)
     
    800800    AssertReturn(VALID_PTR(pszAddress), VERR_INVALID_PARAMETER);
    801801
    802 #ifdef __WIN__
     802#ifdef RT_OS_WINDOWS
    803803    /*
    804804     * Initialize WinSock and check version.
     
    874874     * Attempt to close it.
    875875     */
    876 #ifdef __WIN__
     876#ifdef RT_OS_WINDOWS
    877877    int rc = closesocket(Sock);
    878878#else
  • trunk/src/VBox/Runtime/req.cpp

    r2981 r3672  
    780780            } u;
    781781            u.pfn = pReq->u.Internal.pfn;
    782 #ifdef __AMD64__
     782#ifdef RT_ARCH_AMD64
    783783            switch (pReq->u.Internal.cArgs)
    784784            {
  • trunk/src/VBox/Runtime/strformatrt.cpp

    r3256 r3672  
    610610                long rc = va_arg(*pArgs, long);
    611611                char ch = *(*ppszFormat)++;
    612 #if defined(__WIN__)
     612#if defined(RT_OS_WINDOWS)
    613613                PCRTWINERRMSG pMsg = RTErrWinGet(rc);
    614614#endif
    615615                switch (ch)
    616616                {
    617 #if defined(__WIN__)
     617#if defined(RT_OS_WINDOWS)
    618618                    case 'c':
    619619                        return pfnOutput(pvArgOutput, pMsg->pszDefine, strlen(pMsg->pszDefine));
  • trunk/src/VBox/Runtime/string/memchr.asm

    r2988 r3672  
    3030BEGINPROC RT_NOCRT(memchr)
    3131        cld
    32 %ifdef __AMD64__
     32%ifdef RT_ARCH_AMD64
    3333 %ifdef ASM_CALL64_MSC
    3434        or      r8, r8
     
    6363        mov     rdi, r9
    6464%endif
    65 %ifdef __X86__
     65%ifdef RT_ARCH_X86
    6666        mov     edi, edx
    6767%endif
     
    7272        mov     rdi, r9
    7373%endif
    74 %ifdef __X86__
     74%ifdef RT_ARCH_X86
    7575        mov     edi, edx
    7676%endif
  • trunk/src/VBox/Runtime/string/memchr_alias.c

    r2981 r3672  
    2727#undef memchr
    2828
    29 #if defined(__DARWIN__) || defined(__WIN__)
     29#if defined(RT_OS_DARWIN) || defined(RT_OS_WINDOWS)
    3030# ifndef __MINGW32__
    3131#  pragma weak memchr
  • trunk/src/VBox/Runtime/string/memcmp.asm

    r2988 r3672  
    3232
    3333        ; Do the bulk of the work.
    34 %ifdef __AMD64__
     34%ifdef RT_ARCH_AMD64
    3535 %ifdef ASM_CALL64_MSC
    3636        mov     r10, rdi                ; save
     
    6363
    6464        ; The remaining bytes.
    65 %ifdef __AMD64__
     65%ifdef RT_ARCH_AMD64
    6666        test    dl, 4
    6767        jz      .dont_cmp_dword
     
    8282
    8383.done:
    84 %ifdef __AMD64__
     84%ifdef RT_ARCH_AMD64
    8585 %ifdef ASM_CALL64_MSC
    8686        mov     rdi, r10
     
    9696; Mismatches.
    9797;
    98 %ifdef __AMD64__
     98%ifdef RT_ARCH_AMD64
    9999.not_equal_qword:
    100100    mov     ecx, 8
     
    114114    sub     xDI, 4
    115115    repe cmpsb
    116 %ifdef __AMD64__
     116%ifdef RT_ARCH_AMD64
    117117    jmp     .not_equal_byte
    118118%else
  • trunk/src/VBox/Runtime/string/memcmp_alias.c

    r2981 r3672  
    2727#undef memcmp
    2828
    29 #if defined(__DARWIN__) || defined(__WIN__)
     29#if defined(RT_OS_DARWIN) || defined(RT_OS_WINDOWS)
    3030# ifndef __MINGW32__
    3131#  pragma weak memcmp
  • trunk/src/VBox/Runtime/string/memcpy.asm

    r2988 r3672  
    3232
    3333        ; Do the bulk of the work.
    34 %ifdef __AMD64__
     34%ifdef RT_ARCH_AMD64
    3535 %ifdef ASM_CALL64_MSC
    3636        mov     r10, rdi                ; save
     
    6060
    6161        ; The remaining bytes.
    62 %ifdef __AMD64__
     62%ifdef RT_ARCH_AMD64
    6363        test    dl, 4
    6464        jz      .dont_move_dword
     
    7575.dont_move_byte:
    7676
    77 %ifdef __AMD64__
     77%ifdef RT_ARCH_AMD64
    7878 %ifdef ASM_CALL64_MSC
    7979        mov     rdi, r10
  • trunk/src/VBox/Runtime/string/memcpy_alias.c

    r2981 r3672  
    2727#undef memcpy
    2828
    29 #if defined(__DARWIN__) || defined(__WIN__)
     29#if defined(RT_OS_DARWIN) || defined(RT_OS_WINDOWS)
    3030# ifndef __MINGW32__
    3131#  pragma weak memcpy
  • trunk/src/VBox/Runtime/string/mempcpy.asm

    r2988 r3672  
    3232
    3333        ; Do the bulk of the work.
    34 %ifdef __AMD64__
     34%ifdef RT_ARCH_AMD64
    3535 %ifdef ASM_CALL64_MSC
    3636        mov     r10, rdi                ; save
     
    5858
    5959        ; The remaining bytes.
    60 %ifdef __AMD64__
     60%ifdef RT_ARCH_AMD64
    6161        test    dl, 4
    6262        jz      .dont_move_dword
     
    7474
    7575        ; restore & return
    76 %ifdef __AMD64__
     76%ifdef RT_ARCH_AMD64
    7777        mov     rax, rdi
    7878 %ifdef ASM_CALL64_MSC
  • trunk/src/VBox/Runtime/string/memset.asm

    r2988 r3672  
    3030BEGINPROC RT_NOCRT(memset)
    3131        cld
    32 %ifdef __AMD64__
     32%ifdef RT_ARCH_AMD64
    3333 %ifdef ASM_CALL64_MSC
    3434        int3
  • trunk/src/VBox/Runtime/string/memset_alias.c

    r2981 r3672  
    2727#undef memset
    2828
    29 #if defined(__DARWIN__) || defined(__WIN__)
     29#if defined(RT_OS_DARWIN) || defined(RT_OS_WINDOWS)
    3030# ifndef __MINGW32__
    3131#  pragma weak memset
  • trunk/src/VBox/Runtime/string/strchr.asm

    r2988 r3672  
    3131
    3232        ; check for ch == 0 and setup normal strchr.
    33 %ifdef __AMD64__
     33%ifdef RT_ARCH_AMD64
    3434 %ifdef ASM_CALL64_MSC
    3535        or      dl, dl
     
    8383        mov     rsi, r9
    8484%endif
    85 %ifdef __X86__
     85%ifdef RT_ARCH_X86
    8686        mov     esi, ecx
    8787%endif
     
    9292        mov     rsi, r9
    9393%endif
    94 %ifdef __X86__
     94%ifdef RT_ARCH_X86
    9595        mov     esi, ecx
    9696%endif
     
    103103align 16
    104104.strlen:
    105 %ifdef __AMD64__
     105%ifdef RT_ARCH_AMD64
    106106 %ifdef ASM_CALL64_MSC
    107107        mov     r9, rdi                 ; save rdi
     
    120120        mov     rdi, r9
    121121%endif
    122 %ifdef __X86__
     122%ifdef RT_ARCH_X86
    123123        mov     edi, edx
    124124%endif
  • trunk/src/VBox/Runtime/string/strchr_alias.c

    r2981 r3672  
    2727#undef strchr
    2828
    29 #if defined(__DARWIN__) || defined(__WIN__)
     29#if defined(RT_OS_DARWIN) || defined(RT_OS_WINDOWS)
    3030# ifndef __MINGW32__
    3131#  pragma weak strchr
  • trunk/src/VBox/Runtime/string/strcmp.asm

    r2988 r3672  
    2929BEGINPROC RT_NOCRT(strcmp)
    3030        ; input
    31 %ifdef __AMD64__
     31%ifdef RT_ARCH_AMD64
    3232 %ifdef ASM_CALL64_MSC
    3333  %define psz1 rcx
  • trunk/src/VBox/Runtime/string/strcmp_alias.c

    r2981 r3672  
    2727#undef strcmp
    2828
    29 #if defined(__DARWIN__) || defined(__WIN__)
     29#if defined(RT_OS_DARWIN) || defined(RT_OS_WINDOWS)
    3030# ifndef __MINGW32__
    3131#  pragma weak strcmp
  • trunk/src/VBox/Runtime/string/strncmp.cpp

    r2981 r3672  
    2828#endif
    2929    (const char *pszStr1, const char *pszStr2, size_t cb)
    30 #if defined(__THROW) && !defined(__WIN__) && !defined(__OS2__)
     30#if defined(__THROW) && !defined(RT_OS_WINDOWS) && !defined(RT_OS_OS2)
    3131    __THROW
    3232#endif
  • trunk/src/VBox/Runtime/string/strpbrk.cpp

    r2981 r3672  
    4040#else
    4141char *strpbrk(const char *pszStr, const char *pszChars)
    42 # if defined(__THROW) && !defined(__WIN__) && !defined(__OS2__)
     42# if defined(__THROW) && !defined(RT_OS_WINDOWS) && !defined(RT_OS_OS2)
    4343    __THROW
    4444# endif
  • trunk/src/VBox/Runtime/testcase/tstInlineAsm.cpp

    r2981 r3672  
    6262
    6363
    64 #if !defined(PIC) || !defined(__X86__)
     64#if !defined(PIC) || !defined(RT_ARCH_X86)
    6565const char *getCacheAss(unsigned u)
    6666{
     
    543543
    544544
    545 #ifdef __AMD64__
     545#ifdef RT_ARCH_AMD64
    546546static void tstASMAtomicXchgU128(void)
    547547{
     
    867867     * Execute the tests.
    868868     */
    869 #if !defined(PIC) || !defined(__X86__)
     869#if !defined(PIC) || !defined(RT_ARCH_X86)
    870870    tstASMCpuId();
    871871#endif
     
    874874    tstASMAtomicXchgU32();
    875875    tstASMAtomicXchgU64();
    876 #ifdef __AMD64__
     876#ifdef RT_ARCH_AMD64
    877877    tstASMAtomicXchgU128();
    878878#endif
  • trunk/src/VBox/Runtime/testcase/tstIoCtl.cpp

    r2981 r3672  
    4343#include <iprt/uuid.h>
    4444
    45 #ifdef __L4ENV__
     45#ifdef RT_OS_L4
    4646extern char **__environ;
    4747char *myenv[] = { "+all.e", NULL };
     
    5050int main()
    5151{
    52 #ifdef __L4ENV__
     52#ifdef RT_OS_L4
    5353    __environ = myenv;
    5454#endif
  • trunk/src/VBox/Runtime/testcase/tstLdrDisasmTest.cpp

    r2981 r3672  
    3434#include <iprt/string.h>
    3535
    36 #if defined(IN_RING0) && !defined(__WIN__) /* Too lazy to make import libs. */
     36#if defined(IN_RING0) && !defined(RT_OS_WINDOWS) /* Too lazy to make import libs. */
    3737extern "C" DECLIMPORT(int) MyPrintf(const char *pszFormat, ...);
    3838# define MY_PRINTF(a) MyPrintf a
  • trunk/src/VBox/Runtime/testcase/tstPath.cpp

    r3365 r3672  
    7272        "relative_base/dir\\",          "\\from_root",
    7373        "relative_base/dir/",           "relative_also",
    74 #if defined (__OS2__) || defined (__WIN__)
     74#if defined (RT_OS_OS2) || defined (RT_OS_WINDOWS)
    7575        NULL,                           "C:\\",
    7676        "C:\\",                         "..",
  • trunk/src/VBox/Runtime/testcase/tstTime-2.cpp

    r2981 r3672  
    2323*   Header Files                                                               *
    2424*******************************************************************************/
    25 #ifdef __WIN__
     25#ifdef RT_OS_WINDOWS
    2626# include <Windows.h>
    2727
    28 #elif defined __L4__
     28#elif defined RT_OS_L4
    2929
    3030#else /* posix */
     
    4040DECLINLINE(uint64_t) OSNanoTS(void)
    4141{
    42 #ifdef __WIN__
     42#ifdef RT_OS_WINDOWS
    4343    uint64_t u64; /* manual say larger integer, should be safe to assume it's the same. */
    4444    GetSystemTimeAsFileTime((LPFILETIME)&u64);
    4545    return u64 * 100;
    4646
    47 #elif defined __L4__
     47#elif defined RT_OS_L4
    4848    /** @todo fix a different timesource on l4. */
    4949    return RTTimeNanoTS();
     
    9696                 u64OSElapsedTS, u64RTElapsedTS, u64OSElapsedTS - u64RTElapsedTS);
    9797
    98 #if defined __WIN__ || defined __LINUX__
     98#if defined RT_OS_WINDOWS || defined RT_OS_LINUX
    9999    RTPrintf("tstTime-2: RTTime1nsSteps -> %u out of %u calls\n", RTTime1nsSteps(), NUMBER_OF_CALLS);
    100100#endif
  • trunk/src/VBox/Runtime/testcase/tstTime-3.cpp

    r2981 r3672  
    2323*   Header Files                                                               *
    2424*******************************************************************************/
    25 #ifdef __WIN__
     25#ifdef RT_OS_WINDOWS
    2626# include <Windows.h>
    2727
    28 #elif defined __L4__
     28#elif defined RT_OS_L4
    2929
    3030#else /* posix */
     
    4242DECLINLINE(uint64_t) OSNanoTS(void)
    4343{
    44 #ifdef __WIN__
     44#ifdef RT_OS_WINDOWS
    4545    uint64_t u64; /* manual say larger integer, should be safe to assume it's the same. */
    4646    GetSystemTimeAsFileTime((LPFILETIME)&u64);
    4747    return u64 * 100;
    4848
    49 #elif defined __L4__
     49#elif defined RT_OS_L4
    5050    /** @todo fix a different timesource on l4. */
    5151    return RTTimeNanoTS();
  • trunk/src/VBox/Runtime/testcase/tstTime.cpp

    r2981 r3672  
    2323*   Header Files                                                               *
    2424*******************************************************************************/
    25 #ifdef __WIN__
     25#ifdef RT_OS_WINDOWS
    2626# include <Windows.h>
    2727
    28 #elif defined __L4__
     28#elif defined RT_OS_L4
    2929
    3030#else /* posix */
     
    4040DECLINLINE(uint64_t) OSNanoTS(void)
    4141{
    42 #ifdef __WIN__
     42#ifdef RT_OS_WINDOWS
    4343    uint64_t u64; /* manual say larger integer, should be safe to assume it's the same. */
    4444    GetSystemTimeAsFileTime((LPFILETIME)&u64);
    4545    return u64 * 100;
    4646
    47 #elif defined __L4__
     47#elif defined RT_OS_L4
    4848    /** @todo fix a different timesource on l4. */
    4949    return RTTimeNanoTS();
  • trunk/src/VBox/Runtime/timesup.cpp

    r3393 r3672  
    8686        {
    8787            u32TransactionId = pGip->aCPUs[0].u32TransactionId;
    88 #ifdef __L4__
     88#ifdef RT_OS_L4
    8989            Assert((u32TransactionId & 1) == 0);
    9090#endif
     
    113113
    114114            u32TransactionId = pGipCpu->u32TransactionId;
    115 #ifdef __L4__
     115#ifdef RT_OS_L4
    116116            Assert((u32TransactionId & 1) == 0);
    117117#endif
     
    142142        u64Delta = u32UpdateIntervalTSC;
    143143    }
    144 #if !defined(_MSC_VER) || defined(__AMD64__) /* GCC makes very pretty code from these two inline calls, while MSC cannot. */
     144#if !defined(_MSC_VER) || defined(RT_ARCH_AMD64) /* GCC makes very pretty code from these two inline calls, while MSC cannot. */
    145145    u64Delta = ASMMult2xU32RetU64((uint32_t)u64Delta, u32NanoTSFactor0);
    146146    u64Delta = ASMDivU64ByU32RetU32(u64Delta, u32UpdateIntervalTSC);
  • trunk/src/VBox/Runtime/utf-8.cpp

    r2981 r3672  
    974974{
    975975    /** @todo implement proper UTF-8 case-insensitive string comparison. */
    976 #ifdef __WIN__
     976#ifdef RT_OS_WINDOWS
    977977    return stricmp(psz1, psz2);
    978 #else /* !__WIN32__ */
     978#else /* !RT_OS_WINDOWS */
    979979    return strcasecmp(psz1, psz2);
    980 #endif /* !__WIN32__ */
    981 }
     980#endif /* !RT_OS_WINDOWS */
     981}
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