Changeset 658 in vbox
- Timestamp:
- Feb 6, 2007 2:07:48 AM (18 years ago)
- svn:sync-xref-src-repo-rev:
- 18294
- Location:
- trunk/include/iprt
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/cdefs.h
r647 r658 33 33 # if defined(__LINUX__) && defined(__KERNEL__) 34 34 # error "oops" 35 # endif 35 # endif 36 36 # include <sys/cdefs.h> 37 37 #else … … 73 73 #define Breakpoint 74 74 #define RT_NO_DEPRECATED_MACROS 75 #define ARCH_BITS 76 #define HC_ARCH_BITS 77 #define R3_ARCH_BITS 78 #define R0_ARCH_BITS 79 #define GC_ARCH_BITS 75 80 #endif /* __DOXYGEN__ */ 76 81 … … 83 88 */ 84 89 #if !defined(__X86__) && !defined(__AMD64__) 85 # if defined(__amd64__) || defined(_ M_X64)90 # if defined(__amd64__) || defined(__x86_64__) || defined(_M_X64) 86 91 # define __AMD64__ 87 92 # elif defined(__i386__) || defined(_M_IX86) … … 90 95 # error "Check what predefined stuff your compiler uses to indicate architecture." 91 96 # endif 97 #elif defined(__X86__) && defined(__AMD64__) 98 # error "Both __X86__ and __AMD64__ cannot be defined at the same time!" 92 99 #endif 93 100 … … 109 116 # error "You must defined which context the compiled code should run in; IN_RING3, IN_RING0 or IN_GC" 110 117 #endif 118 #if (defined(IN_RING3) && (defined(IN_RING0) || defined(IN_GC)) ) \ 119 || (defined(IN_RING0) && (defined(IN_RING3) || defined(IN_GC)) ) \ 120 || (defined(IN_GC) && (defined(IN_RING3) || defined(IN_RING0)) ) 121 # error "Only one of the IN_RING3, IN_RING0, IN_GC defines should be defined." 122 #endif 123 124 125 /** @def ARCH_BITS 126 * Defines the bit count of the current context. 127 */ 128 #ifndef ARCH_BITS 129 # if defined(__AMD64__) 130 # define ARCH_BITS 64 131 # else 132 # define ARCH_BITS 32 133 # endif 134 #endif 135 136 /** @def HC_ARCH_BITS 137 * Defines the host architechture bit count. 138 */ 139 #ifndef HC_ARCH_BITS 140 # ifndef IN_GC 141 # define HC_ARCH_BITS ARCH_BITS 142 # else 143 # define HC_ARCH_BITS 32 144 # endif 145 #endif 146 147 /** @def R3_ARCH_BITS 148 * Defines the host ring-3 architechture bit count. 149 */ 150 #ifndef R3_ARCH_BITS 151 # ifdef IN_RING3 152 # define R3_ARCH_BITS ARCH_BITS 153 # else 154 # define R3_ARCH_BITS HC_ARCH_BITS 155 # endif 156 #endif 157 158 /** @def R0_ARCH_BITS 159 * Defines the host ring-0 architechture bit count. 160 */ 161 #ifndef R0_ARCH_BITS 162 # ifdef IN_RING0 163 # define R0_ARCH_BITS ARCH_BITS 164 # else 165 # define R0_ARCH_BITS HC_ARCH_BITS 166 # endif 167 #endif 168 169 /** @def GC_ARCH_BITS 170 * Defines the guest architechture bit count. 171 */ 172 #ifndef GC_ARCH_BITS 173 # ifdef IN_GC 174 # define GC_ARCH_BITS ARCH_BITS 175 # else 176 # define GC_ARCH_BITS 32 177 # endif 178 #endif 179 111 180 112 181 /** @def CTXTYPE … … 460 529 /** @def IN_RT_R3 461 530 * Used to indicate whether we're inside the same link module as 462 * the HC Ring-3 Runtime Library. 531 * the HC Ring-3 Runtime Library. 463 532 */ 464 533 /** @def RTR3DECL(type) … … 511 580 /** @def RT_NOCRT 512 581 * Symbol name wrapper for the No-CRT bits. 513 * 514 * In order to coexist in the same process as other CRTs, we need to 582 * 583 * In order to coexist in the same process as other CRTs, we need to 515 584 * decorate the symbols such that they don't conflict the ones in the 516 585 * other CRTs. The result of such conflicts / duplicate symbols can 517 586 * confuse the dynamic loader on unix like systems. 518 * 587 * 519 588 * Define RT_WITHOUT_NOCRT_WRAPPERS to drop the wrapping. 520 589 */ … … 528 597 # define RT_NOCRT(name) name 529 598 # define RT_NOCRT_STR(name) #name 530 #endif 599 #endif 531 600 532 601 … … 1037 1106 # define VALID_PTR(ptr) ( (uintptr_t)(ptr) + 0x1000U >= 0x2000U \ 1038 1107 && !((uintptr_t)(ptr) & 0xffff800000000000ULL) ) 1039 # endif 1108 # endif 1040 1109 # else /* !IN_RING3 */ 1041 1110 # define VALID_PTR(ptr) ( (uintptr_t)(ptr) + 0x1000U >= 0x2000U \ … … 1046 1115 # define VALID_PTR(ptr) ( (uintptr_t)(ptr) + 0x1000U >= 0x2000U ) 1047 1116 #else 1048 # error "Architecture identifier missing / not implemented." 1117 # error "Architecture identifier missing / not implemented." 1049 1118 #endif 1050 1119 -
trunk/include/iprt/types.h
r653 r658 342 342 */ 343 343 344 /** @def ARCH_BITS345 * Defines the bit count of the current context.346 */347 #ifndef ARCH_BITS348 # if defined(__x86_64__) || defined(__amd64__) || defined(_M_X64) || defined(_M_IA64) || defined(__AMD64__)349 # define ARCH_BITS 64350 # else351 # define ARCH_BITS 32352 # endif353 #endif354 355 /** @def HC_ARCH_BITS356 * Defines the host architechture bit count.357 */358 #ifndef HC_ARCH_BITS359 # ifndef IN_GC360 # define HC_ARCH_BITS ARCH_BITS361 # else362 # define HC_ARCH_BITS 32363 # endif364 #endif365 366 /** @def R3_ARCH_BITS367 * Defines the host ring-3 architechture bit count.368 */369 #ifndef R3_ARCH_BITS370 # ifdef IN_RING3371 # define R3_ARCH_BITS ARCH_BITS372 # else373 # define R3_ARCH_BITS HC_ARCH_BITS374 # endif375 #endif376 377 /** @def R0_ARCH_BITS378 * Defines the host ring-0 architechture bit count.379 */380 #ifndef R0_ARCH_BITS381 # ifdef IN_RING0382 # define R0_ARCH_BITS ARCH_BITS383 # else384 # define R0_ARCH_BITS HC_ARCH_BITS385 # endif386 #endif387 388 /** @def GC_ARCH_BITS389 * Defines the guest architechture bit count.390 */391 #ifndef GC_ARCH_BITS392 # ifdef IN_GC393 # define GC_ARCH_BITS ARCH_BITS394 # else395 # define GC_ARCH_BITS 32396 # endif397 #endif398 399 400 344 /** Signed integer which can contain both GC and HC pointers. */ 401 345 #if (HC_ARCH_BITS == 32 && GC_ARCH_BITS == 32)
Note:
See TracChangeset
for help on using the changeset viewer.