- Timestamp:
- Jul 17, 2007 12:39:30 PM (17 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 100 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/SUPDRV.h
r3621 r3672 41 41 42 42 43 #if defined( __WIN__)43 #if defined(RT_OS_WINDOWS) 44 44 __BEGIN_DECLS 45 45 # if (_MSC_VER >= 1400) && !defined(VBOX_WITH_PATCHED_DDK) … … 61 61 __END_DECLS 62 62 63 #elif defined( __LINUX__)63 #elif defined(RT_OS_LINUX) 64 64 # include <linux/autoconf.h> 65 65 # include <linux/version.h> … … 86 86 # include <linux/timer.h> 87 87 88 #elif defined( __DARWIN__)88 #elif defined(RT_OS_DARWIN) 89 89 # include <libkern/libkern.h> 90 90 # include <iprt/string.h> 91 91 92 #elif defined( __OS2__)93 94 #elif defined( __FREEBSD__)92 #elif defined(RT_OS_OS2) 93 94 #elif defined(RT_OS_FREEBSD) 95 95 # include <sys/libkern.h> 96 96 # include <iprt/string.h> … … 117 117 * Win32 118 118 */ 119 #if defined( __WIN__)119 #if defined(RT_OS_WINDOWS) 120 120 121 121 /* debug printf */ … … 126 126 * to actually be much lower. The values here have been determined experimentally. 127 127 */ 128 #ifdef __X86__128 #ifdef RT_ARCH_X86 129 129 # define MAX_LOCK_MEM_SIZE (32*1024*1024) /* 32mb */ 130 130 #endif 131 #ifdef __AMD64__131 #ifdef RT_ARCH_AMD64 132 132 # define MAX_LOCK_MEM_SIZE (24*1024*1024) /* 24mb */ 133 133 #endif … … 137 137 * Linux 138 138 */ 139 #elif defined( __LINUX__)139 #elif defined(RT_OS_LINUX) 140 140 141 141 /* check kernel version */ … … 155 155 * Darwin 156 156 */ 157 #elif defined( __DARWIN__)157 #elif defined(RT_OS_DARWIN) 158 158 159 159 /* debug printf */ … … 164 164 * OS/2 165 165 */ 166 #elif defined( __OS2__)166 #elif defined(RT_OS_OS2) 167 167 168 168 /* No log API in OS/2 only COM port. */ … … 173 173 * FreeBSD 174 174 */ 175 #elif defined( __FREEBSD__)175 #elif defined(RT_OS_FREEBSD) 176 176 177 177 /* No log API in OS/2 only COM port. */ … … 198 198 199 199 /* dprintf2 - extended logging. */ 200 #if defined( __DARWIN__) || defined(__OS2__)200 #if defined(RT_OS_DARWIN) || defined(RT_OS_OS2) 201 201 # define dprintf2 dprintf 202 202 #else … … 250 250 /** Segment Selector. */ 251 251 uint32_t u16SegSel : 16; 252 #ifdef __AMD64__252 #ifdef RT_ARCH_AMD64 253 253 /** Interrupt Stack Table index. */ 254 254 uint32_t u3IST : 3; … … 269 269 /** High offset word. */ 270 270 uint32_t u16OffsetHigh : 16; 271 #ifdef __AMD64__271 #ifdef RT_ARCH_AMD64 272 272 /** The upper top part of the address. */ 273 273 uint32_t u32OffsetTop; … … 381 381 struct 382 382 { 383 #if defined( __WIN__)383 #if defined(RT_OS_WINDOWS) 384 384 /** Pointer to memory descriptor list (MDL). */ 385 385 PMDL *papMdl; 386 386 unsigned cMdls; 387 #elif defined( __LINUX__)387 #elif defined(RT_OS_LINUX) 388 388 struct page **papPages; 389 389 unsigned cPages; … … 394 394 struct 395 395 { 396 #if defined( __WIN__)396 #if defined(RT_OS_WINDOWS) 397 397 /** Pointer to memory descriptor list (MDL). */ 398 398 PMDL pMdl; 399 #elif defined( __LINUX__)399 #elif defined(RT_OS_LINUX) 400 400 struct page *paPages; 401 401 unsigned cPages; … … 406 406 struct 407 407 { 408 #if defined( __WIN__)408 #if defined(RT_OS_WINDOWS) 409 409 /** Pointer to memory descriptor list (MDL). */ 410 410 PMDL pMdl; 411 #elif defined( __LINUX__)411 #elif defined(RT_OS_LINUX) 412 412 /** Pointer to the array of page pointers. */ 413 413 struct page **papPages; … … 572 572 /** Which process this session is associated with. */ 573 573 RTR0PROCESS R0Process; 574 #if defined( __OS2__)574 #if defined(RT_OS_OS2) 575 575 /** The system file number of this session. */ 576 576 uint16_t sfn; 577 577 uint16_t Alignment; /**< Alignment */ 578 578 #endif 579 #if defined( __DARWIN__) || defined(__OS2__)579 #if defined(RT_OS_DARWIN) || defined(RT_OS_OS2) 580 580 /** Pointer to the next session with the same hash. */ 581 581 PSUPDRVSESSION pNextHash; … … 644 644 uint32_t u32SystemTimerGranularityGrant; 645 645 #endif 646 #ifdef __WIN__646 #ifdef RT_OS_WINDOWS 647 647 /** The GIP timer object. */ 648 648 KTIMER GipTimer; … … 656 656 ULONG ulGipTimerInterval; 657 657 #endif 658 #ifdef __LINUX__658 #ifdef RT_OS_LINUX 659 659 /** The last jiffies. */ 660 660 unsigned long ulLastJiffies; -
trunk/src/VBox/HostDrivers/Support/SUPDRVIOC.h
r3537 r3672 34 34 * and 64-bit processes. 35 35 */ 36 #ifdef __AMD64__36 #ifdef RT_ARCH_AMD64 37 37 # define SUP_IOCTL_FLAG 128 38 #elif defined( __X86__)38 #elif defined(RT_ARCH_X86) 39 39 # define SUP_IOCTL_FLAG 0 40 40 #else … … 42 42 #endif 43 43 44 #ifdef __WIN__44 #ifdef RT_OS_WINDOWS 45 45 # define SUP_CTL_CODE(Function) CTL_CODE(FILE_DEVICE_UNKNOWN, (Function) | SUP_IOCTL_FLAG, METHOD_BUFFERED, FILE_WRITE_ACCESS) 46 46 # define SUP_CTL_CODE_FAST(Function) CTL_CODE(FILE_DEVICE_UNKNOWN, (Function) | SUP_IOCTL_FLAG, METHOD_NEITHER, FILE_WRITE_ACCESS) … … 64 64 # endif 65 65 66 #elif defined( __OS2__)66 #elif defined(RT_OS_OS2) 67 67 # define SUP_CTL_CATEGORY 0xc0 68 68 # define SUP_CTL_CODE(Function) ((unsigned char)(Function)) … … 70 70 # define SUP_CTL_CODE_FAST(Function) ((unsigned char)(Function)) 71 71 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. */ 74 74 # define SUP_CTL_CODE(Function) \ 75 75 ( (3U << 30) | ((0x22) << 8) | ((Function) | SUP_IOCTL_FLAG) | (sizeof(SUPDRVIOCTLDATA) << 16) ) … … 87 87 # endif 88 88 89 #elif defined( __L4__)89 #elif defined(RT_OS_L4) 90 90 # define SUP_CTL_CODE(Function) \ 91 91 ( (3U << 30) | ((0x22) << 8) | ((Function) | SUP_IOCTL_FLAG) | (sizeof(SUPDRVIOCTLDATA) << 16) ) … … 150 150 * Structures and Typedefs * 151 151 *******************************************************************************/ 152 #ifdef __AMD64__152 #ifdef RT_ARCH_AMD64 153 153 # pragma pack(8) /* paranoia. */ 154 154 #else … … 156 156 #endif 157 157 158 #ifndef __WIN__158 #ifndef RT_OS_WINDOWS 159 159 /** 160 160 * Structure used by OSes with less advanced ioctl interfaces, i.e. most … … 167 167 void *pvOut; 168 168 unsigned long cbOut; 169 #ifdef __OS2__169 #ifdef RT_OS_OS2 170 170 int rc; 171 171 #endif -
trunk/src/VBox/HostDrivers/Support/SUPDRVShared.c
r3537 r3672 260 260 /* objects. */ 261 261 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! */ 263 263 Assert(!pObj); /* (can trigger on forced unloads) */ 264 264 #endif … … 2762 2762 static uint8_t au8Ints[] = 2763 2763 { 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, 2765 2765 * local apic timer, or some other frequently fireing thing). */ 2766 2766 0xef, 0xee, 0xed, 0xec, … … 2771 2771 0xbf, 0xbe, 0xbd, 0xbc, 2772 2772 }; 2773 #if defined( __AMD64__) && defined(DEBUG)2773 #if defined(RT_ARCH_AMD64) && defined(DEBUG) 2774 2774 static int s_iWobble = 0; 2775 2775 unsigned iMax = !(s_iWobble++ % 2) ? 0x80 : 0x100; … … 2826 2826 pPatch->ChangedIdt.u16OffsetLow = (uint32_t)((uintptr_t)&pPatch->auCode[0] & 0xffff); 2827 2827 pPatch->ChangedIdt.u16OffsetHigh = (uint32_t)((uintptr_t)&pPatch->auCode[0] >> 16); 2828 #ifdef __AMD64__2828 #ifdef RT_ARCH_AMD64 2829 2829 pPatch->ChangedIdt.u32OffsetTop = (uint32_t)((uintptr_t)&pPatch->auCode[0] >> 32); 2830 2830 #endif 2831 2831 pPatch->ChangedIdt.u16SegSel = ASMGetCS(); 2832 #ifdef __AMD64__2832 #ifdef RT_ARCH_AMD64 2833 2833 pPatch->ChangedIdt.u3IST = 0; 2834 2834 pPatch->ChangedIdt.u5Reserved = 0; … … 2845 2845 */ 2846 2846 { 2847 #ifdef __AMD64__2847 #ifdef RT_ARCH_AMD64 2848 2848 union 2849 2849 { … … 2876 2876 * reserve some stack space for the interrupt forwarding. 2877 2877 */ 2878 # ifdef __WIN__2878 # ifdef RT_OS_WINDOWS 2879 2879 *u.pb++ = 0x50; // push rax ; alignment filler. 2880 2880 *u.pb++ = 0x41; // push r8 ; uArg … … 2950 2950 *u.pb++ = 0xcb; 2951 2951 2952 #else /* __X86__*/2952 #else /* RT_ARCH_X86 */ 2953 2953 2954 2954 union … … 3001 3001 *u.pb++ = 0xc0; 3002 3002 3003 #ifdef __WIN__3003 #ifdef RT_OS_WINDOWS 3004 3004 *u.pb++ = 0xb8; // mov eax, KernelFS 3005 3005 *u.pu32++ = ASMGetFS(); … … 3056 3056 *uFixJmpNotNested.pu16++ = pPatch->SavedIdt.u16SegSel; 3057 3057 } 3058 #endif /* __X86__*/3058 #endif /* RT_ARCH_X86 */ 3059 3059 Assert(u.pb <= &pPatch->auCode[sizeof(pPatch->auCode)]); 3060 3060 #if 0 … … 3234 3234 3235 3235 /* Update IDT Entry */ 3236 #ifdef __AMD64__3236 #ifdef RT_ARCH_AMD64 3237 3237 ASMAtomicXchgU128((volatile uint128_t *)pvIdtEntry, *(uint128_t *)(uintptr_t)pNewIDTEntry); 3238 3238 #else … … 3629 3629 for (pPatch = pDevExt->pIdtPatches; pPatch; pPatch = pPatch->pNext) 3630 3630 { 3631 # ifdef __AMD64__3631 # ifdef RT_ARCH_AMD64 3632 3632 ASMAtomicXchgU64((volatile uint64_t *)&pPatch->auCode[pPatch->offVMMR0EntryFixup], (uint64_t)pvVMMR0); 3633 # else /* __X86__*/3633 # else /* RT_ARCH_X86 */ 3634 3634 ASMAtomicXchgU32((volatile uint32_t *)&pPatch->auCode[pPatch->offVMMR0EntryFixup], 3635 3635 (uint32_t)pvVMMR0 - (uint32_t)&pPatch->auCode[pPatch->offVMMR0EntryFixup + 4]); … … 3672 3672 for (pPatch = pDevExt->pIdtPatches; pPatch; pPatch = pPatch->pNext) 3673 3673 { 3674 # ifdef __AMD64__3674 # ifdef RT_ARCH_AMD64 3675 3675 ASMAtomicXchgU64((volatile uint64_t *)&pPatch->auCode[pPatch->offVMMR0EntryFixup], 3676 3676 (uint64_t)&pPatch->auCode[pPatch->offStub]); 3677 # else /* __X86__*/3677 # else /* RT_ARCH_X86 */ 3678 3678 ASMAtomicXchgU32((volatile uint32_t *)&pPatch->auCode[pPatch->offVMMR0EntryFixup], 3679 3679 (uint32_t)&pPatch->auCode[pPatch->offStub] - (uint32_t)&pPatch->auCode[pPatch->offVMMR0EntryFixup + 4]); … … 4298 4298 if (pGip->u64NanoTSLastUpdateHz) 4299 4299 { 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. */ 4301 4301 uint64_t u64Delta = u64NanoTS - pGip->u64NanoTSLastUpdateHz; 4302 4302 uint32_t u32UpdateHz = (uint32_t)((UINT64_C(1000000000) * GIP_UPDATEHZ_RECALC_FREQ) / u64Delta); -
trunk/src/VBox/HostDrivers/Support/SUPLib.cpp
r3537 r3672 807 807 * Generate the code. 808 808 */ 809 #ifdef __AMD64__809 #ifdef RT_ARCH_AMD64 810 810 /* 811 811 * reg params: -
trunk/src/VBox/HostDrivers/Support/linux/Makefile
r3400 r3672 123 123 export INCL 124 124 endif 125 KFLAGS := -D__KERNEL__ -DMODULE -D __LINUX__-DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0125 KFLAGS := -D__KERNEL__ -DMODULE -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 126 126 ifndef CONFIG_VBOXDRV_FIXEDMAJOR 127 127 KFLAGS += -DCONFIG_VBOXDRV_AS_MISC 128 128 endif 129 129 ifeq ($(BUILD_TARGET_ARCH),amd64) 130 KFLAGS += -D __AMD64__130 KFLAGS += -DRT_ARCH_AMD64 131 131 else 132 KFLAGS += -D __X86__132 KFLAGS += -DRT_ARCH_X86 133 133 endif 134 134 #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 121 121 * This sucks soooo badly on x86! Why don't they export __PAGE_KERNEL_EXEC so PAGE_KERNEL_EXEC would be usable? 122 122 */ 123 #if defined( __AMD64__)123 #if defined(RT_ARCH_AMD64) 124 124 # define MY_PAGE_KERNEL_EXEC PAGE_KERNEL_EXEC 125 125 #elif defined(PAGE_KERNEL_EXEC) && defined(CONFIG_X86_PAE) … … 149 149 # endif 150 150 151 # ifndef __AMD64__151 # ifndef RT_ARCH_AMD64 152 152 /* In 2.6.9-22.ELsmp we have to call change_page_attr() twice when changing 153 153 * the page attributes from PAGE_KERNEL to something else, because there appears … … 170 170 171 171 #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(). */ 173 173 # define MY_CHANGE_PAGE_ATTR(pPages, cPages, prot) \ 174 174 do { \ … … 205 205 * and disabled on i386. 206 206 */ 207 # if defined( __AMD64__)207 # if defined(RT_ARCH_AMD64) 208 208 # if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 21) 209 209 # define DO_DISABLE_NMI 1 … … 267 267 #define DEVICE_NAME "vboxdrv" 268 268 269 #ifdef __AMD64__269 #ifdef RT_ARCH_AMD64 270 270 /** 271 271 * Memory for the executable memory heap (in IPRT). … … 608 608 if (RT_SUCCESS(rc)) 609 609 { 610 #ifdef __AMD64__610 #ifdef RT_ARCH_AMD64 611 611 rc = RTR0MemExecDonate(&g_abExecMemory[0], sizeof(g_abExecMemory)); 612 612 #endif … … 1025 1025 * Allocate page pointer array. 1026 1026 */ 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). */ 1028 1028 paPages = alloc_pages(GFP_DMA, cOrder); 1029 1029 #else -
trunk/src/VBox/HostDrivers/Support/win/SUPDrv-win.cpp
r3542 r3672 49 49 * Structures and Typedefs * 50 50 *******************************************************************************/ 51 #if 0 //def __AMD64__51 #if 0 //def RT_ARCH_AMD64 52 52 typedef struct SUPDRVEXECMEM 53 53 { … … 328 328 pStack->Parameters.DeviceIoControl.OutputBufferLength, pSession)); 329 329 330 #ifdef __AMD64__330 #ifdef RT_ARCH_AMD64 331 331 /* Don't allow 32-bit processes to do any I/O controls. */ 332 332 if (!IoIs32bitProcess(pIrp)) … … 360 360 pStack->Parameters.DeviceIoControl.IoControlCode)); 361 361 } 362 #ifdef __AMD64__362 #ifdef RT_ARCH_AMD64 363 363 else 364 364 dprintf(("VBoxSupDrvDeviceControlSlow: WOW64 req - not supported\n")); … … 613 613 * Done, setup pMem and return values. 614 614 */ 615 #ifdef __AMD64__615 #ifdef RT_ARCH_AMD64 616 616 MmProtectMdlSystemAddress(pMem->u.cont.pMdl, PAGE_EXECUTE_READWRITE); 617 617 #endif … … 1069 1069 dprintf2(("supdrvOSGipSuspend:\n")); 1070 1070 KeCancelTimer(&pDevExt->GipTimer); 1071 #ifdef __AMD64__1071 #ifdef RT_ARCH_AMD64 1072 1072 ExSetTimerResolution(0, FALSE); 1073 1073 #endif … … 1084 1084 void *VBOXCALL supdrvOSExecAlloc(size_t cb) 1085 1085 { 1086 #if 0 //def __AMD64__1086 #if 0 //def RT_ARCH_AMD64 1087 1087 cb = RT_ALIGN_Z(cb, PAGE_SIZE); 1088 1088 void *pv = ExAllocatePoolWithTag(NonPagedPool, cb, SUPDRV_NT_POOL_TAG); -
trunk/src/VBox/HostDrivers/Support/win/SUPDrvA-win.asm
r3542 r3672 26 26 27 27 BEGINCODE 28 %ifdef __AMD64__28 %ifdef RT_ARCH_AMD64 29 29 %define _DbgPrint DbgPrint 30 30 %endif -
trunk/src/VBox/Runtime/RTErrConvertFromErrno.cpp
r2981 r3672 28 28 #include <iprt/err.h> 29 29 30 #if defined( __DARWIN__) && defined(KERNEL)30 #if defined(RT_OS_DARWIN) && defined(KERNEL) 31 31 # include <sys/errno.h> 32 32 #else -
trunk/src/VBox/Runtime/VBox/RTAssertDoBreakpoint-vbox.cpp
r2981 r3672 33 33 #if !defined(VBOX_RTASSERT_WITH_GDB) \ 34 34 && !defined(IN_GUEST) \ 35 && ((!defined( __OS2__) && !defined(__WIN__)) || defined(__DOXGYEN__))35 && ((!defined(RT_OS_OS2) && !defined(RT_OS_WINDOWS)) || defined(__DOXGYEN__)) 36 36 # define VBOX_ASSERT_WITH_GDB 37 37 #endif -
trunk/src/VBox/Runtime/VBox/log-vbox.cpp
r2981 r3672 124 124 *******************************************************************************/ 125 125 #ifdef IN_RING3 126 # if defined( __WIN__)126 # if defined(RT_OS_WINDOWS) 127 127 # include <Windows.h> 128 # elif defined( __LINUX__)128 # elif defined(RT_OS_LINUX) 129 129 # include <unistd.h> 130 # elif defined( __L4__)130 # elif defined(RT_OS_L4) 131 131 # include <l4/vboxserver/vboxserver.h> 132 # elif defined( __OS2__)132 # elif defined(RT_OS_OS2) 133 133 # include <stdlib.h> 134 134 # endif … … 297 297 298 298 /* executable and arguments - tricky and all platform specific. */ 299 # if defined( __WIN__)299 # if defined(RT_OS_WINDOWS) 300 300 RTLogLoggerEx(pLogger, 0, ~0U, "Commandline: %ls\n", GetCommandLineW()); 301 301 302 # elif defined( __LINUX__) || defined(__FREEBSD__)303 # ifdef __LINUX__302 # elif defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD) 303 # ifdef RT_OS_LINUX 304 304 FILE *pFile = fopen("/proc/self/cmdline", "r"); 305 305 # else … … 332 332 } 333 333 334 # elif defined( __L4__) || defined(__OS2__) || defined(__DARWIN__)334 # elif defined(RT_OS_L4) || defined(RT_OS_OS2) || defined(RT_OS_DARWIN) 335 335 /* commandline? */ 336 336 # else -
trunk/src/VBox/Runtime/dir.cpp
r3364 r3672 25 25 *******************************************************************************/ 26 26 #define LOG_GROUP RTLOGGROUP_DIR 27 #ifdef __WIN__27 #ifdef RT_OS_WINDOWS 28 28 # include <Windows.h> 29 29 #else … … 71 71 /* skip the root slash if any */ 72 72 if ( psz[0] == '/' 73 #if defined( __WIN__) || defined(__OS2__)73 #if defined(RT_OS_WINDOWS) || defined(RT_OS_OS2) 74 74 || psz[0] == '\\' 75 75 #endif … … 83 83 if (!*psz) 84 84 break; 85 #if defined( __WIN__) || defined(__OS2__)85 #if defined(RT_OS_WINDOWS) || defined(RT_OS_OS2) 86 86 psz = strpbrk(psz, "\\/"); 87 87 #else -
trunk/src/VBox/Runtime/errmsg.cpp
r2981 r3672 91 91 */ 92 92 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); 94 94 return &g_aUnknownMsgs[iMsg]; 95 95 } -
trunk/src/VBox/Runtime/fs.cpp
r2981 r3672 24 24 * Header Files * 25 25 *******************************************************************************/ 26 #ifndef __WIN__26 #ifndef RT_OS_WINDOWS 27 27 # define RTTIME_INCL_TIMESPEC 28 28 # include <sys/time.h> … … 169 169 170 170 171 #ifndef __WIN__171 #ifndef RT_OS_WINDOWS 172 172 /** 173 173 * Internal worker function which setups RTFSOBJINFO based on a UNIX stat struct. … … 275 275 } 276 276 277 #endif /* ! __WIN__*/277 #endif /* !RT_OS_WINDOWS */ -
trunk/src/VBox/Runtime/generic/RTDirQueryInfo-generic.cpp
r2981 r3672 26 26 *******************************************************************************/ 27 27 #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 */ 29 29 # include <Windows.h> 30 30 #else -
trunk/src/VBox/Runtime/generic/RTDirSetTimes-generic.cpp
r2981 r3672 26 26 *******************************************************************************/ 27 27 #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 */ 29 29 # include <Windows.h> 30 30 #else -
trunk/src/VBox/Runtime/generic/critsect-generic.cpp
r2981 r3672 38 38 * protected by a critsect atm. 39 39 */ 40 #if !defined(RTCRITSECT_STRICT) && defined(RT_STRICT) && !defined( __L4ENV__)40 #if !defined(RTCRITSECT_STRICT) && defined(RT_STRICT) && !defined(RT_OS_L4) 41 41 # define RTCRITSECT_STRICT 42 42 #endif -
trunk/src/VBox/Runtime/generic/semrw-generic.cpp
r1 r3672 24 24 * Header Files * 25 25 *******************************************************************************/ 26 #if defined( __WIN__)26 #if defined(RT_OS_WINDOWS) 27 27 # include <windows.h> 28 28 # include <psapi.h> … … 35 35 # endif 36 36 37 #elif defined( __LINUX__) || defined(__FREEBSD__)37 #elif defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD) 38 38 # define KPRF_USE_PTHREAD 39 39 # include <pthread.h> … … 48 48 # endif 49 49 50 #elif defined( __OS2__)50 #elif defined(RT_OS_OS2) 51 51 # define INCL_BASE 52 52 # include <os2s.h> … … 64 64 #define KPRF_NAME(Suffix) KPrf##Suffix 65 65 #define KPRF_TYPE(Prefix,Suffix) Prefix##KPRF##Suffix 66 #if defined( __OS2__) || defined(__WIN__)66 #if defined(RT_OS_OS2) || defined(RT_OS_WINDOWS) 67 67 # define KPRF_DECL_FUNC(type, name) extern "C" __declspec(dllexport) type __cdecl KPRF_NAME(name) 68 68 #else … … 90 90 #if defined(KPRF_USE_PTHREAD) 91 91 typedef pthread_mutex_t KPRF_TYPE(,MUTEX); 92 #elif defined( __WIN__)92 #elif defined(RT_OS_WINDOWS) 93 93 typedef CRITICAL_SECTION KPRF_TYPE(,MUTEX); 94 #elif defined( __OS2__)94 #elif defined(RT_OS_OS2) 95 95 typedef struct _fmutex KPRF_TYPE(,MUTEX); 96 96 #endif … … 102 102 /** Read/Write lock type. */ 103 103 typedef pthread_rwlock_t KPRF_TYPE(,RWLOCK); 104 #elif defined( __OS2__) || defined(__WIN__)104 #elif defined(RT_OS_OS2) || defined(RT_OS_WINDOWS) 105 105 /** Read/Write lock state. */ 106 106 typedef enum KPRF_TYPE(,RWLOCKSTATE) … … 128 128 /** The current number of waiting writers. */ 129 129 uint32_t cWritersWaiting; 130 # if defined( __WIN__)130 # if defined(RT_OS_WINDOWS) 131 131 /** The handle of the event object on which the waiting readers block. (manual reset). */ 132 132 HANDLE hevReaders; 133 133 /** The handle of the event object on which the waiting writers block. (manual reset). */ 134 134 HANDLE hevWriters; 135 # elif defined( __OS2__)135 # elif defined(RT_OS_OS2) 136 136 /** The handle of the event semaphore on which the waiting readers block. */ 137 137 HEV hevReaders; … … 162 162 return -1; 163 163 164 #elif defined( __WIN__)164 #elif defined(RT_OS_WINDOWS) 165 165 InitializeCriticalSection(pMutex); 166 166 return 0; 167 167 168 #elif defined( __OS2__)168 #elif defined(RT_OS_OS2) 169 169 if (!_fmutex_create(pMutex, 0)) 170 170 return 0; … … 183 183 pthread_mutex_destroy(pMutex); 184 184 185 #elif defined( __WIN__)185 #elif defined(RT_OS_WINDOWS) 186 186 DeleteCriticalSection(pMutex); 187 187 188 #elif defined( __OS2__)188 #elif defined(RT_OS_OS2) 189 189 _fmutex_close(pMutex); 190 190 #endif … … 197 197 static inline void kPrfMutexAcquire(KPRF_TYPE(P,MUTEX) pMutex) 198 198 { 199 #if defined( __WIN__)199 #if defined(RT_OS_WINDOWS) 200 200 EnterCriticalSection(pMutex); 201 201 … … 203 203 pthread_mutex_lock(pMutex); 204 204 205 #elif defined( __OS2__)205 #elif defined(RT_OS_OS2) 206 206 fmutex_request(pMutex); 207 207 #endif … … 215 215 static inline void kPrfMutexRelease(KPRF_TYPE(P,MUTEX) pMutex) 216 216 { 217 #if defined( __WIN__)217 #if defined(RT_OS_WINDOWS) 218 218 LeaveCriticalSection(pMutex); 219 219 … … 221 221 pthread_mutex_lock(pMutex); 222 222 223 #elif defined( __OS2__)223 #elif defined(RT_OS_OS2) 224 224 fmutex_request(pMutex); 225 225 #endif … … 242 242 return -1; 243 243 244 #elif defined( __WIN__) || defined(__OS2__)244 #elif defined(RT_OS_WINDOWS) || defined(RT_OS_OS2) 245 245 if (kPrfMutexInit(&pRWLock->Mutex)) 246 246 return -1; … … 249 249 pRWLock->cWritersWaiting = 0; 250 250 pRWLock->enmState = RWLOCK_STATE_SHARED; 251 # if defined( __WIN__)251 # if defined(RT_OS_WINDOWS) 252 252 pRWLock->hevReaders = CreateEvent(NULL, TRUE, TRUE, NULL); 253 253 pRWLock->hevWriters = CreateEvent(NULL, FALSE, FALSE, NULL); … … 258 258 CloseHandle(pRWLock->hevWriters); 259 259 260 # elif defined( __OS2__)260 # elif defined(RT_OS_OS2) 261 261 APIRET rc = DosCreateEventSem(NULL, &pRWLock->hevReaders, 0, TRUE); 262 262 if (!rc) … … 288 288 pthread_rwlock_destroy(pRWLock); 289 289 290 #elif defined( __WIN__) || defined(__OS2__)290 #elif defined(RT_OS_WINDOWS) || defined(RT_OS_OS2) 291 291 if (pRWLock->enmState == RWLOCK_STATE_UNINITIALIZED) 292 292 return; … … 297 297 pRWLock->cReadersWaiting = 0; 298 298 pRWLock->cWritersWaiting = 0; 299 # if defined( __WIN__)299 # if defined(RT_OS_WINDOWS) 300 300 CloseHandle(pRWLock->hevReaders); 301 301 pRWLock->hevReaders = INVALID_HANDLE_VALUE; … … 303 303 pRWLock->hevWriters = INVALID_HANDLE_VALUE; 304 304 305 # elif defined( __OS2__)305 # elif defined(RT_OS_OS2) 306 306 DosCloseEventSem(pRWLock->hevReaders); 307 307 pRWLock->hevReaders = NULLHANDLE; … … 322 322 pthread_rwlock_rdlock(pRWLock); 323 323 324 #elif defined( __WIN__) || defined(__OS2__)324 #elif defined(RT_OS_WINDOWS) || defined(RT_OS_OS2) 325 325 if (pRWLock->enmState == RWLOCK_STATE_UNINITIALIZED) 326 326 return; … … 338 338 /* have to wait */ 339 339 KPRF_ATOMIC_INC32(&pRWLock->cReadersWaiting); 340 # if defined( __WIN__)340 # if defined(RT_OS_WINDOWS) 341 341 HANDLE hev = pRWLock->hevReaders; 342 342 ResetEvent(hev); 343 343 344 # elif defined( __OS2__)344 # elif defined(RT_OS_OS2) 345 345 HEV hev = pRWLock->hevReaders; 346 346 ULONG cIgnored; … … 350 350 kPrfMutexRelease(&pRWLock->Mutex); 351 351 352 # if defined( __WIN__)352 # if defined(RT_OS_WINDOWS) 353 353 switch (WaitForSingleObject(hev, INFINITE)) 354 354 { … … 362 362 } 363 363 364 # elif defined( __OS2__)364 # elif defined(RT_OS_OS2) 365 365 switch (DosWaitEventSem(hev, SEM_INDEFINITE_WAIT)) 366 366 { … … 397 397 pthread_rwlock_unlock(pRWLock); 398 398 399 #elif defined( __WIN__) || defined(__OS2__)399 #elif defined(RT_OS_WINDOWS) || defined(RT_OS_OS2) 400 400 if (pRWLock->enmState == RWLOCK_STATE_UNINITIALIZED) 401 401 return; … … 421 421 * Wake up one (or more on OS/2) waiting writers. 422 422 */ 423 # if defined( __WIN__)423 # if defined(RT_OS_WINDOWS) 424 424 SetEvent(pRWLock->hevWriters); 425 # elif defined( __OS2__)425 # elif defined(RT_OS_OS2) 426 426 DosPostEvent(pRWLock->hevwriters); 427 427 # endif … … 441 441 pthread_rwlock_wrlock(pRWLock); 442 442 443 #elif defined( __WIN__) || defined(__OS2__)443 #elif defined(RT_OS_WINDOWS) || defined(RT_OS_OS2) 444 444 if (pRWLock->enmState == RWLOCK_STATE_UNINITIALIZED) 445 445 return; … … 464 464 for (;;) 465 465 { 466 # if defined( __WIN__)466 # if defined(RT_OS_WINDOWS) 467 467 HANDLE hev = pRWLock->hevWriters; 468 # elif defined( __OS2__)468 # elif defined(RT_OS_OS2) 469 469 HEV hev = pRWLock->hevWriters; 470 470 # endif 471 471 kPrfMutexRelease(&pRWLock->Mutex); 472 # if defined( __WIN__)472 # if defined(RT_OS_WINDOWS) 473 473 switch (WaitForSingleObject(hev, INFINITE)) 474 474 { … … 483 483 } 484 484 485 # elif defined( __OS2__)485 # elif defined(RT_OS_OS2) 486 486 switch (DosWaitEventSem(hev, SEM_INDEFINITE_WAIT)) 487 487 { … … 527 527 pthread_rwlock_unlock(pRWLock); 528 528 529 #elif defined( __WIN__) || defined(__OS2__)529 #elif defined(RT_OS_WINDOWS) || defined(RT_OS_OS2) 530 530 if (pRWLock->enmState == RWLOCK_STATE_UNINITIALIZED) 531 531 return; … … 552 552 * Someone is waiting, wake them up as we change the state. 553 553 */ 554 # if defined( __WIN__)554 # if defined(RT_OS_WINDOWS) 555 555 HANDLE hev = INVALID_HANDLE_VALUE; 556 # elif defined( __OS2__)556 # elif defined(RT_OS_OS2) 557 557 HEV hev = NULLHANDLE; 558 558 # endif … … 568 568 hev = pRWLock->hevReaders; 569 569 } 570 # if defined( __WIN__)570 # if defined(RT_OS_WINDOWS) 571 571 SetEvent(hev); 572 # elif defined( __OS2__)572 # elif defined(RT_OS_OS2) 573 573 DosPostEvent(pRWLock->hevwriters); 574 574 # endif -
trunk/src/VBox/Runtime/include/internal/dir.h
r2981 r3672 79 79 #endif 80 80 81 #ifdef __WIN__81 #ifdef RT_OS_WINDOWS 82 82 /** Handle to the opened directory search. */ 83 83 HANDLE hDir; -
trunk/src/VBox/Runtime/include/internal/fs.h
r2981 r3672 24 24 25 25 #include <iprt/types.h> 26 #ifndef __WIN__26 #ifndef RT_OS_WINDOWS 27 27 # include <sys/stat.h> 28 28 #endif … … 37 37 38 38 size_t rtPathVolumeSpecLen(const char *pszPath); 39 #ifndef __WIN__39 #ifndef RT_OS_WINDOWS 40 40 void rtFsConvertStatToObjInfo(PRTFSOBJINFO pObjInfo, const struct stat *pStat, const char *pszName, unsigned cbName); 41 41 #endif 42 42 43 #ifdef __LINUX__43 #ifdef RT_OS_LINUX 44 44 # ifdef __USE_MISC 45 45 # define HAVE_STAT_TIMESPEC_BRIEF -
trunk/src/VBox/Runtime/include/internal/path.h
r2981 r3672 29 29 extern char g_szrtProgramPath[RTPATH_MAX]; 30 30 31 #if defined( __OS2__) || defined(__WIN__)31 #if defined(RT_OS_OS2) || defined(RT_OS_WINDOWS) 32 32 # define HAVE_UNC 1 33 33 # define HAVE_DRIVE 1 -
trunk/src/VBox/Runtime/include/internal/thread.h
r2981 r3672 88 88 /** The current thread state. */ 89 89 RTTHREADSTATE volatile enmState; 90 #if defined( __WIN__) && defined(IN_RING3)90 #if defined(RT_OS_WINDOWS) && defined(IN_RING3) 91 91 /** The thread handle. 92 92 * This is not valid until the create function has returned! */ … … 190 190 191 191 #ifdef IN_RING3 192 # ifdef __WIN__192 # ifdef RT_OS_WINDOWS 193 193 /** 194 194 * Callback for when a native thread is detaching. -
trunk/src/VBox/Runtime/ldrkLdr.cpp
r2981 r3672 557 557 } 558 558 559 #if defined( __OS2__) || (defined(__DARWIN__) && defined(__X86__))559 #if defined(RT_OS_OS2) || (defined(RT_OS_DARWIN) && defined(RT_ARCH_X86)) 560 560 /* skip the underscore prefix. */ 561 561 if (*pszSymbol == '_') … … 624 624 } 625 625 626 #if defined( __OS2__) || (defined(__DARWIN__) && defined(__X86__))626 #if defined(RT_OS_OS2) || (defined(RT_OS_DARWIN) && defined(RT_ARCH_X86)) 627 627 /* skip the underscore prefix. */ 628 628 if (*pszSymbol == '_') … … 661 661 KLDRADDR uValue; 662 662 663 #if defined( __OS2__) || (defined(__DARWIN__) && defined(__X86__))663 #if defined(RT_OS_OS2) || (defined(RT_OS_DARWIN) && defined(RT_ARCH_X86)) 664 664 /* 665 665 * Add underscore prefix. -
trunk/src/VBox/Runtime/log.cpp
r3502 r3672 226 226 { 227 227 pLogger->pfnLogger = *(PFNRTLOGGER*)&pu8Code; 228 #ifdef __AMD64__228 #ifdef RT_ARCH_AMD64 229 229 /* this wrapper will not be used on AMD64, we will be requiring C99 compilers there. */ 230 230 *pu8Code++ = 0xcc; … … 1468 1468 va_list args; 1469 1469 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) 1471 1471 /* manually align the stack before doing the call. 1472 1472 * We boldly assume that there is a stack frame here! */ -
trunk/src/VBox/Runtime/math/ceill.asm
r2988 r3672 25 25 BEGINCODE 26 26 27 %ifdef __AMD64__27 %ifdef RT_ARCH_AMD64 28 28 %define _SP rsp 29 29 %define _BP rbp -
trunk/src/VBox/Runtime/math/cosl.asm
r2988 r3672 24 24 BEGINCODE 25 25 26 %ifdef __AMD64__26 %ifdef RT_ARCH_AMD64 27 27 %define _SP rsp 28 28 %define _BP rbp -
trunk/src/VBox/Runtime/math/fabs.asm
r2988 r3672 24 24 BEGINCODE 25 25 26 %ifdef __AMD64__26 %ifdef RT_ARCH_AMD64 27 27 %define _SP rsp 28 28 %define _BP rbp … … 42 42 mov _BP, _SP 43 43 44 %ifdef __AMD64__44 %ifdef RT_ARCH_AMD64 45 45 sub _SP, 10h 46 46 -
trunk/src/VBox/Runtime/math/fabsf.asm
r2988 r3672 24 24 BEGINCODE 25 25 26 %ifdef __AMD64__26 %ifdef RT_ARCH_AMD64 27 27 %define _SP rsp 28 28 %define _BP rbp … … 42 42 mov _BP, _SP 43 43 44 %ifdef __AMD64__44 %ifdef RT_ARCH_AMD64 45 45 sub _SP, 10h 46 46 -
trunk/src/VBox/Runtime/math/fabsl.asm
r2988 r3672 25 25 BEGINCODE 26 26 27 %ifdef __AMD64__27 %ifdef RT_ARCH_AMD64 28 28 %define _SP rsp 29 29 %define _BP rbp -
trunk/src/VBox/Runtime/math/floor.asm
r2988 r3672 24 24 BEGINCODE 25 25 26 %ifdef __AMD64__26 %ifdef RT_ARCH_AMD64 27 27 %define _SP rsp 28 28 %define _BP rbp … … 43 43 sub _SP, 10h 44 44 45 %ifdef __AMD64__45 %ifdef RT_ARCH_AMD64 46 46 movsd [_SP], xmm0 47 47 fld qword [_SP] … … 64 64 fldcw [_BP - 10h] 65 65 66 %ifdef __AMD64__66 %ifdef RT_ARCH_AMD64 67 67 fstp qword [_SP] 68 68 movsd xmm0, [_SP] -
trunk/src/VBox/Runtime/math/floorf.asm
r2988 r3672 24 24 BEGINCODE 25 25 26 %ifdef __AMD64__26 %ifdef RT_ARCH_AMD64 27 27 %define _SP rsp 28 28 %define _BP rbp … … 43 43 sub _SP, 10h 44 44 45 %ifdef __AMD64__45 %ifdef RT_ARCH_AMD64 46 46 movss [_SP], xmm0 47 47 fld dword [_SP] … … 64 64 fldcw [_BP - 10h] 65 65 66 %ifdef __AMD64__66 %ifdef RT_ARCH_AMD64 67 67 fstp dword [_SP] 68 68 movss xmm0, [_SP] -
trunk/src/VBox/Runtime/math/floorl.asm
r2988 r3672 24 24 BEGINCODE 25 25 26 %ifdef __AMD64__26 %ifdef RT_ARCH_AMD64 27 27 %define _SP rsp 28 28 %define _BP rbp -
trunk/src/VBox/Runtime/math/ldexpl.asm
r2988 r3672 24 24 BEGINCODE 25 25 26 %ifdef __AMD64__26 %ifdef RT_ARCH_AMD64 27 27 %define _SP rsp 28 28 %define _BP rbp … … 45 45 46 46 ; load exp 47 %ifdef __AMD64__; ASSUMES ONLY GCC HERE!47 %ifdef RT_ARCH_AMD64 ; ASSUMES ONLY GCC HERE! 48 48 mov [rsp], edi 49 49 fild dword [rsp] -
trunk/src/VBox/Runtime/math/llrint.asm
r2988 r3672 29 29 ; @param rd 32-bit: [esp + 4h] 64-bit: xmm0 30 30 BEGINPROC RT_NOCRT(llrint) 31 %ifdef __AMD64__31 %ifdef RT_ARCH_AMD64 32 32 cvtsd2si rax, xmm0 33 33 %else -
trunk/src/VBox/Runtime/math/llrintf.asm
r2988 r3672 29 29 ; @param rf 32-bit: [esp + 4h] 64-bit: xmm0 30 30 BEGINPROC RT_NOCRT(llrintf) 31 %ifdef __AMD64__31 %ifdef RT_ARCH_AMD64 32 32 cvtss2si rax, xmm0 33 33 %else -
trunk/src/VBox/Runtime/math/llrintl.asm
r2988 r3672 24 24 BEGINCODE 25 25 26 %ifdef __AMD64__26 %ifdef RT_ARCH_AMD64 27 27 %define _SP rsp 28 28 %define _BP rbp … … 46 46 fistp qword [_SP] 47 47 fwait 48 %ifdef __AMD64__48 %ifdef RT_ARCH_AMD64 49 49 mov rax, [_SP] 50 50 %else -
trunk/src/VBox/Runtime/math/logl.asm
r2988 r3672 24 24 BEGINCODE 25 25 26 %ifdef __AMD64__26 %ifdef RT_ARCH_AMD64 27 27 %define _SP rsp 28 28 %define _BP rbp -
trunk/src/VBox/Runtime/math/lrint.asm
r2988 r3672 29 29 ; @param rd 32-bit: [esp + 4h] 64-bit: xmm0 30 30 BEGINPROC RT_NOCRT(lrint) 31 %ifdef __AMD64__31 %ifdef RT_ARCH_AMD64 32 32 cvtsd2si rax, xmm0 33 33 %else -
trunk/src/VBox/Runtime/math/lrintf.asm
r2988 r3672 29 29 ; @param rf 32-bit: [esp + 4h] 64-bit: xmm0 30 30 BEGINPROC RT_NOCRT(lrintf) 31 %ifdef __AMD64__31 %ifdef RT_ARCH_AMD64 32 32 cvtss2si rax, xmm0 33 33 %else -
trunk/src/VBox/Runtime/math/lrintl.asm
r2988 r3672 25 25 BEGINCODE 26 26 27 %ifdef __AMD64__27 %ifdef RT_ARCH_AMD64 28 28 %define _SP rsp 29 29 %define _BP rbp … … 45 45 46 46 fld tword [_BP + _S*2] 47 %ifdef __AMD64__47 %ifdef RT_ARCH_AMD64 48 48 fistp qword [_SP] 49 49 fwait -
trunk/src/VBox/Runtime/math/remainder.asm
r2988 r3672 24 24 BEGINCODE 25 25 26 %ifdef __AMD64__26 %ifdef RT_ARCH_AMD64 27 27 %define _SP rsp 28 28 %define _BP rbp … … 43 43 ;int3 44 44 45 %ifdef __AMD64__45 %ifdef RT_ARCH_AMD64 46 46 movsd [rsp + 10h], xmm1 47 47 movsd [rsp], xmm0 … … 60 60 61 61 .done: 62 %ifdef __AMD64__62 %ifdef RT_ARCH_AMD64 63 63 fstp qword [rsp] 64 64 movsd xmm0, [rsp] -
trunk/src/VBox/Runtime/math/remainderf.asm
r2988 r3672 24 24 BEGINCODE 25 25 26 %ifdef __AMD64__26 %ifdef RT_ARCH_AMD64 27 27 %define _SP rsp 28 28 %define _BP rbp … … 42 42 sub _SP, 20h 43 43 44 %ifdef __AMD64__44 %ifdef RT_ARCH_AMD64 45 45 movss [rsp], xmm1 46 46 movss [rsp + 10h], xmm0 … … 59 59 60 60 .done: 61 %ifdef __AMD64__61 %ifdef RT_ARCH_AMD64 62 62 fstp dword [rsp] 63 63 movss xmm0, [rsp] -
trunk/src/VBox/Runtime/math/remainderl.asm
r2988 r3672 24 24 BEGINCODE 25 25 26 %ifdef __AMD64__26 %ifdef RT_ARCH_AMD64 27 27 %define _SP rsp 28 28 %define _BP rbp … … 41 41 mov _BP, _SP 42 42 43 %ifdef __AMD64__43 %ifdef RT_ARCH_AMD64 44 44 fld tword [rbp + 10h + RTLRD_CB] 45 45 fld tword [rbp + 10h] -
trunk/src/VBox/Runtime/math/sinl.asm
r2988 r3672 25 25 BEGINCODE 26 26 27 %ifdef __AMD64__27 %ifdef RT_ARCH_AMD64 28 28 %define _SP rsp 29 29 %define _BP rbp -
trunk/src/VBox/Runtime/math/tanl.asm
r2988 r3672 24 24 BEGINCODE 25 25 26 %ifdef __AMD64__26 %ifdef RT_ARCH_AMD64 27 27 %define _SP rsp 28 28 %define _BP rbp -
trunk/src/VBox/Runtime/math/trunc.asm
r2988 r3672 25 25 BEGINCODE 26 26 27 %ifdef __AMD64__27 %ifdef RT_ARCH_AMD64 28 28 %define _SP rsp 29 29 %define _BP rbp … … 44 44 sub _SP, 10h 45 45 46 %ifdef __AMD64__46 %ifdef RT_ARCH_AMD64 47 47 movsd [_SP], xmm0 48 48 fld qword [_SP] … … 64 64 fldcw [_BP - 10h] 65 65 66 %ifdef __AMD64__66 %ifdef RT_ARCH_AMD64 67 67 fstp qword [_SP] 68 68 movsd xmm0, [_SP] -
trunk/src/VBox/Runtime/math/truncf.asm
r2988 r3672 25 25 BEGINCODE 26 26 27 %ifdef __AMD64__27 %ifdef RT_ARCH_AMD64 28 28 %define _SP rsp 29 29 %define _BP rbp … … 44 44 sub _SP, 10h 45 45 46 %ifdef __AMD64__46 %ifdef RT_ARCH_AMD64 47 47 movss [_SP], xmm0 48 48 fld dword [_SP] … … 64 64 fldcw [_BP - 10h] 65 65 66 %ifdef __AMD64__66 %ifdef RT_ARCH_AMD64 67 67 fstp dword [_SP] 68 68 movss xmm0, [_SP] -
trunk/src/VBox/Runtime/math/truncl.asm
r2988 r3672 25 25 BEGINCODE 26 26 27 %ifdef __AMD64__27 %ifdef RT_ARCH_AMD64 28 28 %define _SP rsp 29 29 %define _BP rbp -
trunk/src/VBox/Runtime/misc/setjmp.asm
r2988 r3672 27 27 28 28 BEGINPROC RT_NOCRT(setjmp) 29 %ifdef __AMD64__29 %ifdef RT_ARCH_AMD64 30 30 mov rax, [rsp] 31 31 mov [rdi + 00h], rax ; rip … … 55 55 56 56 BEGINPROC RT_NOCRT(longjmp) 57 %ifdef __AMD64__57 %ifdef RT_ARCH_AMD64 58 58 mov rbx, [rdi + 38h] 59 59 mov r12, [rdi + 30h] -
trunk/src/VBox/Runtime/path.cpp
r2981 r3672 52 52 { 53 53 /* handle separators. */ 54 #if defined( __WIN__) || defined(__OS2__)54 #if defined(RT_OS_WINDOWS) || defined(RT_OS_OS2) 55 55 case ':': 56 56 pszLastSep = psz + 1; … … 88 88 { 89 89 /* handle separators. */ 90 #if defined( __WIN__) || defined(__OS2__)90 #if defined(RT_OS_WINDOWS) || defined(RT_OS_OS2) 91 91 case ':': 92 92 case '\\': … … 127 127 { 128 128 /* handle separators. */ 129 #if defined( __WIN__) || defined(__OS2__)129 #if defined(RT_OS_WINDOWS) || defined(RT_OS_OS2) 130 130 case ':': 131 131 pszLastComp = psz + 1; … … 164 164 { 165 165 case '/': 166 #if defined( __WIN__) || defined(__OS2__)166 #if defined(RT_OS_WINDOWS) || defined(RT_OS_OS2) 167 167 case '\\': 168 168 #endif … … 194 194 { 195 195 /* handle separators. */ 196 #if defined( __WIN__) || defined(__OS2__)196 #if defined(RT_OS_WINDOWS) || defined(RT_OS_OS2) 197 197 case ':': 198 198 pszExt = NULL; … … 243 243 RTDECL(bool) RTPathHavePath(const char *pszPath) 244 244 { 245 #if defined( __WIN__) || defined(__OS2__)245 #if defined(RT_OS_WINDOWS) || defined(RT_OS_OS2) 246 246 return strpbrk(pszPath, "/\\:") != NULL; 247 247 #else … … 269 269 return 1; 270 270 271 #if defined( __WIN__) || defined(__OS2__)271 #if defined(RT_OS_WINDOWS) || defined(RT_OS_OS2) 272 272 PRTUNICP puszPath1; 273 273 int rc = RTStrToUni(pszPath1, &puszPath1); … … 435 435 size_t rtPathVolumeSpecLen(const char *pszPath) 436 436 { 437 #if defined ( __OS2__) || defined (__WIN__)437 #if defined (RT_OS_OS2) || defined (RT_OS_WINDOWS) 438 438 if (pszPath && *pszPath) 439 439 { … … 477 477 if (pszBase && pszPath && !rtPathVolumeSpecLen(pszPath)) 478 478 { 479 #if defined( __WIN__)479 #if defined(RT_OS_WINDOWS) 480 480 /* The format for very long paths is not supported. */ 481 481 if ( (pszBase[0] == '/' || pszBase[0] == '\\') … … 501 501 502 502 bool fRootSpec = pszPath[0] == '/' 503 #if defined( __WIN__) || defined(__OS2__)503 #if defined(RT_OS_WINDOWS) || defined(RT_OS_OS2) 504 504 || pszPath[0] == '\\' 505 505 #endif -
trunk/src/VBox/Runtime/r0drv/alloc-r0drv.h
r2981 r3672 49 49 #define RTMEMHDR_FLAG_ZEROED BIT(0) 50 50 #define RTMEMHDR_FLAG_EXEC BIT(1) 51 #ifdef __LINUX__51 #ifdef RT_OS_LINUX 52 52 #define RTMEMHDR_FLAG_EXEC_HEAP BIT(30) 53 53 #define RTMEMHDR_FLAG_KMALLOC BIT(31) -
trunk/src/VBox/Runtime/r0drv/darwin/the-darwin-kernel.h
r2981 r3672 41 41 42 42 /* 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!" 45 45 #endif 46 46 -
trunk/src/VBox/Runtime/r0drv/initterm-r0drv.cpp
r2981 r3672 45 45 if (RT_SUCCESS(rc)) 46 46 { 47 #if !defined( __LINUX__) && !defined(__WIN__)47 #if !defined(RT_OS_LINUX) && !defined(RT_OS_WINDOWS) 48 48 rc = rtThreadInit(); 49 49 #endif … … 62 62 RTR0DECL(void) RTR0Term(void) 63 63 { 64 #if !defined( __LINUX__) && !defined(__WIN__)64 #if !defined(RT_OS_LINUX) && !defined(RT_OS_WINDOWS) 65 65 rtThreadTerm(); 66 66 #endif -
trunk/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c
r3305 r3672 29 29 #include "r0drv/alloc-r0drv.h" 30 30 31 #if defined( __AMD64__) || defined(__DOXYGEN__)31 #if defined(RT_ARCH_AMD64) || defined(__DOXYGEN__) 32 32 /** 33 33 * We need memory in the module range (~2GB to ~0) this can only be obtained … … 112 112 if (fFlags & RTMEMHDR_FLAG_EXEC) 113 113 { 114 #if defined( __AMD64__)114 #if defined(RT_ARCH_AMD64) 115 115 # ifdef RTMEMALLOC_EXEC_HEAP 116 116 if (g_HeapExec != NIL_RTHEAPSIMPLE) … … 227 227 cPages = cb >> PAGE_SHIFT; 228 228 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). */ 230 230 paPages = alloc_pages(GFP_DMA, cOrder); 231 231 #else -
trunk/src/VBox/Runtime/r0drv/linux/initterm-r0drv-linux.c
r2981 r3672 33 33 * Internal Functions * 34 34 *******************************************************************************/ 35 #ifdef __AMD64__35 #ifdef RT_ARCH_AMD64 36 36 /* in alloc-r0drv0-linux.c */ 37 37 extern void rtR0MemExecCleanup(void); … … 47 47 void rtR0TermNative(void) 48 48 { 49 #ifdef __AMD64__49 #ifdef RT_ARCH_AMD64 50 50 rtR0MemExecCleanup(); 51 51 #endif -
trunk/src/VBox/Runtime/r0drv/linux/spinlock-r0drv-linux.c
r2981 r3672 48 48 /** The linux spinlock structure. */ 49 49 spinlock_t Spinlock; 50 #if !defined(CONFIG_SMP) || defined( __AMD64__)50 #if !defined(CONFIG_SMP) || defined(RT_ARCH_AMD64) 51 51 /** A placeholder on Uni systems so we won't piss off RTMemAlloc(). */ 52 52 void *pvUniDummy; -
trunk/src/VBox/Runtime/r0drv/linux/the-linux-kernel.h
r2981 r3672 179 179 # endif 180 180 181 # ifndef __AMD64__181 # ifndef RT_ARCH_AMD64 182 182 /* In 2.6.9-22.ELsmp we have to call change_page_attr() twice when changing 183 183 * the page attributes from PAGE_KERNEL to something else, because there appears … … 191 191 change_page_attr(pPages, cPages, prot); \ 192 192 } while (0) 193 # endif /* ! __AMD64__*/193 # endif /* !RT_ARCH_AMD64 */ 194 194 #endif /* !NO_REDHAT_HACKS */ 195 195 … … 200 200 201 201 #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(). */ 203 203 # define MY_CHANGE_PAGE_ATTR(pPages, cPages, prot) \ 204 204 do { \ -
trunk/src/VBox/Runtime/r0drv/nt/the-nt-kernel.h
r2981 r3672 48 48 # error "__WIN32__ or __WIN64__ must be defined!" 49 49 #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!" 52 52 #endif 53 53 -
trunk/src/VBox/Runtime/r3/alloc-ef.h
r2981 r3672 72 72 * Requires RTALLOC_EFENCE_TRACE. 73 73 */ 74 #if defined( __LINUX__)74 #if defined(RT_OS_LINUX) 75 75 # define RTALLOC_EFENCE_FREE_FILL 'f' 76 76 #endif … … 94 94 * Header Files * 95 95 *******************************************************************************/ 96 #ifdef __WIN__96 #ifdef RT_OS_WINDOWS 97 97 # include <Windows.h> 98 98 #else -
trunk/src/VBox/Runtime/r3/alloc.cpp
r2981 r3672 94 94 void *pv = malloc(cb); 95 95 AssertMsg(pv, ("malloc(%d) failed!!!\n", cb)); 96 #ifdef __OS2__/* temporary workaround until libc062. */96 #ifdef RT_OS_OS2 /* temporary workaround until libc062. */ 97 97 AssertMsg( cb < 32 98 98 || !((uintptr_t)pv & (RTMEM_ALIGNMENT - 1)), ("pv=%p RTMEM_ALIGNMENT=%#x\n", pv, RTMEM_ALIGNMENT)); … … 128 128 void *pv = calloc(1, cb); 129 129 AssertMsg(pv, ("calloc(1,%d) failed!!!\n", cb)); 130 #ifdef __OS2__/* temporary workaround until libc062. */130 #ifdef RT_OS_OS2 /* temporary workaround until libc062. */ 131 131 AssertMsg( cb < 32 132 132 || !((uintptr_t)pv & (RTMEM_ALIGNMENT - 1)), ("pv=%p RTMEM_ALIGNMENT=%#x\n", pv, RTMEM_ALIGNMENT)); … … 157 157 void *pv = realloc(pvOld, cbNew); 158 158 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. */ 160 160 AssertMsg( cbNew < 32 161 161 || !((uintptr_t)pv & (RTMEM_ALIGNMENT - 1)), ("pv=%p RTMEM_ALIGNMENT=%#x\n", pv, RTMEM_ALIGNMENT)); -
trunk/src/VBox/Runtime/r3/init.cpp
r3123 r3672 26 26 *******************************************************************************/ 27 27 #define LOG_GROUP RTLOGGROUP_DEFAULT 28 #ifdef __WIN__28 #ifdef RT_OS_WINDOWS 29 29 # include <process.h> 30 30 #else -
trunk/src/VBox/Runtime/r3/posix/alloc-posix.cpp
r2981 r3672 35 35 #include <sys/mman.h> 36 36 37 #if !defined(RT_USE_MMAP) && (defined( __LINUX__))37 #if !defined(RT_USE_MMAP) && (defined(RT_OS_LINUX)) 38 38 # define RT_USE_MMAP 39 39 #endif … … 83 83 size_t cbAlloc = RT_ALIGN_Z(cb + sizeof(RTMEMEXECHDR), PAGE_SIZE); 84 84 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) 86 86 | MAP_32BIT 87 87 #endif -
trunk/src/VBox/Runtime/r3/posix/fileio-posix.cpp
r2981 r3672 39 39 # include <sys/time.h> 40 40 #endif 41 #if defined( __OS2__) && (!defined(__INNOTEK_LIBC__) || __INNOTEK_LIBC__ < 0x006)41 #if defined(RT_OS_OS2) && (!defined(__INNOTEK_LIBC__) || __INNOTEK_LIBC__ < 0x006) 42 42 # include <io.h> 43 43 #endif 44 #ifdef __L4__44 #ifdef RT_OS_L4 45 45 /* This is currently ifdef'ed out in the relevant L4 header file */ 46 46 /* Same as `utimes', but takes an open file descriptor instead of a name. */ … … 334 334 } 335 335 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)) 337 337 if (chsize((int)File, (off_t)cbSize) == 0) 338 338 #else -
trunk/src/VBox/Runtime/r3/posix/ldrNative-posix.cpp
r2981 r3672 43 43 if (!RTPathHaveExt(pszFilename)) 44 44 { 45 #if defined( __OS2__) || defined(__WIN__)45 #if defined(RT_OS_OS2) || defined(RT_OS_WINDOWS) 46 46 static const char s_szSuff[] = ".DLL"; 47 #elif defined( __L4__)47 #elif defined(RT_OS_L4) 48 48 static const char s_szSuff[] = ".s.so"; 49 #elif defined( __DARWIN__)49 #elif defined(RT_OS_DARWIN) 50 50 static const char s_szSuff[] = ".dylib"; 51 51 #else … … 79 79 { 80 80 PRTLDRMODNATIVE pModNative = (PRTLDRMODNATIVE)pMod; 81 #ifdef __OS2__81 #ifdef RT_OS_OS2 82 82 /* Prefix the symbol with an underscore (assuming __cdecl/gcc-default). */ 83 83 size_t cch = strlen(pszSymbol); -
trunk/src/VBox/Runtime/r3/posix/path-posix.cpp
r3365 r3672 32 32 #include <sys/time.h> 33 33 #include <stdio.h> 34 #ifdef __DARWIN__34 #ifdef RT_OS_DARWIN 35 35 # include <mach-o/dyld.h> 36 36 #endif … … 44 44 #include "internal/fs.h" 45 45 46 #ifdef __L4__46 #ifdef RT_OS_L4 47 47 # include <l4/vboxserver/vboxserver.h> 48 48 #endif … … 182 182 { 183 183 if (errno == ENOENT || errno == ENOTDIR 184 #ifdef __OS2__184 #ifdef RT_OS_OS2 185 185 /// @todo realpath() returns EIO for non-existent UNC paths like 186 186 // //server/share/subdir (i.e. when a subdir is specified within … … 315 315 { 316 316 if (errno != ENOENT && errno != ENOTDIR 317 #ifdef __OS2__317 #ifdef RT_OS_OS2 318 318 /// @todo see above 319 319 && errno != EIO … … 408 408 */ 409 409 /** @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 412 412 int cchLink = readlink("/proc/self/exe", &g_szrtProgramPath[0], sizeof(g_szrtProgramPath) - 1); 413 413 # else … … 423 423 g_szrtProgramPath[cchLink] = '\0'; 424 424 425 #elif defined( __OS2__) || defined(__L4__)425 #elif defined(RT_OS_OS2) || defined(RT_OS_L4) 426 426 _execname(g_szrtProgramPath, sizeof(g_szrtProgramPath)); 427 427 428 #elif defined( __DARWIN__)428 #elif defined(RT_OS_DARWIN) 429 429 const char *pszImageName = _dyld_get_image_name(0); 430 430 AssertReturn(pszImageName, VERR_INTERNAL_ERROR); -
trunk/src/VBox/Runtime/r3/posix/process-posix.cpp
r2981 r3672 32 32 #include <sys/wait.h> 33 33 #include <signal.h> 34 #if defined( __LINUX__) || defined(__OS2__)34 #if defined(RT_OS_LINUX) || defined(RT_OS_OS2) 35 35 # define HAVE_POSIX_SPAWN 1 36 36 #endif … … 38 38 # include <spawn.h> 39 39 #endif 40 #ifdef __DARWIN__40 #ifdef RT_OS_DARWIN 41 41 # include <mach-o/dyld.h> 42 42 #endif … … 237 237 * files and code for this. 238 238 */ 239 #if defined( __LINUX__) || defined(__FREEBSD__)240 # ifdef __LINUX__239 #if defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD) 240 # ifdef RT_OS_LINUX 241 241 int cchLink = readlink("/proc/self/exe", pszExecName, cchExecName - 1); 242 242 # else … … 249 249 } 250 250 251 #elif defined( __OS2__) || defined(__L4__)251 #elif defined(RT_OS_OS2) || defined(RT_OS_L4) 252 252 if (!_execname(pszExecName, cchExecName)) 253 253 return pszExecName; 254 254 255 #elif defined( __DARWIN__)255 #elif defined(RT_OS_DARWIN) 256 256 const char *pszImageName = _dyld_get_image_name(0); 257 257 if (pszImageName) -
trunk/src/VBox/Runtime/r3/posix/sems-posix.cpp
r2981 r3672 34 34 #include <sys/time.h> 35 35 36 #ifdef __DARWIN__36 #ifdef RT_OS_DARWIN 37 37 # define pthread_yield() pthread_yield_np() 38 38 #endif … … 366 366 */ 367 367 struct timespec ts = {0,0}; 368 #ifdef __DARWIN__368 #ifdef RT_OS_DARWIN 369 369 struct timeval tv = {0,0}; 370 370 gettimeofday(&tv, NULL); … … 390 390 391 391 /* take mutex */ 392 #ifdef __DARWIN__392 #ifdef RT_OS_DARWIN 393 393 int rc = pthread_mutex_lock(&pIntEventSem->Mutex); 394 394 #else … … 601 601 */ 602 602 struct timespec ts = {0,0}; 603 #ifdef __DARWIN__603 #ifdef RT_OS_DARWIN 604 604 struct timeval tv = {0,0}; 605 605 gettimeofday(&tv, NULL); … … 621 621 622 622 /* take mutex */ 623 #ifdef __DARWIN__623 #ifdef RT_OS_DARWIN 624 624 int rc = pthread_mutex_lock(&pIntEventMultiSem->Mutex); 625 625 #else … … 812 812 else 813 813 { 814 #ifdef __DARWIN__814 #ifdef RT_OS_DARWIN 815 815 AssertMsgFailed(("Not implemented on Darwin yet because of incomplete pthreads API.")); 816 816 return VERR_NOT_IMPLEMENTED; 817 #else /* ! __DARWIN__*/817 #else /* !RT_OS_DARWIN */ 818 818 /* 819 819 * Get current time and calc end of wait time. … … 839 839 return RTErrConvertFromErrno(rc); 840 840 } 841 #endif /* ! __DARWIN__*/841 #endif /* !RT_OS_DARWIN */ 842 842 } 843 843 … … 1030 1030 else 1031 1031 { 1032 #ifdef __DARWIN__1032 #ifdef RT_OS_DARWIN 1033 1033 AssertMsgFailed(("Not implemented on Darwin yet because of incomplete pthreads API.")); 1034 1034 return VERR_NOT_IMPLEMENTED; 1035 #else /* ! __DARWIN__*/1035 #else /* !RT_OS_DARWIN */ 1036 1036 /* 1037 1037 * Get current time and calc end of wait time. … … 1057 1057 return RTErrConvertFromErrno(rc); 1058 1058 } 1059 #endif /* ! __DARWIN__*/1059 #endif /* !RT_OS_DARWIN */ 1060 1060 } 1061 1061 … … 1129 1129 else 1130 1130 { 1131 #ifdef __DARWIN__1131 #ifdef RT_OS_DARWIN 1132 1132 AssertMsgFailed(("Not implemented on Darwin yet because of incomplete pthreads API.")); 1133 1133 return VERR_NOT_IMPLEMENTED; 1134 #else /* ! __DARWIN__*/1134 #else /* !RT_OS_DARWIN */ 1135 1135 /* 1136 1136 * Get current time and calc end of wait time. … … 1156 1156 return RTErrConvertFromErrno(rc); 1157 1157 } 1158 #endif /* ! __DARWIN__*/1158 #endif /* !RT_OS_DARWIN */ 1159 1159 } 1160 1160 -
trunk/src/VBox/Runtime/r3/posix/thread-posix.cpp
r2981 r3672 201 201 { 202 202 /* pthread_yield() isn't part of SuS, thus this fun. */ 203 #ifdef __DARWIN__203 #ifdef RT_OS_DARWIN 204 204 pthread_yield_np(); 205 #elif defined( __FREEBSD__) /* void pthread_yield */205 #elif defined(RT_OS_FREEBSD) /* void pthread_yield */ 206 206 pthread_yield(); 207 207 #else … … 236 236 { 237 237 uint64_t u64TS = ASMReadTSC(); 238 #ifdef __DARWIN__238 #ifdef RT_OS_DARWIN 239 239 pthread_yield_np(); 240 240 #else -
trunk/src/VBox/Runtime/r3/posix/time-posix.cpp
r2981 r3672 35 35 DECLINLINE(uint64_t) rtTimeGetSystemNanoTS(void) 36 36 { 37 #if defined(CLOCK_MONOTONIC) && !defined( __L4__) && !defined(__OS2__)37 #if defined(CLOCK_MONOTONIC) && !defined(RT_OS_L4) && !defined(RT_OS_OS2) 38 38 /* check monotonic clock first. */ 39 39 static bool s_fMonoClock = true; -
trunk/src/VBox/Runtime/r3/posix/timer-posix.cpp
r2981 r3672 38 38 #include <sys/fcntl.h> 39 39 #include <sys/ioctl.h> 40 #ifdef __LINUX__40 #ifdef RT_OS_LINUX 41 41 # include <linux/rtc.h> 42 42 #endif … … 44 44 #include <signal.h> 45 45 #include <errno.h> 46 #ifndef __OS2__46 #ifndef RT_OS_OS2 47 47 # include <pthread.h> 48 48 #endif … … 216 216 { 217 217 siginfo_t SigInfo = {0}; 218 #ifdef __DARWIN__218 #ifdef RT_OS_DARWIN 219 219 if (RT_LIKELY(sigwait(&SigSet, &SigInfo.si_signo) >= 0)) 220 220 { … … 318 318 */ 319 319 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 321 321 int fh = open("/dev/rtc", O_RDONLY); 322 322 if (fh >= 0) … … 424 424 if (!pTimer->fSuspended) 425 425 { 426 #ifndef __OS2__426 #ifndef RT_OS_OS2 427 427 pthread_kill((pthread_t)RTThreadGetNative(pTimer->Thread), SIGALRM); 428 428 #endif … … 498 498 if (RTThreadSelf() != pTimer->Thread) 499 499 { 500 #ifndef __OS2__500 #ifndef RT_OS_OS2 501 501 pthread_kill((pthread_t)RTThreadGetNative(pTimer->Thread), SIGALRM); 502 502 #endif -
trunk/src/VBox/Runtime/r3/posix/utf8-posix.cpp
r2981 r3672 96 96 const void *pvInputLeft = pvInput; 97 97 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. */ 99 99 if (iconv(icHandle, (char **)&pvInputLeft, &cbInLeft, (char **)&pvOutputLeft, &cbOutLeft) != (size_t)-1) 100 100 #else -
trunk/src/VBox/Runtime/r3/process.cpp
r2981 r3672 31 31 #include "internal/thread.h" 32 32 33 #ifdef __WIN__33 #ifdef RT_OS_WINDOWS 34 34 # include <process.h> 35 35 #else -
trunk/src/VBox/Runtime/r3/stream.cpp
r2981 r3672 38 38 #include <errno.h> 39 39 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 */ 41 41 #define HAVE_FWRITE_UNLOCKED 42 42 #endif -
trunk/src/VBox/Runtime/r3/tcp.cpp
r2981 r3672 24 24 * Header Files * 25 25 *******************************************************************************/ 26 #ifdef __WIN__26 #ifdef RT_OS_WINDOWS 27 27 #include <winsock.h> 28 #else /* ! __WIN__*/28 #else /* !RT_OS_WINDOWS */ 29 29 #include <errno.h> 30 30 #include <sys/stat.h> … … 36 36 #include <netdb.h> 37 37 #include <unistd.h> 38 #endif /* ! __WIN__*/38 #endif /* !RT_OS_WINDOWS */ 39 39 40 40 #include <iprt/tcp.h> … … 60 60 61 61 /* fixup backlevel OSes. */ 62 #if defined( __OS2__) || defined(__WIN__)62 #if defined(RT_OS_OS2) || defined(RT_OS_WINDOWS) 63 63 # define socklen_t int 64 64 #endif … … 139 139 DECLINLINE(int) rtTcpError(void) 140 140 { 141 #ifdef __WIN__141 #ifdef RT_OS_WINDOWS 142 142 return RTErrConvertFromWin32(WSAGetLastError()); 143 143 #else … … 280 280 } 281 281 282 #ifdef __WIN__282 #ifdef RT_OS_WINDOWS 283 283 /* 284 284 * Initialize WinSock and check version. … … 475 475 if (Socket == -1) 476 476 { 477 #ifndef __WIN__477 #ifndef RT_OS_WINDOWS 478 478 /* These are typical for what can happen during destruction. */ 479 479 if (errno == EBADF || errno == EINVAL || errno == ENOTSOCK) … … 800 800 AssertReturn(VALID_PTR(pszAddress), VERR_INVALID_PARAMETER); 801 801 802 #ifdef __WIN__802 #ifdef RT_OS_WINDOWS 803 803 /* 804 804 * Initialize WinSock and check version. … … 874 874 * Attempt to close it. 875 875 */ 876 #ifdef __WIN__876 #ifdef RT_OS_WINDOWS 877 877 int rc = closesocket(Sock); 878 878 #else -
trunk/src/VBox/Runtime/req.cpp
r2981 r3672 780 780 } u; 781 781 u.pfn = pReq->u.Internal.pfn; 782 #ifdef __AMD64__782 #ifdef RT_ARCH_AMD64 783 783 switch (pReq->u.Internal.cArgs) 784 784 { -
trunk/src/VBox/Runtime/strformatrt.cpp
r3256 r3672 610 610 long rc = va_arg(*pArgs, long); 611 611 char ch = *(*ppszFormat)++; 612 #if defined( __WIN__)612 #if defined(RT_OS_WINDOWS) 613 613 PCRTWINERRMSG pMsg = RTErrWinGet(rc); 614 614 #endif 615 615 switch (ch) 616 616 { 617 #if defined( __WIN__)617 #if defined(RT_OS_WINDOWS) 618 618 case 'c': 619 619 return pfnOutput(pvArgOutput, pMsg->pszDefine, strlen(pMsg->pszDefine)); -
trunk/src/VBox/Runtime/string/memchr.asm
r2988 r3672 30 30 BEGINPROC RT_NOCRT(memchr) 31 31 cld 32 %ifdef __AMD64__32 %ifdef RT_ARCH_AMD64 33 33 %ifdef ASM_CALL64_MSC 34 34 or r8, r8 … … 63 63 mov rdi, r9 64 64 %endif 65 %ifdef __X86__65 %ifdef RT_ARCH_X86 66 66 mov edi, edx 67 67 %endif … … 72 72 mov rdi, r9 73 73 %endif 74 %ifdef __X86__74 %ifdef RT_ARCH_X86 75 75 mov edi, edx 76 76 %endif -
trunk/src/VBox/Runtime/string/memchr_alias.c
r2981 r3672 27 27 #undef memchr 28 28 29 #if defined( __DARWIN__) || defined(__WIN__)29 #if defined(RT_OS_DARWIN) || defined(RT_OS_WINDOWS) 30 30 # ifndef __MINGW32__ 31 31 # pragma weak memchr -
trunk/src/VBox/Runtime/string/memcmp.asm
r2988 r3672 32 32 33 33 ; Do the bulk of the work. 34 %ifdef __AMD64__34 %ifdef RT_ARCH_AMD64 35 35 %ifdef ASM_CALL64_MSC 36 36 mov r10, rdi ; save … … 63 63 64 64 ; The remaining bytes. 65 %ifdef __AMD64__65 %ifdef RT_ARCH_AMD64 66 66 test dl, 4 67 67 jz .dont_cmp_dword … … 82 82 83 83 .done: 84 %ifdef __AMD64__84 %ifdef RT_ARCH_AMD64 85 85 %ifdef ASM_CALL64_MSC 86 86 mov rdi, r10 … … 96 96 ; Mismatches. 97 97 ; 98 %ifdef __AMD64__98 %ifdef RT_ARCH_AMD64 99 99 .not_equal_qword: 100 100 mov ecx, 8 … … 114 114 sub xDI, 4 115 115 repe cmpsb 116 %ifdef __AMD64__116 %ifdef RT_ARCH_AMD64 117 117 jmp .not_equal_byte 118 118 %else -
trunk/src/VBox/Runtime/string/memcmp_alias.c
r2981 r3672 27 27 #undef memcmp 28 28 29 #if defined( __DARWIN__) || defined(__WIN__)29 #if defined(RT_OS_DARWIN) || defined(RT_OS_WINDOWS) 30 30 # ifndef __MINGW32__ 31 31 # pragma weak memcmp -
trunk/src/VBox/Runtime/string/memcpy.asm
r2988 r3672 32 32 33 33 ; Do the bulk of the work. 34 %ifdef __AMD64__34 %ifdef RT_ARCH_AMD64 35 35 %ifdef ASM_CALL64_MSC 36 36 mov r10, rdi ; save … … 60 60 61 61 ; The remaining bytes. 62 %ifdef __AMD64__62 %ifdef RT_ARCH_AMD64 63 63 test dl, 4 64 64 jz .dont_move_dword … … 75 75 .dont_move_byte: 76 76 77 %ifdef __AMD64__77 %ifdef RT_ARCH_AMD64 78 78 %ifdef ASM_CALL64_MSC 79 79 mov rdi, r10 -
trunk/src/VBox/Runtime/string/memcpy_alias.c
r2981 r3672 27 27 #undef memcpy 28 28 29 #if defined( __DARWIN__) || defined(__WIN__)29 #if defined(RT_OS_DARWIN) || defined(RT_OS_WINDOWS) 30 30 # ifndef __MINGW32__ 31 31 # pragma weak memcpy -
trunk/src/VBox/Runtime/string/mempcpy.asm
r2988 r3672 32 32 33 33 ; Do the bulk of the work. 34 %ifdef __AMD64__34 %ifdef RT_ARCH_AMD64 35 35 %ifdef ASM_CALL64_MSC 36 36 mov r10, rdi ; save … … 58 58 59 59 ; The remaining bytes. 60 %ifdef __AMD64__60 %ifdef RT_ARCH_AMD64 61 61 test dl, 4 62 62 jz .dont_move_dword … … 74 74 75 75 ; restore & return 76 %ifdef __AMD64__76 %ifdef RT_ARCH_AMD64 77 77 mov rax, rdi 78 78 %ifdef ASM_CALL64_MSC -
trunk/src/VBox/Runtime/string/memset.asm
r2988 r3672 30 30 BEGINPROC RT_NOCRT(memset) 31 31 cld 32 %ifdef __AMD64__32 %ifdef RT_ARCH_AMD64 33 33 %ifdef ASM_CALL64_MSC 34 34 int3 -
trunk/src/VBox/Runtime/string/memset_alias.c
r2981 r3672 27 27 #undef memset 28 28 29 #if defined( __DARWIN__) || defined(__WIN__)29 #if defined(RT_OS_DARWIN) || defined(RT_OS_WINDOWS) 30 30 # ifndef __MINGW32__ 31 31 # pragma weak memset -
trunk/src/VBox/Runtime/string/strchr.asm
r2988 r3672 31 31 32 32 ; check for ch == 0 and setup normal strchr. 33 %ifdef __AMD64__33 %ifdef RT_ARCH_AMD64 34 34 %ifdef ASM_CALL64_MSC 35 35 or dl, dl … … 83 83 mov rsi, r9 84 84 %endif 85 %ifdef __X86__85 %ifdef RT_ARCH_X86 86 86 mov esi, ecx 87 87 %endif … … 92 92 mov rsi, r9 93 93 %endif 94 %ifdef __X86__94 %ifdef RT_ARCH_X86 95 95 mov esi, ecx 96 96 %endif … … 103 103 align 16 104 104 .strlen: 105 %ifdef __AMD64__105 %ifdef RT_ARCH_AMD64 106 106 %ifdef ASM_CALL64_MSC 107 107 mov r9, rdi ; save rdi … … 120 120 mov rdi, r9 121 121 %endif 122 %ifdef __X86__122 %ifdef RT_ARCH_X86 123 123 mov edi, edx 124 124 %endif -
trunk/src/VBox/Runtime/string/strchr_alias.c
r2981 r3672 27 27 #undef strchr 28 28 29 #if defined( __DARWIN__) || defined(__WIN__)29 #if defined(RT_OS_DARWIN) || defined(RT_OS_WINDOWS) 30 30 # ifndef __MINGW32__ 31 31 # pragma weak strchr -
trunk/src/VBox/Runtime/string/strcmp.asm
r2988 r3672 29 29 BEGINPROC RT_NOCRT(strcmp) 30 30 ; input 31 %ifdef __AMD64__31 %ifdef RT_ARCH_AMD64 32 32 %ifdef ASM_CALL64_MSC 33 33 %define psz1 rcx -
trunk/src/VBox/Runtime/string/strcmp_alias.c
r2981 r3672 27 27 #undef strcmp 28 28 29 #if defined( __DARWIN__) || defined(__WIN__)29 #if defined(RT_OS_DARWIN) || defined(RT_OS_WINDOWS) 30 30 # ifndef __MINGW32__ 31 31 # pragma weak strcmp -
trunk/src/VBox/Runtime/string/strncmp.cpp
r2981 r3672 28 28 #endif 29 29 (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) 31 31 __THROW 32 32 #endif -
trunk/src/VBox/Runtime/string/strpbrk.cpp
r2981 r3672 40 40 #else 41 41 char *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) 43 43 __THROW 44 44 # endif -
trunk/src/VBox/Runtime/testcase/tstInlineAsm.cpp
r2981 r3672 62 62 63 63 64 #if !defined(PIC) || !defined( __X86__)64 #if !defined(PIC) || !defined(RT_ARCH_X86) 65 65 const char *getCacheAss(unsigned u) 66 66 { … … 543 543 544 544 545 #ifdef __AMD64__545 #ifdef RT_ARCH_AMD64 546 546 static void tstASMAtomicXchgU128(void) 547 547 { … … 867 867 * Execute the tests. 868 868 */ 869 #if !defined(PIC) || !defined( __X86__)869 #if !defined(PIC) || !defined(RT_ARCH_X86) 870 870 tstASMCpuId(); 871 871 #endif … … 874 874 tstASMAtomicXchgU32(); 875 875 tstASMAtomicXchgU64(); 876 #ifdef __AMD64__876 #ifdef RT_ARCH_AMD64 877 877 tstASMAtomicXchgU128(); 878 878 #endif -
trunk/src/VBox/Runtime/testcase/tstIoCtl.cpp
r2981 r3672 43 43 #include <iprt/uuid.h> 44 44 45 #ifdef __L4ENV__45 #ifdef RT_OS_L4 46 46 extern char **__environ; 47 47 char *myenv[] = { "+all.e", NULL }; … … 50 50 int main() 51 51 { 52 #ifdef __L4ENV__52 #ifdef RT_OS_L4 53 53 __environ = myenv; 54 54 #endif -
trunk/src/VBox/Runtime/testcase/tstLdrDisasmTest.cpp
r2981 r3672 34 34 #include <iprt/string.h> 35 35 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. */ 37 37 extern "C" DECLIMPORT(int) MyPrintf(const char *pszFormat, ...); 38 38 # define MY_PRINTF(a) MyPrintf a -
trunk/src/VBox/Runtime/testcase/tstPath.cpp
r3365 r3672 72 72 "relative_base/dir\\", "\\from_root", 73 73 "relative_base/dir/", "relative_also", 74 #if defined ( __OS2__) || defined (__WIN__)74 #if defined (RT_OS_OS2) || defined (RT_OS_WINDOWS) 75 75 NULL, "C:\\", 76 76 "C:\\", "..", -
trunk/src/VBox/Runtime/testcase/tstTime-2.cpp
r2981 r3672 23 23 * Header Files * 24 24 *******************************************************************************/ 25 #ifdef __WIN__25 #ifdef RT_OS_WINDOWS 26 26 # include <Windows.h> 27 27 28 #elif defined __L4__28 #elif defined RT_OS_L4 29 29 30 30 #else /* posix */ … … 40 40 DECLINLINE(uint64_t) OSNanoTS(void) 41 41 { 42 #ifdef __WIN__42 #ifdef RT_OS_WINDOWS 43 43 uint64_t u64; /* manual say larger integer, should be safe to assume it's the same. */ 44 44 GetSystemTimeAsFileTime((LPFILETIME)&u64); 45 45 return u64 * 100; 46 46 47 #elif defined __L4__47 #elif defined RT_OS_L4 48 48 /** @todo fix a different timesource on l4. */ 49 49 return RTTimeNanoTS(); … … 96 96 u64OSElapsedTS, u64RTElapsedTS, u64OSElapsedTS - u64RTElapsedTS); 97 97 98 #if defined __WIN__ || defined __LINUX__98 #if defined RT_OS_WINDOWS || defined RT_OS_LINUX 99 99 RTPrintf("tstTime-2: RTTime1nsSteps -> %u out of %u calls\n", RTTime1nsSteps(), NUMBER_OF_CALLS); 100 100 #endif -
trunk/src/VBox/Runtime/testcase/tstTime-3.cpp
r2981 r3672 23 23 * Header Files * 24 24 *******************************************************************************/ 25 #ifdef __WIN__25 #ifdef RT_OS_WINDOWS 26 26 # include <Windows.h> 27 27 28 #elif defined __L4__28 #elif defined RT_OS_L4 29 29 30 30 #else /* posix */ … … 42 42 DECLINLINE(uint64_t) OSNanoTS(void) 43 43 { 44 #ifdef __WIN__44 #ifdef RT_OS_WINDOWS 45 45 uint64_t u64; /* manual say larger integer, should be safe to assume it's the same. */ 46 46 GetSystemTimeAsFileTime((LPFILETIME)&u64); 47 47 return u64 * 100; 48 48 49 #elif defined __L4__49 #elif defined RT_OS_L4 50 50 /** @todo fix a different timesource on l4. */ 51 51 return RTTimeNanoTS(); -
trunk/src/VBox/Runtime/testcase/tstTime.cpp
r2981 r3672 23 23 * Header Files * 24 24 *******************************************************************************/ 25 #ifdef __WIN__25 #ifdef RT_OS_WINDOWS 26 26 # include <Windows.h> 27 27 28 #elif defined __L4__28 #elif defined RT_OS_L4 29 29 30 30 #else /* posix */ … … 40 40 DECLINLINE(uint64_t) OSNanoTS(void) 41 41 { 42 #ifdef __WIN__42 #ifdef RT_OS_WINDOWS 43 43 uint64_t u64; /* manual say larger integer, should be safe to assume it's the same. */ 44 44 GetSystemTimeAsFileTime((LPFILETIME)&u64); 45 45 return u64 * 100; 46 46 47 #elif defined __L4__47 #elif defined RT_OS_L4 48 48 /** @todo fix a different timesource on l4. */ 49 49 return RTTimeNanoTS(); -
trunk/src/VBox/Runtime/timesup.cpp
r3393 r3672 86 86 { 87 87 u32TransactionId = pGip->aCPUs[0].u32TransactionId; 88 #ifdef __L4__88 #ifdef RT_OS_L4 89 89 Assert((u32TransactionId & 1) == 0); 90 90 #endif … … 113 113 114 114 u32TransactionId = pGipCpu->u32TransactionId; 115 #ifdef __L4__115 #ifdef RT_OS_L4 116 116 Assert((u32TransactionId & 1) == 0); 117 117 #endif … … 142 142 u64Delta = u32UpdateIntervalTSC; 143 143 } 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. */ 145 145 u64Delta = ASMMult2xU32RetU64((uint32_t)u64Delta, u32NanoTSFactor0); 146 146 u64Delta = ASMDivU64ByU32RetU32(u64Delta, u32UpdateIntervalTSC); -
trunk/src/VBox/Runtime/utf-8.cpp
r2981 r3672 974 974 { 975 975 /** @todo implement proper UTF-8 case-insensitive string comparison. */ 976 #ifdef __WIN__976 #ifdef RT_OS_WINDOWS 977 977 return stricmp(psz1, psz2); 978 #else /* ! __WIN32__*/978 #else /* !RT_OS_WINDOWS */ 979 979 return strcasecmp(psz1, psz2); 980 #endif /* ! __WIN32__*/981 } 980 #endif /* !RT_OS_WINDOWS */ 981 }
Note:
See TracChangeset
for help on using the changeset viewer.