1 | /** @file
|
---|
2 | * IPRT - Types.
|
---|
3 | */
|
---|
4 |
|
---|
5 | /*
|
---|
6 | * Copyright (C) 2006-2014 Oracle Corporation
|
---|
7 | *
|
---|
8 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
9 | * available from http://www.virtualbox.org. This file is free software;
|
---|
10 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
11 | * General Public License (GPL) as published by the Free Software
|
---|
12 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
13 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
14 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
15 | *
|
---|
16 | * The contents of this file may alternatively be used under the terms
|
---|
17 | * of the Common Development and Distribution License Version 1.0
|
---|
18 | * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
|
---|
19 | * VirtualBox OSE distribution, in which case the provisions of the
|
---|
20 | * CDDL are applicable instead of those of the GPL.
|
---|
21 | *
|
---|
22 | * You may elect to license modified versions of this file under the
|
---|
23 | * terms and conditions of either the GPL or the CDDL or both.
|
---|
24 | */
|
---|
25 |
|
---|
26 | #ifndef ___iprt_types_h
|
---|
27 | #define ___iprt_types_h
|
---|
28 |
|
---|
29 | #include <iprt/cdefs.h>
|
---|
30 | #include <iprt/stdint.h>
|
---|
31 | #include <iprt/stdarg.h>
|
---|
32 |
|
---|
33 | /*
|
---|
34 | * Include standard C types.
|
---|
35 | */
|
---|
36 | #ifndef IPRT_NO_CRT
|
---|
37 |
|
---|
38 | # if defined(IN_XF86_MODULE) && !defined(NO_ANSIC)
|
---|
39 | /*
|
---|
40 | * Kludge for xfree86 modules: size_t and other types are redefined.
|
---|
41 | */
|
---|
42 | RT_C_DECLS_BEGIN
|
---|
43 | # include "xf86_ansic.h"
|
---|
44 | # undef NULL
|
---|
45 | RT_C_DECLS_END
|
---|
46 |
|
---|
47 | # elif defined(RT_OS_DARWIN) && defined(KERNEL)
|
---|
48 | /*
|
---|
49 | * Kludge for the darwin kernel:
|
---|
50 | * stddef.h is missing IIRC.
|
---|
51 | */
|
---|
52 | # ifndef _PTRDIFF_T
|
---|
53 | # define _PTRDIFF_T
|
---|
54 | typedef __darwin_ptrdiff_t ptrdiff_t;
|
---|
55 | # endif
|
---|
56 | # include <sys/types.h>
|
---|
57 |
|
---|
58 | # elif defined(RT_OS_FREEBSD) && defined(_KERNEL)
|
---|
59 | /*
|
---|
60 | * Kludge for the FreeBSD kernel:
|
---|
61 | * stddef.h and sys/types.h have slightly different offsetof definitions
|
---|
62 | * when compiling in kernel mode. This is just to make GCC shut up.
|
---|
63 | */
|
---|
64 | # ifndef _STDDEF_H_
|
---|
65 | # undef offsetof
|
---|
66 | # endif
|
---|
67 | # include <sys/stddef.h>
|
---|
68 | # ifndef _SYS_TYPES_H_
|
---|
69 | # undef offsetof
|
---|
70 | # endif
|
---|
71 | # include <sys/types.h>
|
---|
72 | # ifndef offsetof
|
---|
73 | # error "offsetof is not defined..."
|
---|
74 | # endif
|
---|
75 |
|
---|
76 | # elif defined(RT_OS_FREEBSD) && HC_ARCH_BITS == 64 && defined(RT_ARCH_X86)
|
---|
77 | /*
|
---|
78 | * Kludge for compiling 32-bit code on a 64-bit FreeBSD:
|
---|
79 | * FreeBSD declares uint64_t and int64_t wrong (long unsigned and long int
|
---|
80 | * though they need to be long long unsigned and long long int). These
|
---|
81 | * defines conflict with our declaration in stdint.h. Adding the defines
|
---|
82 | * below omits the definitions in the system header.
|
---|
83 | */
|
---|
84 | # include <stddef.h>
|
---|
85 | # define _UINT64_T_DECLARED
|
---|
86 | # define _INT64_T_DECLARED
|
---|
87 | # define _UINTPTR_T_DECLARED
|
---|
88 | # define _INTPTR_T_DECLARED
|
---|
89 | # include <sys/types.h>
|
---|
90 |
|
---|
91 | # elif defined(RT_OS_LINUX) && defined(__KERNEL__)
|
---|
92 | /*
|
---|
93 | * Kludge for the linux kernel:
|
---|
94 | * 1. sys/types.h doesn't mix with the kernel.
|
---|
95 | * 2. Starting with 2.6.19, linux/types.h typedefs bool and linux/stddef.h
|
---|
96 | * declares false and true as enum values.
|
---|
97 | * 3. Starting with 2.6.24, linux/types.h typedefs uintptr_t.
|
---|
98 | * We work around these issues here and nowhere else.
|
---|
99 | */
|
---|
100 | # include <stddef.h>
|
---|
101 | # if defined(__cplusplus)
|
---|
102 | typedef bool _Bool;
|
---|
103 | # endif
|
---|
104 | # define bool linux_bool
|
---|
105 | # define true linux_true
|
---|
106 | # define false linux_false
|
---|
107 | # define uintptr_t linux_uintptr_t
|
---|
108 | # include <linux/version.h>
|
---|
109 | # if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)
|
---|
110 | # include <generated/autoconf.h>
|
---|
111 | # else
|
---|
112 | # ifndef AUTOCONF_INCLUDED
|
---|
113 | # include <linux/autoconf.h>
|
---|
114 | # endif
|
---|
115 | # endif
|
---|
116 | # include <linux/compiler.h>
|
---|
117 | # if defined(__cplusplus)
|
---|
118 | /*
|
---|
119 | * Starting with 3.3, <linux/compiler-gcc.h> appends 'notrace' (which
|
---|
120 | * expands to __attribute__((no_instrument_function))) to inline,
|
---|
121 | * __inline and __inline__. Revert that.
|
---|
122 | */
|
---|
123 | # undef inline
|
---|
124 | # define inline inline
|
---|
125 | # undef __inline__
|
---|
126 | # define __inline__ __inline__
|
---|
127 | # undef __inline
|
---|
128 | # define __inline __inline
|
---|
129 | # endif
|
---|
130 | # include <linux/types.h>
|
---|
131 | # include <linux/stddef.h>
|
---|
132 | /*
|
---|
133 | * Starting with 3.4, <linux/stddef.h> defines NULL as '((void*)0)' which
|
---|
134 | * does not work for C++ code.
|
---|
135 | */
|
---|
136 | # undef NULL
|
---|
137 | # undef uintptr_t
|
---|
138 | # ifdef __GNUC__
|
---|
139 | # if (__GNUC__ * 100 + __GNUC_MINOR__) <= 400
|
---|
140 | /*
|
---|
141 | * <linux/compiler-gcc{3,4}.h> does
|
---|
142 | * #define __inline__ __inline__ __attribute__((always_inline))
|
---|
143 | * in some older Linux kernels. Forcing inlining will fail for some RTStrA*
|
---|
144 | * functions with gcc <= 4.0 due to passing variable argument lists.
|
---|
145 | */
|
---|
146 | # undef __inline__
|
---|
147 | # define __inline__ __inline__
|
---|
148 | # endif
|
---|
149 | # endif
|
---|
150 | # undef false
|
---|
151 | # undef true
|
---|
152 | # undef bool
|
---|
153 | # else
|
---|
154 | # include <stddef.h>
|
---|
155 | # include <sys/types.h>
|
---|
156 | # endif
|
---|
157 |
|
---|
158 |
|
---|
159 | /* Define any types missing from sys/types.h on windows. */
|
---|
160 | # ifdef _MSC_VER
|
---|
161 | # undef ssize_t
|
---|
162 | typedef intptr_t ssize_t;
|
---|
163 | # endif
|
---|
164 |
|
---|
165 | #else /* no crt */
|
---|
166 | # include <iprt/nocrt/compiler/compiler.h>
|
---|
167 | #endif /* no crt */
|
---|
168 |
|
---|
169 |
|
---|
170 |
|
---|
171 | /** @def NULL
|
---|
172 | * NULL pointer.
|
---|
173 | */
|
---|
174 | #ifndef NULL
|
---|
175 | # ifdef __cplusplus
|
---|
176 | # define NULL 0
|
---|
177 | # else
|
---|
178 | # define NULL ((void*)0)
|
---|
179 | # endif
|
---|
180 | #endif
|
---|
181 |
|
---|
182 |
|
---|
183 |
|
---|
184 | /** @defgroup grp_rt_types IPRT Base Types
|
---|
185 | * @{
|
---|
186 | */
|
---|
187 |
|
---|
188 | /* define wchar_t, we don't wanna include all the wcsstuff to get this. */
|
---|
189 | #ifdef _MSC_VER
|
---|
190 | # ifndef _WCHAR_T_DEFINED
|
---|
191 | typedef unsigned short wchar_t;
|
---|
192 | # define _WCHAR_T_DEFINED
|
---|
193 | # endif
|
---|
194 | #endif
|
---|
195 | #ifdef __GNUC__
|
---|
196 | /** @todo wchar_t on GNUC */
|
---|
197 | #endif
|
---|
198 |
|
---|
199 | /*
|
---|
200 | * C doesn't have bool, nor does VisualAge for C++ v3.08.
|
---|
201 | */
|
---|
202 | #if !defined(__cplusplus) || (defined(__IBMCPP__) && defined(RT_OS_OS2))
|
---|
203 | # if defined(__GNUC__)
|
---|
204 | # if defined(RT_OS_LINUX) && __GNUC__ < 3
|
---|
205 | typedef uint8_t bool;
|
---|
206 | # elif defined(RT_OS_FREEBSD)
|
---|
207 | # ifndef __bool_true_false_are_defined
|
---|
208 | typedef _Bool bool;
|
---|
209 | # endif
|
---|
210 | # else
|
---|
211 | # if (defined(RT_OS_DARWIN) || defined(RT_OS_HAIKU)) && (defined(_STDBOOL_H) || defined(__STDBOOL_H))
|
---|
212 | # undef bool
|
---|
213 | # endif
|
---|
214 | typedef _Bool bool;
|
---|
215 | # endif
|
---|
216 | # else
|
---|
217 | typedef unsigned char bool;
|
---|
218 | # endif
|
---|
219 | # ifndef true
|
---|
220 | # define true (1)
|
---|
221 | # endif
|
---|
222 | # ifndef false
|
---|
223 | # define false (0)
|
---|
224 | # endif
|
---|
225 | #endif
|
---|
226 |
|
---|
227 | /**
|
---|
228 | * 128-bit unsigned integer.
|
---|
229 | */
|
---|
230 | #if defined(__GNUC__) && defined(RT_ARCH_AMD64)
|
---|
231 | typedef __uint128_t uint128_t;
|
---|
232 | #else
|
---|
233 | typedef struct uint128_s
|
---|
234 | {
|
---|
235 | # ifdef RT_BIG_ENDIAN
|
---|
236 | uint64_t Hi;
|
---|
237 | uint64_t Lo;
|
---|
238 | # else
|
---|
239 | uint64_t Lo;
|
---|
240 | uint64_t Hi;
|
---|
241 | # endif
|
---|
242 | } uint128_t;
|
---|
243 | #endif
|
---|
244 |
|
---|
245 |
|
---|
246 | /**
|
---|
247 | * 128-bit signed integer.
|
---|
248 | */
|
---|
249 | #if defined(__GNUC__) && defined(RT_ARCH_AMD64)
|
---|
250 | typedef __int128_t int128_t;
|
---|
251 | #else
|
---|
252 | typedef struct int128_s
|
---|
253 | {
|
---|
254 | # ifdef RT_BIG_ENDIAN
|
---|
255 | int64_t Hi;
|
---|
256 | uint64_t Lo;
|
---|
257 | # else
|
---|
258 | uint64_t Lo;
|
---|
259 | int64_t Hi;
|
---|
260 | # endif
|
---|
261 | } int128_t;
|
---|
262 | #endif
|
---|
263 |
|
---|
264 |
|
---|
265 | /**
|
---|
266 | * 16-bit unsigned integer union.
|
---|
267 | */
|
---|
268 | typedef union RTUINT16U
|
---|
269 | {
|
---|
270 | /** natural view. */
|
---|
271 | uint16_t u;
|
---|
272 |
|
---|
273 | /** 16-bit view. */
|
---|
274 | uint16_t au16[1];
|
---|
275 | /** 8-bit view. */
|
---|
276 | uint8_t au8[2];
|
---|
277 | /** 16-bit hi/lo view. */
|
---|
278 | struct
|
---|
279 | {
|
---|
280 | #ifdef RT_BIG_ENDIAN
|
---|
281 | uint8_t Hi;
|
---|
282 | uint8_t Lo;
|
---|
283 | #else
|
---|
284 | uint8_t Lo;
|
---|
285 | uint8_t Hi;
|
---|
286 | #endif
|
---|
287 | } s;
|
---|
288 | } RTUINT16U;
|
---|
289 | /** Pointer to a 16-bit unsigned integer union. */
|
---|
290 | typedef RTUINT16U *PRTUINT16U;
|
---|
291 | /** Pointer to a const 32-bit unsigned integer union. */
|
---|
292 | typedef const RTUINT16U *PCRTUINT16U;
|
---|
293 |
|
---|
294 |
|
---|
295 | /**
|
---|
296 | * 32-bit unsigned integer union.
|
---|
297 | */
|
---|
298 | typedef union RTUINT32U
|
---|
299 | {
|
---|
300 | /** natural view. */
|
---|
301 | uint32_t u;
|
---|
302 | /** Hi/Low view. */
|
---|
303 | struct
|
---|
304 | {
|
---|
305 | #ifdef RT_BIG_ENDIAN
|
---|
306 | uint16_t Hi;
|
---|
307 | uint16_t Lo;
|
---|
308 | #else
|
---|
309 | uint16_t Lo;
|
---|
310 | uint16_t Hi;
|
---|
311 | #endif
|
---|
312 | } s;
|
---|
313 | /** Word view. */
|
---|
314 | struct
|
---|
315 | {
|
---|
316 | #ifdef RT_BIG_ENDIAN
|
---|
317 | uint16_t w1;
|
---|
318 | uint16_t w0;
|
---|
319 | #else
|
---|
320 | uint16_t w0;
|
---|
321 | uint16_t w1;
|
---|
322 | #endif
|
---|
323 | } Words;
|
---|
324 |
|
---|
325 | /** 32-bit view. */
|
---|
326 | uint32_t au32[1];
|
---|
327 | /** 16-bit view. */
|
---|
328 | uint16_t au16[2];
|
---|
329 | /** 8-bit view. */
|
---|
330 | uint8_t au8[4];
|
---|
331 | } RTUINT32U;
|
---|
332 | /** Pointer to a 32-bit unsigned integer union. */
|
---|
333 | typedef RTUINT32U *PRTUINT32U;
|
---|
334 | /** Pointer to a const 32-bit unsigned integer union. */
|
---|
335 | typedef const RTUINT32U *PCRTUINT32U;
|
---|
336 |
|
---|
337 |
|
---|
338 | /**
|
---|
339 | * 64-bit unsigned integer union.
|
---|
340 | */
|
---|
341 | typedef union RTUINT64U
|
---|
342 | {
|
---|
343 | /** Natural view. */
|
---|
344 | uint64_t u;
|
---|
345 | /** Hi/Low view. */
|
---|
346 | struct
|
---|
347 | {
|
---|
348 | #ifdef RT_BIG_ENDIAN
|
---|
349 | uint32_t Hi;
|
---|
350 | uint32_t Lo;
|
---|
351 | #else
|
---|
352 | uint32_t Lo;
|
---|
353 | uint32_t Hi;
|
---|
354 | #endif
|
---|
355 | } s;
|
---|
356 | /** Double-Word view. */
|
---|
357 | struct
|
---|
358 | {
|
---|
359 | #ifdef RT_BIG_ENDIAN
|
---|
360 | uint32_t dw1;
|
---|
361 | uint32_t dw0;
|
---|
362 | #else
|
---|
363 | uint32_t dw0;
|
---|
364 | uint32_t dw1;
|
---|
365 | #endif
|
---|
366 | } DWords;
|
---|
367 | /** Word view. */
|
---|
368 | struct
|
---|
369 | {
|
---|
370 | #ifdef RT_BIG_ENDIAN
|
---|
371 | uint16_t w3;
|
---|
372 | uint16_t w2;
|
---|
373 | uint16_t w1;
|
---|
374 | uint16_t w0;
|
---|
375 | #else
|
---|
376 | uint16_t w0;
|
---|
377 | uint16_t w1;
|
---|
378 | uint16_t w2;
|
---|
379 | uint16_t w3;
|
---|
380 | #endif
|
---|
381 | } Words;
|
---|
382 |
|
---|
383 | /** 64-bit view. */
|
---|
384 | uint64_t au64[1];
|
---|
385 | /** 32-bit view. */
|
---|
386 | uint32_t au32[2];
|
---|
387 | /** 16-bit view. */
|
---|
388 | uint16_t au16[4];
|
---|
389 | /** 8-bit view. */
|
---|
390 | uint8_t au8[8];
|
---|
391 | } RTUINT64U;
|
---|
392 | /** Pointer to a 64-bit unsigned integer union. */
|
---|
393 | typedef RTUINT64U *PRTUINT64U;
|
---|
394 | /** Pointer to a const 64-bit unsigned integer union. */
|
---|
395 | typedef const RTUINT64U *PCRTUINT64U;
|
---|
396 |
|
---|
397 |
|
---|
398 | /**
|
---|
399 | * 128-bit unsigned integer union.
|
---|
400 | */
|
---|
401 | #pragma pack(1)
|
---|
402 | typedef union RTUINT128U
|
---|
403 | {
|
---|
404 | /** Hi/Low view.
|
---|
405 | * @remarks We put this first so we can have portable initializers
|
---|
406 | * (RTUINT128_INIT) */
|
---|
407 | struct
|
---|
408 | {
|
---|
409 | #ifdef RT_BIG_ENDIAN
|
---|
410 | uint64_t Hi;
|
---|
411 | uint64_t Lo;
|
---|
412 | #else
|
---|
413 | uint64_t Lo;
|
---|
414 | uint64_t Hi;
|
---|
415 | #endif
|
---|
416 | } s;
|
---|
417 |
|
---|
418 | /** Natural view.
|
---|
419 | * WARNING! This member depends on the compiler supporting 128-bit stuff. */
|
---|
420 | uint128_t u;
|
---|
421 |
|
---|
422 | /** Quad-Word view. */
|
---|
423 | struct
|
---|
424 | {
|
---|
425 | #ifdef RT_BIG_ENDIAN
|
---|
426 | uint64_t qw1;
|
---|
427 | uint64_t qw0;
|
---|
428 | #else
|
---|
429 | uint64_t qw0;
|
---|
430 | uint64_t qw1;
|
---|
431 | #endif
|
---|
432 | } QWords;
|
---|
433 | /** Double-Word view. */
|
---|
434 | struct
|
---|
435 | {
|
---|
436 | #ifdef RT_BIG_ENDIAN
|
---|
437 | uint32_t dw3;
|
---|
438 | uint32_t dw2;
|
---|
439 | uint32_t dw1;
|
---|
440 | uint32_t dw0;
|
---|
441 | #else
|
---|
442 | uint32_t dw0;
|
---|
443 | uint32_t dw1;
|
---|
444 | uint32_t dw2;
|
---|
445 | uint32_t dw3;
|
---|
446 | #endif
|
---|
447 | } DWords;
|
---|
448 | /** Word view. */
|
---|
449 | struct
|
---|
450 | {
|
---|
451 | #ifdef RT_BIG_ENDIAN
|
---|
452 | uint16_t w7;
|
---|
453 | uint16_t w6;
|
---|
454 | uint16_t w5;
|
---|
455 | uint16_t w4;
|
---|
456 | uint16_t w3;
|
---|
457 | uint16_t w2;
|
---|
458 | uint16_t w1;
|
---|
459 | uint16_t w0;
|
---|
460 | #else
|
---|
461 | uint16_t w0;
|
---|
462 | uint16_t w1;
|
---|
463 | uint16_t w2;
|
---|
464 | uint16_t w3;
|
---|
465 | uint16_t w4;
|
---|
466 | uint16_t w5;
|
---|
467 | uint16_t w6;
|
---|
468 | uint16_t w7;
|
---|
469 | #endif
|
---|
470 | } Words;
|
---|
471 |
|
---|
472 | /** 64-bit view. */
|
---|
473 | uint64_t au64[2];
|
---|
474 | /** 32-bit view. */
|
---|
475 | uint32_t au32[4];
|
---|
476 | /** 16-bit view. */
|
---|
477 | uint16_t au16[8];
|
---|
478 | /** 8-bit view. */
|
---|
479 | uint8_t au8[16];
|
---|
480 | } RTUINT128U;
|
---|
481 | #pragma pack()
|
---|
482 | /** Pointer to a 64-bit unsigned integer union. */
|
---|
483 | typedef RTUINT128U *PRTUINT128U;
|
---|
484 | /** Pointer to a const 64-bit unsigned integer union. */
|
---|
485 | typedef const RTUINT128U *PCRTUINT128U;
|
---|
486 |
|
---|
487 | /** @def RTUINT128_INIT
|
---|
488 | * Portable RTUINT128U initializer. */
|
---|
489 | #ifdef RT_BIG_ENDIAN
|
---|
490 | # define RTUINT128_INIT(a_Hi, a_Lo) { { a_Hi, a_Lo } }
|
---|
491 | #else
|
---|
492 | # define RTUINT128_INIT(a_Hi, a_Lo) { { a_Lo, a_Hi } }
|
---|
493 | #endif
|
---|
494 |
|
---|
495 | /** @def RTUINT128_INIT_C
|
---|
496 | * Portable RTUINT128U initializer for 64-bit constants. */
|
---|
497 | #ifdef RT_BIG_ENDIAN
|
---|
498 | # define RTUINT128_INIT_C(a_Hi, a_Lo) { { UINT64_C(a_Hi), UINT64_C(a_Lo) } }
|
---|
499 | #else
|
---|
500 | # define RTUINT128_INIT_C(a_Hi, a_Lo) { { UINT64_C(a_Lo), UINT64_C(a_Hi) } }
|
---|
501 | #endif
|
---|
502 |
|
---|
503 |
|
---|
504 | /**
|
---|
505 | * Double precision floating point format (64-bit).
|
---|
506 | */
|
---|
507 | typedef union RTFLOAT64U
|
---|
508 | {
|
---|
509 | #if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86)
|
---|
510 | /** Double view. */
|
---|
511 | double rd;
|
---|
512 | #endif
|
---|
513 | /** Format using regular bitfields. */
|
---|
514 | struct
|
---|
515 | {
|
---|
516 | # ifdef RT_BIG_ENDIAN
|
---|
517 | /** The sign indicator. */
|
---|
518 | uint32_t fSign : 1;
|
---|
519 | /** The exponent (offseted by 1023). */
|
---|
520 | uint32_t uExponent : 11;
|
---|
521 | /** The fraction, bits 32 thru 51. */
|
---|
522 | uint32_t u20FractionHigh : 20;
|
---|
523 | /** The fraction, bits 0 thru 31. */
|
---|
524 | uint32_t u32FractionLow;
|
---|
525 | # else
|
---|
526 | /** The fraction, bits 0 thru 31. */
|
---|
527 | uint32_t u32FractionLow;
|
---|
528 | /** The fraction, bits 32 thru 51. */
|
---|
529 | uint32_t u20FractionHigh : 20;
|
---|
530 | /** The exponent (offseted by 1023). */
|
---|
531 | uint32_t uExponent : 11;
|
---|
532 | /** The sign indicator. */
|
---|
533 | uint32_t fSign : 1;
|
---|
534 | # endif
|
---|
535 | } s;
|
---|
536 |
|
---|
537 | #ifdef RT_COMPILER_GROKS_64BIT_BITFIELDS
|
---|
538 | /** Format using 64-bit bitfields. */
|
---|
539 | RT_GCC_EXTENSION struct
|
---|
540 | {
|
---|
541 | # ifdef RT_BIG_ENDIAN
|
---|
542 | /** The sign indicator. */
|
---|
543 | RT_GCC_EXTENSION uint64_t fSign : 1;
|
---|
544 | /** The exponent (offseted by 1023). */
|
---|
545 | RT_GCC_EXTENSION uint64_t uExponent : 11;
|
---|
546 | /** The fraction. */
|
---|
547 | RT_GCC_EXTENSION uint64_t uFraction : 52;
|
---|
548 | # else
|
---|
549 | /** The fraction. */
|
---|
550 | RT_GCC_EXTENSION uint64_t uFraction : 52;
|
---|
551 | /** The exponent (offseted by 1023). */
|
---|
552 | RT_GCC_EXTENSION uint64_t uExponent : 11;
|
---|
553 | /** The sign indicator. */
|
---|
554 | RT_GCC_EXTENSION uint64_t fSign : 1;
|
---|
555 | # endif
|
---|
556 | } s64;
|
---|
557 | #endif
|
---|
558 |
|
---|
559 | /** 64-bit view. */
|
---|
560 | uint64_t au64[1];
|
---|
561 | /** 32-bit view. */
|
---|
562 | uint32_t au32[2];
|
---|
563 | /** 16-bit view. */
|
---|
564 | uint16_t au16[4];
|
---|
565 | /** 8-bit view. */
|
---|
566 | uint8_t au8[8];
|
---|
567 | } RTFLOAT64U;
|
---|
568 | /** Pointer to a double precision floating point format union. */
|
---|
569 | typedef RTFLOAT64U *PRTFLOAT64U;
|
---|
570 | /** Pointer to a const double precision floating point format union. */
|
---|
571 | typedef const RTFLOAT64U *PCRTFLOAT64U;
|
---|
572 |
|
---|
573 |
|
---|
574 | #if !defined(__IBMCPP__) && !defined(__IBMC__)
|
---|
575 |
|
---|
576 | /**
|
---|
577 | * Extended Double precision floating point format (80-bit).
|
---|
578 | */
|
---|
579 | #pragma pack(1)
|
---|
580 | typedef union RTFLOAT80U
|
---|
581 | {
|
---|
582 | /** Format using bitfields. */
|
---|
583 | RT_GCC_EXTENSION struct
|
---|
584 | {
|
---|
585 | # ifdef RT_BIG_ENDIAN
|
---|
586 | /** The sign indicator. */
|
---|
587 | RT_GCC_EXTENSION uint16_t fSign : 1;
|
---|
588 | /** The exponent (offseted by 16383). */
|
---|
589 | RT_GCC_EXTENSION uint16_t uExponent : 15;
|
---|
590 | /** The mantissa. */
|
---|
591 | uint64_t u64Mantissa;
|
---|
592 | # else
|
---|
593 | /** The mantissa. */
|
---|
594 | uint64_t u64Mantissa;
|
---|
595 | /** The exponent (offseted by 16383). */
|
---|
596 | RT_GCC_EXTENSION uint16_t uExponent : 15;
|
---|
597 | /** The sign indicator. */
|
---|
598 | RT_GCC_EXTENSION uint16_t fSign : 1;
|
---|
599 | # endif
|
---|
600 | } s;
|
---|
601 |
|
---|
602 | /** 64-bit view. */
|
---|
603 | uint64_t au64[1];
|
---|
604 | /** 32-bit view. */
|
---|
605 | uint32_t au32[2];
|
---|
606 | /** 16-bit view. */
|
---|
607 | uint16_t au16[5];
|
---|
608 | /** 8-bit view. */
|
---|
609 | uint8_t au8[10];
|
---|
610 | } RTFLOAT80U;
|
---|
611 | #pragma pack()
|
---|
612 | /** Pointer to a extended precision floating point format union. */
|
---|
613 | typedef RTFLOAT80U *PRTFLOAT80U;
|
---|
614 | /** Pointer to a const extended precision floating point format union. */
|
---|
615 | typedef const RTFLOAT80U *PCRTFLOAT80U;
|
---|
616 |
|
---|
617 |
|
---|
618 | /**
|
---|
619 | * A variant of RTFLOAT80U that may be larger than 80-bits depending on how the
|
---|
620 | * compiler implements long double.
|
---|
621 | */
|
---|
622 | #pragma pack(1)
|
---|
623 | typedef union RTFLOAT80U2
|
---|
624 | {
|
---|
625 | #ifdef RT_COMPILER_WITH_80BIT_LONG_DOUBLE
|
---|
626 | /** Long double view. */
|
---|
627 | long double lrd;
|
---|
628 | #endif
|
---|
629 | /** Format using bitfields. */
|
---|
630 | RT_GCC_EXTENSION struct
|
---|
631 | {
|
---|
632 | #ifdef RT_BIG_ENDIAN
|
---|
633 | /** The sign indicator. */
|
---|
634 | RT_GCC_EXTENSION uint16_t fSign : 1;
|
---|
635 | /** The exponent (offseted by 16383). */
|
---|
636 | RT_GCC_EXTENSION uint16_t uExponent : 15;
|
---|
637 | /** The mantissa. */
|
---|
638 | uint64_t u64Mantissa;
|
---|
639 | #else
|
---|
640 | /** The mantissa. */
|
---|
641 | uint64_t u64Mantissa;
|
---|
642 | /** The exponent (offseted by 16383). */
|
---|
643 | RT_GCC_EXTENSION uint16_t uExponent : 15;
|
---|
644 | /** The sign indicator. */
|
---|
645 | RT_GCC_EXTENSION uint16_t fSign : 1;
|
---|
646 | #endif
|
---|
647 | } s;
|
---|
648 |
|
---|
649 | /** Bitfield exposing the J bit and the fraction. */
|
---|
650 | RT_GCC_EXTENSION struct
|
---|
651 | {
|
---|
652 | #ifdef RT_BIG_ENDIAN
|
---|
653 | /** The sign indicator. */
|
---|
654 | RT_GCC_EXTENSION uint16_t fSign : 1;
|
---|
655 | /** The exponent (offseted by 16383). */
|
---|
656 | RT_GCC_EXTENSION uint16_t uExponent : 15;
|
---|
657 | /** The J bit, aka the integer bit. */
|
---|
658 | uint32_t fInteger;
|
---|
659 | /** The fraction, bits 32 thru 62. */
|
---|
660 | uint32_t u31FractionHigh : 31;
|
---|
661 | /** The fraction, bits 0 thru 31. */
|
---|
662 | uint32_t u32FractionLow : 32;
|
---|
663 | #else
|
---|
664 | /** The fraction, bits 0 thru 31. */
|
---|
665 | uint32_t u32FractionLow : 32;
|
---|
666 | /** The fraction, bits 32 thru 62. */
|
---|
667 | uint32_t u31FractionHigh : 31;
|
---|
668 | /** The J bit, aka the integer bit. */
|
---|
669 | uint32_t fInteger;
|
---|
670 | /** The exponent (offseted by 16383). */
|
---|
671 | RT_GCC_EXTENSION uint16_t uExponent : 15;
|
---|
672 | /** The sign indicator. */
|
---|
673 | RT_GCC_EXTENSION uint16_t fSign : 1;
|
---|
674 | #endif
|
---|
675 | } sj;
|
---|
676 |
|
---|
677 | #ifdef RT_COMPILER_GROKS_64BIT_BITFIELDS
|
---|
678 | /** 64-bit bitfields exposing the J bit and the fraction. */
|
---|
679 | RT_GCC_EXTENSION struct
|
---|
680 | {
|
---|
681 | # ifdef RT_BIG_ENDIAN
|
---|
682 | /** The sign indicator. */
|
---|
683 | RT_GCC_EXTENSION uint16_t fSign : 1;
|
---|
684 | /** The exponent (offseted by 16383). */
|
---|
685 | RT_GCC_EXTENSION uint16_t uExponent : 15;
|
---|
686 | /** The J bit, aka the integer bit. */
|
---|
687 | RT_GCC_EXTENSION uint64_t fInteger : 1;
|
---|
688 | /** The fraction. */
|
---|
689 | RT_GCC_EXTENSION uint64_t u63Fraction : 63;
|
---|
690 | # else
|
---|
691 | /** The fraction. */
|
---|
692 | RT_GCC_EXTENSION uint64_t u63Fraction : 63;
|
---|
693 | /** The J bit, aka the integer bit. */
|
---|
694 | RT_GCC_EXTENSION uint64_t fInteger : 1;
|
---|
695 | /** The exponent (offseted by 16383). */
|
---|
696 | RT_GCC_EXTENSION uint16_t uExponent : 15;
|
---|
697 | /** The sign indicator. */
|
---|
698 | RT_GCC_EXTENSION uint16_t fSign : 1;
|
---|
699 | # endif
|
---|
700 | } sj64;
|
---|
701 | #endif
|
---|
702 |
|
---|
703 | /** 64-bit view. */
|
---|
704 | uint64_t au64[1];
|
---|
705 | /** 32-bit view. */
|
---|
706 | uint32_t au32[2];
|
---|
707 | /** 16-bit view. */
|
---|
708 | uint16_t au16[5];
|
---|
709 | /** 8-bit view. */
|
---|
710 | uint8_t au8[10];
|
---|
711 | } RTFLOAT80U2;
|
---|
712 | #pragma pack()
|
---|
713 | /** Pointer to a extended precision floating point format union, 2nd
|
---|
714 | * variant. */
|
---|
715 | typedef RTFLOAT80U2 *PRTFLOAT80U2;
|
---|
716 | /** Pointer to a const extended precision floating point format union, 2nd
|
---|
717 | * variant. */
|
---|
718 | typedef const RTFLOAT80U2 *PCRTFLOAT80U2;
|
---|
719 |
|
---|
720 | #endif /* uint16_t bitfields doesn't work */
|
---|
721 |
|
---|
722 |
|
---|
723 | /** Generic function type.
|
---|
724 | * @see PFNRT
|
---|
725 | */
|
---|
726 | typedef DECLCALLBACK(void) FNRT(void);
|
---|
727 |
|
---|
728 | /** Generic function pointer.
|
---|
729 | * With -pedantic, gcc-4 complains when casting a function to a data object, for
|
---|
730 | * example:
|
---|
731 | *
|
---|
732 | * @code
|
---|
733 | * void foo(void)
|
---|
734 | * {
|
---|
735 | * }
|
---|
736 | *
|
---|
737 | * void *bar = (void *)foo;
|
---|
738 | * @endcode
|
---|
739 | *
|
---|
740 | * The compiler would warn with "ISO C++ forbids casting between
|
---|
741 | * pointer-to-function and pointer-to-object". The purpose of this warning is
|
---|
742 | * not to bother the programmer but to point out that he is probably doing
|
---|
743 | * something dangerous, assigning a pointer to executable code to a data object.
|
---|
744 | */
|
---|
745 | typedef FNRT *PFNRT;
|
---|
746 |
|
---|
747 | /** Millisecond interval. */
|
---|
748 | typedef uint32_t RTMSINTERVAL;
|
---|
749 | /** Pointer to a millisecond interval. */
|
---|
750 | typedef RTMSINTERVAL *PRTMSINTERVAL;
|
---|
751 | /** Pointer to a const millisecond interval. */
|
---|
752 | typedef const RTMSINTERVAL *PCRTMSINTERVAL;
|
---|
753 |
|
---|
754 | /** Pointer to a time spec structure. */
|
---|
755 | typedef struct RTTIMESPEC *PRTTIMESPEC;
|
---|
756 | /** Pointer to a const time spec structure. */
|
---|
757 | typedef const struct RTTIMESPEC *PCRTTIMESPEC;
|
---|
758 |
|
---|
759 |
|
---|
760 |
|
---|
761 | /** @defgroup grp_rt_types_both Common Guest and Host Context Basic Types
|
---|
762 | * @ingroup grp_rt_types
|
---|
763 | * @{
|
---|
764 | */
|
---|
765 |
|
---|
766 | /** Signed integer which can contain both GC and HC pointers. */
|
---|
767 | #if (HC_ARCH_BITS == 32 && GC_ARCH_BITS == 32)
|
---|
768 | typedef int32_t RTINTPTR;
|
---|
769 | #elif (HC_ARCH_BITS == 64 || GC_ARCH_BITS == 64)
|
---|
770 | typedef int64_t RTINTPTR;
|
---|
771 | #else
|
---|
772 | # error Unsupported HC_ARCH_BITS and/or GC_ARCH_BITS values.
|
---|
773 | #endif
|
---|
774 | /** Pointer to signed integer which can contain both GC and HC pointers. */
|
---|
775 | typedef RTINTPTR *PRTINTPTR;
|
---|
776 | /** Pointer const to signed integer which can contain both GC and HC pointers. */
|
---|
777 | typedef const RTINTPTR *PCRTINTPTR;
|
---|
778 | /** The maximum value the RTINTPTR type can hold. */
|
---|
779 | #if (HC_ARCH_BITS == 32 && GC_ARCH_BITS == 32)
|
---|
780 | # define RTINTPTR_MAX INT32_MAX
|
---|
781 | #elif (HC_ARCH_BITS == 64 || GC_ARCH_BITS == 64)
|
---|
782 | # define RTINTPTR_MAX INT64_MAX
|
---|
783 | #else
|
---|
784 | # error Unsupported HC_ARCH_BITS and/or GC_ARCH_BITS values.
|
---|
785 | #endif
|
---|
786 | /** The minimum value the RTINTPTR type can hold. */
|
---|
787 | #if (HC_ARCH_BITS == 32 && GC_ARCH_BITS == 32)
|
---|
788 | # define RTINTPTR_MIN INT32_MIN
|
---|
789 | #elif (HC_ARCH_BITS == 64 || GC_ARCH_BITS == 64)
|
---|
790 | # define RTINTPTR_MIN INT64_MIN
|
---|
791 | #else
|
---|
792 | # error Unsupported HC_ARCH_BITS and/or GC_ARCH_BITS values.
|
---|
793 | #endif
|
---|
794 |
|
---|
795 | /** Unsigned integer which can contain both GC and HC pointers. */
|
---|
796 | #if (HC_ARCH_BITS == 32 && GC_ARCH_BITS == 32)
|
---|
797 | typedef uint32_t RTUINTPTR;
|
---|
798 | #elif (HC_ARCH_BITS == 64 || GC_ARCH_BITS == 64)
|
---|
799 | typedef uint64_t RTUINTPTR;
|
---|
800 | #else
|
---|
801 | # error Unsupported HC_ARCH_BITS and/or GC_ARCH_BITS values.
|
---|
802 | #endif
|
---|
803 | /** Pointer to unsigned integer which can contain both GC and HC pointers. */
|
---|
804 | typedef RTUINTPTR *PRTUINTPTR;
|
---|
805 | /** Pointer const to unsigned integer which can contain both GC and HC pointers. */
|
---|
806 | typedef const RTUINTPTR *PCRTUINTPTR;
|
---|
807 | /** The maximum value the RTUINTPTR type can hold. */
|
---|
808 | #if (HC_ARCH_BITS == 32 && GC_ARCH_BITS == 32)
|
---|
809 | # define RTUINTPTR_MAX UINT32_MAX
|
---|
810 | #elif (HC_ARCH_BITS == 64 || GC_ARCH_BITS == 64)
|
---|
811 | # define RTUINTPTR_MAX UINT64_MAX
|
---|
812 | #else
|
---|
813 | # error Unsupported HC_ARCH_BITS and/or GC_ARCH_BITS values.
|
---|
814 | #endif
|
---|
815 |
|
---|
816 | /** Signed integer. */
|
---|
817 | typedef int32_t RTINT;
|
---|
818 | /** Pointer to signed integer. */
|
---|
819 | typedef RTINT *PRTINT;
|
---|
820 | /** Pointer to const signed integer. */
|
---|
821 | typedef const RTINT *PCRTINT;
|
---|
822 |
|
---|
823 | /** Unsigned integer. */
|
---|
824 | typedef uint32_t RTUINT;
|
---|
825 | /** Pointer to unsigned integer. */
|
---|
826 | typedef RTUINT *PRTUINT;
|
---|
827 | /** Pointer to const unsigned integer. */
|
---|
828 | typedef const RTUINT *PCRTUINT;
|
---|
829 |
|
---|
830 | /** A file offset / size (off_t). */
|
---|
831 | typedef int64_t RTFOFF;
|
---|
832 | /** Pointer to a file offset / size. */
|
---|
833 | typedef RTFOFF *PRTFOFF;
|
---|
834 | /** The max value for RTFOFF. */
|
---|
835 | #define RTFOFF_MAX INT64_MAX
|
---|
836 | /** The min value for RTFOFF. */
|
---|
837 | #define RTFOFF_MIN INT64_MIN
|
---|
838 |
|
---|
839 | /** File mode (see iprt/fs.h). */
|
---|
840 | typedef uint32_t RTFMODE;
|
---|
841 | /** Pointer to file mode. */
|
---|
842 | typedef RTFMODE *PRTFMODE;
|
---|
843 |
|
---|
844 | /** Device unix number. */
|
---|
845 | typedef uint32_t RTDEV;
|
---|
846 | /** Pointer to a device unix number. */
|
---|
847 | typedef RTDEV *PRTDEV;
|
---|
848 |
|
---|
849 | /** @name RTDEV Macros
|
---|
850 | * @{ */
|
---|
851 | /**
|
---|
852 | * Our makedev macro.
|
---|
853 | * @returns RTDEV
|
---|
854 | * @param uMajor The major device number.
|
---|
855 | * @param uMinor The minor device number.
|
---|
856 | */
|
---|
857 | #define RTDEV_MAKE(uMajor, uMinor) ((RTDEV)( ((RTDEV)(uMajor) << 24) | (uMinor & UINT32_C(0x00ffffff)) ))
|
---|
858 | /**
|
---|
859 | * Get the major device node number from an RTDEV type.
|
---|
860 | * @returns The major device number of @a uDev
|
---|
861 | * @param uDev The device number.
|
---|
862 | */
|
---|
863 | #define RTDEV_MAJOR(uDev) ((uDev) >> 24)
|
---|
864 | /**
|
---|
865 | * Get the minor device node number from an RTDEV type.
|
---|
866 | * @returns The minor device number of @a uDev
|
---|
867 | * @param uDev The device number.
|
---|
868 | */
|
---|
869 | #define RTDEV_MINOR(uDev) ((uDev) & UINT32_C(0x00ffffff))
|
---|
870 | /** @} */
|
---|
871 |
|
---|
872 | /** i-node number. */
|
---|
873 | typedef uint64_t RTINODE;
|
---|
874 | /** Pointer to a i-node number. */
|
---|
875 | typedef RTINODE *PRTINODE;
|
---|
876 |
|
---|
877 | /** User id. */
|
---|
878 | typedef uint32_t RTUID;
|
---|
879 | /** Pointer to a user id. */
|
---|
880 | typedef RTUID *PRTUID;
|
---|
881 | /** NIL user id.
|
---|
882 | * @todo check this for portability! */
|
---|
883 | #define NIL_RTUID (~(RTUID)0)
|
---|
884 |
|
---|
885 | /** Group id. */
|
---|
886 | typedef uint32_t RTGID;
|
---|
887 | /** Pointer to a group id. */
|
---|
888 | typedef RTGID *PRTGID;
|
---|
889 | /** NIL group id.
|
---|
890 | * @todo check this for portability! */
|
---|
891 | #define NIL_RTGID (~(RTGID)0)
|
---|
892 |
|
---|
893 | /** I/O Port. */
|
---|
894 | typedef uint16_t RTIOPORT;
|
---|
895 | /** Pointer to I/O Port. */
|
---|
896 | typedef RTIOPORT *PRTIOPORT;
|
---|
897 | /** Pointer to const I/O Port. */
|
---|
898 | typedef const RTIOPORT *PCRTIOPORT;
|
---|
899 |
|
---|
900 | /** Selector. */
|
---|
901 | typedef uint16_t RTSEL;
|
---|
902 | /** Pointer to selector. */
|
---|
903 | typedef RTSEL *PRTSEL;
|
---|
904 | /** Pointer to const selector. */
|
---|
905 | typedef const RTSEL *PCRTSEL;
|
---|
906 | /** Max selector value. */
|
---|
907 | #define RTSEL_MAX UINT16_MAX
|
---|
908 |
|
---|
909 | /** Far 16-bit pointer. */
|
---|
910 | #pragma pack(1)
|
---|
911 | typedef struct RTFAR16
|
---|
912 | {
|
---|
913 | uint16_t off;
|
---|
914 | RTSEL sel;
|
---|
915 | } RTFAR16;
|
---|
916 | #pragma pack()
|
---|
917 | /** Pointer to Far 16-bit pointer. */
|
---|
918 | typedef RTFAR16 *PRTFAR16;
|
---|
919 | /** Pointer to const Far 16-bit pointer. */
|
---|
920 | typedef const RTFAR16 *PCRTFAR16;
|
---|
921 |
|
---|
922 | /** Far 32-bit pointer. */
|
---|
923 | #pragma pack(1)
|
---|
924 | typedef struct RTFAR32
|
---|
925 | {
|
---|
926 | uint32_t off;
|
---|
927 | RTSEL sel;
|
---|
928 | } RTFAR32;
|
---|
929 | #pragma pack()
|
---|
930 | /** Pointer to Far 32-bit pointer. */
|
---|
931 | typedef RTFAR32 *PRTFAR32;
|
---|
932 | /** Pointer to const Far 32-bit pointer. */
|
---|
933 | typedef const RTFAR32 *PCRTFAR32;
|
---|
934 |
|
---|
935 | /** Far 64-bit pointer. */
|
---|
936 | #pragma pack(1)
|
---|
937 | typedef struct RTFAR64
|
---|
938 | {
|
---|
939 | uint64_t off;
|
---|
940 | RTSEL sel;
|
---|
941 | } RTFAR64;
|
---|
942 | #pragma pack()
|
---|
943 | /** Pointer to Far 64-bit pointer. */
|
---|
944 | typedef RTFAR64 *PRTFAR64;
|
---|
945 | /** Pointer to const Far 64-bit pointer. */
|
---|
946 | typedef const RTFAR64 *PCRTFAR64;
|
---|
947 |
|
---|
948 | /** @} */
|
---|
949 |
|
---|
950 |
|
---|
951 | /** @defgroup grp_rt_types_hc Host Context Basic Types
|
---|
952 | * @ingroup grp_rt_types
|
---|
953 | * @{
|
---|
954 | */
|
---|
955 |
|
---|
956 | /** HC Natural signed integer.
|
---|
957 | * @deprecated silly type. */
|
---|
958 | typedef int32_t RTHCINT;
|
---|
959 | /** Pointer to HC Natural signed integer.
|
---|
960 | * @deprecated silly type. */
|
---|
961 | typedef RTHCINT *PRTHCINT;
|
---|
962 | /** Pointer to const HC Natural signed integer.
|
---|
963 | * @deprecated silly type. */
|
---|
964 | typedef const RTHCINT *PCRTHCINT;
|
---|
965 |
|
---|
966 | /** HC Natural unsigned integer.
|
---|
967 | * @deprecated silly type. */
|
---|
968 | typedef uint32_t RTHCUINT;
|
---|
969 | /** Pointer to HC Natural unsigned integer.
|
---|
970 | * @deprecated silly type. */
|
---|
971 | typedef RTHCUINT *PRTHCUINT;
|
---|
972 | /** Pointer to const HC Natural unsigned integer.
|
---|
973 | * @deprecated silly type. */
|
---|
974 | typedef const RTHCUINT *PCRTHCUINT;
|
---|
975 |
|
---|
976 |
|
---|
977 | /** Signed integer which can contain a HC pointer. */
|
---|
978 | #if HC_ARCH_BITS == 32
|
---|
979 | typedef int32_t RTHCINTPTR;
|
---|
980 | #elif HC_ARCH_BITS == 64
|
---|
981 | typedef int64_t RTHCINTPTR;
|
---|
982 | #else
|
---|
983 | # error Unsupported HC_ARCH_BITS value.
|
---|
984 | #endif
|
---|
985 | /** Pointer to signed integer which can contain a HC pointer. */
|
---|
986 | typedef RTHCINTPTR *PRTHCINTPTR;
|
---|
987 | /** Pointer to const signed integer which can contain a HC pointer. */
|
---|
988 | typedef const RTHCINTPTR *PCRTHCINTPTR;
|
---|
989 | /** Max RTHCINTPTR value. */
|
---|
990 | #if HC_ARCH_BITS == 32
|
---|
991 | # define RTHCINTPTR_MAX INT32_MAX
|
---|
992 | #else
|
---|
993 | # define RTHCINTPTR_MAX INT64_MAX
|
---|
994 | #endif
|
---|
995 | /** Min RTHCINTPTR value. */
|
---|
996 | #if HC_ARCH_BITS == 32
|
---|
997 | # define RTHCINTPTR_MIN INT32_MIN
|
---|
998 | #else
|
---|
999 | # define RTHCINTPTR_MIN INT64_MIN
|
---|
1000 | #endif
|
---|
1001 |
|
---|
1002 | /** Signed integer which can contain a HC ring-3 pointer. */
|
---|
1003 | #if R3_ARCH_BITS == 32
|
---|
1004 | typedef int32_t RTR3INTPTR;
|
---|
1005 | #elif R3_ARCH_BITS == 64
|
---|
1006 | typedef int64_t RTR3INTPTR;
|
---|
1007 | #else
|
---|
1008 | # error Unsupported R3_ARCH_BITS value.
|
---|
1009 | #endif
|
---|
1010 | /** Pointer to signed integer which can contain a HC ring-3 pointer. */
|
---|
1011 | typedef RTR3INTPTR *PRTR3INTPTR;
|
---|
1012 | /** Pointer to const signed integer which can contain a HC ring-3 pointer. */
|
---|
1013 | typedef const RTR3INTPTR *PCRTR3INTPTR;
|
---|
1014 | /** Max RTR3INTPTR value. */
|
---|
1015 | #if R3_ARCH_BITS == 32
|
---|
1016 | # define RTR3INTPTR_MAX INT32_MAX
|
---|
1017 | #else
|
---|
1018 | # define RTR3INTPTR_MAX INT64_MAX
|
---|
1019 | #endif
|
---|
1020 | /** Min RTR3INTPTR value. */
|
---|
1021 | #if R3_ARCH_BITS == 32
|
---|
1022 | # define RTR3INTPTR_MIN INT32_MIN
|
---|
1023 | #else
|
---|
1024 | # define RTR3INTPTR_MIN INT64_MIN
|
---|
1025 | #endif
|
---|
1026 |
|
---|
1027 | /** Signed integer which can contain a HC ring-0 pointer. */
|
---|
1028 | #if R0_ARCH_BITS == 32
|
---|
1029 | typedef int32_t RTR0INTPTR;
|
---|
1030 | #elif R0_ARCH_BITS == 64
|
---|
1031 | typedef int64_t RTR0INTPTR;
|
---|
1032 | #else
|
---|
1033 | # error Unsupported R0_ARCH_BITS value.
|
---|
1034 | #endif
|
---|
1035 | /** Pointer to signed integer which can contain a HC ring-0 pointer. */
|
---|
1036 | typedef RTR0INTPTR *PRTR0INTPTR;
|
---|
1037 | /** Pointer to const signed integer which can contain a HC ring-0 pointer. */
|
---|
1038 | typedef const RTR0INTPTR *PCRTR0INTPTR;
|
---|
1039 | /** Max RTR0INTPTR value. */
|
---|
1040 | #if R0_ARCH_BITS == 32
|
---|
1041 | # define RTR0INTPTR_MAX INT32_MAX
|
---|
1042 | #else
|
---|
1043 | # define RTR0INTPTR_MAX INT64_MAX
|
---|
1044 | #endif
|
---|
1045 | /** Min RTHCINTPTR value. */
|
---|
1046 | #if R0_ARCH_BITS == 32
|
---|
1047 | # define RTR0INTPTR_MIN INT32_MIN
|
---|
1048 | #else
|
---|
1049 | # define RTR0INTPTR_MIN INT64_MIN
|
---|
1050 | #endif
|
---|
1051 |
|
---|
1052 |
|
---|
1053 | /** Unsigned integer which can contain a HC pointer. */
|
---|
1054 | #if HC_ARCH_BITS == 32
|
---|
1055 | typedef uint32_t RTHCUINTPTR;
|
---|
1056 | #elif HC_ARCH_BITS == 64
|
---|
1057 | typedef uint64_t RTHCUINTPTR;
|
---|
1058 | #else
|
---|
1059 | # error Unsupported HC_ARCH_BITS value.
|
---|
1060 | #endif
|
---|
1061 | /** Pointer to unsigned integer which can contain a HC pointer. */
|
---|
1062 | typedef RTHCUINTPTR *PRTHCUINTPTR;
|
---|
1063 | /** Pointer to unsigned integer which can contain a HC pointer. */
|
---|
1064 | typedef const RTHCUINTPTR *PCRTHCUINTPTR;
|
---|
1065 | /** Max RTHCUINTTPR value. */
|
---|
1066 | #if HC_ARCH_BITS == 32
|
---|
1067 | # define RTHCUINTPTR_MAX UINT32_MAX
|
---|
1068 | #else
|
---|
1069 | # define RTHCUINTPTR_MAX UINT64_MAX
|
---|
1070 | #endif
|
---|
1071 |
|
---|
1072 | /** Unsigned integer which can contain a HC ring-3 pointer. */
|
---|
1073 | #if R3_ARCH_BITS == 32
|
---|
1074 | typedef uint32_t RTR3UINTPTR;
|
---|
1075 | #elif R3_ARCH_BITS == 64
|
---|
1076 | typedef uint64_t RTR3UINTPTR;
|
---|
1077 | #else
|
---|
1078 | # error Unsupported R3_ARCH_BITS value.
|
---|
1079 | #endif
|
---|
1080 | /** Pointer to unsigned integer which can contain a HC ring-3 pointer. */
|
---|
1081 | typedef RTR3UINTPTR *PRTR3UINTPTR;
|
---|
1082 | /** Pointer to unsigned integer which can contain a HC ring-3 pointer. */
|
---|
1083 | typedef const RTR3UINTPTR *PCRTR3UINTPTR;
|
---|
1084 | /** Max RTHCUINTTPR value. */
|
---|
1085 | #if R3_ARCH_BITS == 32
|
---|
1086 | # define RTR3UINTPTR_MAX UINT32_MAX
|
---|
1087 | #else
|
---|
1088 | # define RTR3UINTPTR_MAX UINT64_MAX
|
---|
1089 | #endif
|
---|
1090 |
|
---|
1091 | /** Unsigned integer which can contain a HC ring-0 pointer. */
|
---|
1092 | #if R0_ARCH_BITS == 32
|
---|
1093 | typedef uint32_t RTR0UINTPTR;
|
---|
1094 | #elif R0_ARCH_BITS == 64
|
---|
1095 | typedef uint64_t RTR0UINTPTR;
|
---|
1096 | #else
|
---|
1097 | # error Unsupported R0_ARCH_BITS value.
|
---|
1098 | #endif
|
---|
1099 | /** Pointer to unsigned integer which can contain a HC ring-0 pointer. */
|
---|
1100 | typedef RTR0UINTPTR *PRTR0UINTPTR;
|
---|
1101 | /** Pointer to unsigned integer which can contain a HC ring-0 pointer. */
|
---|
1102 | typedef const RTR0UINTPTR *PCRTR0UINTPTR;
|
---|
1103 | /** Max RTR0UINTTPR value. */
|
---|
1104 | #if HC_ARCH_BITS == 32
|
---|
1105 | # define RTR0UINTPTR_MAX UINT32_MAX
|
---|
1106 | #else
|
---|
1107 | # define RTR0UINTPTR_MAX UINT64_MAX
|
---|
1108 | #endif
|
---|
1109 |
|
---|
1110 |
|
---|
1111 | /** Host Physical Memory Address. */
|
---|
1112 | typedef uint64_t RTHCPHYS;
|
---|
1113 | /** Pointer to Host Physical Memory Address. */
|
---|
1114 | typedef RTHCPHYS *PRTHCPHYS;
|
---|
1115 | /** Pointer to const Host Physical Memory Address. */
|
---|
1116 | typedef const RTHCPHYS *PCRTHCPHYS;
|
---|
1117 | /** @def NIL_RTHCPHYS
|
---|
1118 | * NIL HC Physical Address.
|
---|
1119 | * NIL_RTHCPHYS is used to signal an invalid physical address, similar
|
---|
1120 | * to the NULL pointer.
|
---|
1121 | */
|
---|
1122 | #define NIL_RTHCPHYS (~(RTHCPHYS)0)
|
---|
1123 | /** Max RTHCPHYS value. */
|
---|
1124 | #define RTHCPHYS_MAX UINT64_MAX
|
---|
1125 |
|
---|
1126 |
|
---|
1127 | /** HC pointer. */
|
---|
1128 | #ifndef IN_RC
|
---|
1129 | typedef void * RTHCPTR;
|
---|
1130 | #else
|
---|
1131 | typedef RTHCUINTPTR RTHCPTR;
|
---|
1132 | #endif
|
---|
1133 | /** Pointer to HC pointer. */
|
---|
1134 | typedef RTHCPTR *PRTHCPTR;
|
---|
1135 | /** Pointer to const HC pointer. */
|
---|
1136 | typedef const RTHCPTR *PCRTHCPTR;
|
---|
1137 | /** @def NIL_RTHCPTR
|
---|
1138 | * NIL HC pointer.
|
---|
1139 | */
|
---|
1140 | #define NIL_RTHCPTR ((RTHCPTR)0)
|
---|
1141 | /** Max RTHCPTR value. */
|
---|
1142 | #define RTHCPTR_MAX ((RTHCPTR)RTHCUINTPTR_MAX)
|
---|
1143 |
|
---|
1144 |
|
---|
1145 | /** HC ring-3 pointer. */
|
---|
1146 | #ifdef IN_RING3
|
---|
1147 | typedef void * RTR3PTR;
|
---|
1148 | #else
|
---|
1149 | typedef RTR3UINTPTR RTR3PTR;
|
---|
1150 | #endif
|
---|
1151 | /** Pointer to HC ring-3 pointer. */
|
---|
1152 | typedef RTR3PTR *PRTR3PTR;
|
---|
1153 | /** Pointer to const HC ring-3 pointer. */
|
---|
1154 | typedef const RTR3PTR *PCRTR3PTR;
|
---|
1155 | /** @def NIL_RTR3PTR
|
---|
1156 | * NIL HC ring-3 pointer.
|
---|
1157 | */
|
---|
1158 | #ifndef IN_RING3
|
---|
1159 | # define NIL_RTR3PTR ((RTR3PTR)0)
|
---|
1160 | #else
|
---|
1161 | # define NIL_RTR3PTR (NULL)
|
---|
1162 | #endif
|
---|
1163 | /** Max RTR3PTR value. */
|
---|
1164 | #define RTR3PTR_MAX ((RTR3PTR)RTR3UINTPTR_MAX)
|
---|
1165 |
|
---|
1166 | /** HC ring-0 pointer. */
|
---|
1167 | #ifdef IN_RING0
|
---|
1168 | typedef void * RTR0PTR;
|
---|
1169 | #else
|
---|
1170 | typedef RTR0UINTPTR RTR0PTR;
|
---|
1171 | #endif
|
---|
1172 | /** Pointer to HC ring-0 pointer. */
|
---|
1173 | typedef RTR0PTR *PRTR0PTR;
|
---|
1174 | /** Pointer to const HC ring-0 pointer. */
|
---|
1175 | typedef const RTR0PTR *PCRTR0PTR;
|
---|
1176 | /** @def NIL_RTR0PTR
|
---|
1177 | * NIL HC ring-0 pointer.
|
---|
1178 | */
|
---|
1179 | #ifndef IN_RING0
|
---|
1180 | # define NIL_RTR0PTR ((RTR0PTR)0)
|
---|
1181 | #else
|
---|
1182 | # define NIL_RTR0PTR (NULL)
|
---|
1183 | #endif
|
---|
1184 | /** Max RTR3PTR value. */
|
---|
1185 | #define RTR0PTR_MAX ((RTR0PTR)RTR0UINTPTR_MAX)
|
---|
1186 |
|
---|
1187 |
|
---|
1188 | /** Unsigned integer register in the host context. */
|
---|
1189 | #if HC_ARCH_BITS == 32
|
---|
1190 | typedef uint32_t RTHCUINTREG;
|
---|
1191 | #elif HC_ARCH_BITS == 64
|
---|
1192 | typedef uint64_t RTHCUINTREG;
|
---|
1193 | #else
|
---|
1194 | # error "Unsupported HC_ARCH_BITS!"
|
---|
1195 | #endif
|
---|
1196 | /** Pointer to an unsigned integer register in the host context. */
|
---|
1197 | typedef RTHCUINTREG *PRTHCUINTREG;
|
---|
1198 | /** Pointer to a const unsigned integer register in the host context. */
|
---|
1199 | typedef const RTHCUINTREG *PCRTHCUINTREG;
|
---|
1200 |
|
---|
1201 | /** Unsigned integer register in the host ring-3 context. */
|
---|
1202 | #if R3_ARCH_BITS == 32
|
---|
1203 | typedef uint32_t RTR3UINTREG;
|
---|
1204 | #elif R3_ARCH_BITS == 64
|
---|
1205 | typedef uint64_t RTR3UINTREG;
|
---|
1206 | #else
|
---|
1207 | # error "Unsupported R3_ARCH_BITS!"
|
---|
1208 | #endif
|
---|
1209 | /** Pointer to an unsigned integer register in the host ring-3 context. */
|
---|
1210 | typedef RTR3UINTREG *PRTR3UINTREG;
|
---|
1211 | /** Pointer to a const unsigned integer register in the host ring-3 context. */
|
---|
1212 | typedef const RTR3UINTREG *PCRTR3UINTREG;
|
---|
1213 |
|
---|
1214 | /** Unsigned integer register in the host ring-3 context. */
|
---|
1215 | #if R0_ARCH_BITS == 32
|
---|
1216 | typedef uint32_t RTR0UINTREG;
|
---|
1217 | #elif R0_ARCH_BITS == 64
|
---|
1218 | typedef uint64_t RTR0UINTREG;
|
---|
1219 | #else
|
---|
1220 | # error "Unsupported R3_ARCH_BITS!"
|
---|
1221 | #endif
|
---|
1222 | /** Pointer to an unsigned integer register in the host ring-3 context. */
|
---|
1223 | typedef RTR0UINTREG *PRTR0UINTREG;
|
---|
1224 | /** Pointer to a const unsigned integer register in the host ring-3 context. */
|
---|
1225 | typedef const RTR0UINTREG *PCRTR0UINTREG;
|
---|
1226 |
|
---|
1227 | /** @} */
|
---|
1228 |
|
---|
1229 |
|
---|
1230 | /** @defgroup grp_rt_types_gc Guest Context Basic Types
|
---|
1231 | * @ingroup grp_rt_types
|
---|
1232 | * @{
|
---|
1233 | */
|
---|
1234 |
|
---|
1235 | /** Natural signed integer in the GC.
|
---|
1236 | * @deprecated silly type. */
|
---|
1237 | #if GC_ARCH_BITS == 32
|
---|
1238 | typedef int32_t RTGCINT;
|
---|
1239 | #elif GC_ARCH_BITS == 64 /** @todo this isn't right, natural int is 32-bit, see RTHCINT. */
|
---|
1240 | typedef int64_t RTGCINT;
|
---|
1241 | #endif
|
---|
1242 | /** Pointer to natural signed integer in GC.
|
---|
1243 | * @deprecated silly type. */
|
---|
1244 | typedef RTGCINT *PRTGCINT;
|
---|
1245 | /** Pointer to const natural signed integer in GC.
|
---|
1246 | * @deprecated silly type. */
|
---|
1247 | typedef const RTGCINT *PCRTGCINT;
|
---|
1248 |
|
---|
1249 | /** Natural unsigned integer in the GC.
|
---|
1250 | * @deprecated silly type. */
|
---|
1251 | #if GC_ARCH_BITS == 32
|
---|
1252 | typedef uint32_t RTGCUINT;
|
---|
1253 | #elif GC_ARCH_BITS == 64 /** @todo this isn't right, natural int is 32-bit, see RTHCUINT. */
|
---|
1254 | typedef uint64_t RTGCUINT;
|
---|
1255 | #endif
|
---|
1256 | /** Pointer to natural unsigned integer in GC.
|
---|
1257 | * @deprecated silly type. */
|
---|
1258 | typedef RTGCUINT *PRTGCUINT;
|
---|
1259 | /** Pointer to const natural unsigned integer in GC.
|
---|
1260 | * @deprecated silly type. */
|
---|
1261 | typedef const RTGCUINT *PCRTGCUINT;
|
---|
1262 |
|
---|
1263 | /** Signed integer which can contain a GC pointer. */
|
---|
1264 | #if GC_ARCH_BITS == 32
|
---|
1265 | typedef int32_t RTGCINTPTR;
|
---|
1266 | #elif GC_ARCH_BITS == 64
|
---|
1267 | typedef int64_t RTGCINTPTR;
|
---|
1268 | #endif
|
---|
1269 | /** Pointer to signed integer which can contain a GC pointer. */
|
---|
1270 | typedef RTGCINTPTR *PRTGCINTPTR;
|
---|
1271 | /** Pointer to const signed integer which can contain a GC pointer. */
|
---|
1272 | typedef const RTGCINTPTR *PCRTGCINTPTR;
|
---|
1273 |
|
---|
1274 | /** Unsigned integer which can contain a GC pointer. */
|
---|
1275 | #if GC_ARCH_BITS == 32
|
---|
1276 | typedef uint32_t RTGCUINTPTR;
|
---|
1277 | #elif GC_ARCH_BITS == 64
|
---|
1278 | typedef uint64_t RTGCUINTPTR;
|
---|
1279 | #else
|
---|
1280 | # error Unsupported GC_ARCH_BITS value.
|
---|
1281 | #endif
|
---|
1282 | /** Pointer to unsigned integer which can contain a GC pointer. */
|
---|
1283 | typedef RTGCUINTPTR *PRTGCUINTPTR;
|
---|
1284 | /** Pointer to unsigned integer which can contain a GC pointer. */
|
---|
1285 | typedef const RTGCUINTPTR *PCRTGCUINTPTR;
|
---|
1286 |
|
---|
1287 | /** Unsigned integer which can contain a 32 bits GC pointer. */
|
---|
1288 | typedef uint32_t RTGCUINTPTR32;
|
---|
1289 | /** Pointer to unsigned integer which can contain a 32 bits GC pointer. */
|
---|
1290 | typedef RTGCUINTPTR32 *PRTGCUINTPTR32;
|
---|
1291 | /** Pointer to unsigned integer which can contain a 32 bits GC pointer. */
|
---|
1292 | typedef const RTGCUINTPTR32 *PCRTGCUINTPTR32;
|
---|
1293 |
|
---|
1294 | /** Unsigned integer which can contain a 64 bits GC pointer. */
|
---|
1295 | typedef uint64_t RTGCUINTPTR64;
|
---|
1296 | /** Pointer to unsigned integer which can contain a 32 bits GC pointer. */
|
---|
1297 | typedef RTGCUINTPTR64 *PRTGCUINTPTR64;
|
---|
1298 | /** Pointer to unsigned integer which can contain a 32 bits GC pointer. */
|
---|
1299 | typedef const RTGCUINTPTR64 *PCRTGCUINTPTR64;
|
---|
1300 |
|
---|
1301 | /** Guest Physical Memory Address.*/
|
---|
1302 | typedef uint64_t RTGCPHYS;
|
---|
1303 | /** Pointer to Guest Physical Memory Address. */
|
---|
1304 | typedef RTGCPHYS *PRTGCPHYS;
|
---|
1305 | /** Pointer to const Guest Physical Memory Address. */
|
---|
1306 | typedef const RTGCPHYS *PCRTGCPHYS;
|
---|
1307 | /** @def NIL_RTGCPHYS
|
---|
1308 | * NIL GC Physical Address.
|
---|
1309 | * NIL_RTGCPHYS is used to signal an invalid physical address, similar
|
---|
1310 | * to the NULL pointer. Note that this value may actually be valid in
|
---|
1311 | * some contexts.
|
---|
1312 | */
|
---|
1313 | #define NIL_RTGCPHYS (~(RTGCPHYS)0U)
|
---|
1314 | /** Max guest physical memory address value. */
|
---|
1315 | #define RTGCPHYS_MAX UINT64_MAX
|
---|
1316 |
|
---|
1317 |
|
---|
1318 | /** Guest Physical Memory Address; limited to 32 bits.*/
|
---|
1319 | typedef uint32_t RTGCPHYS32;
|
---|
1320 | /** Pointer to Guest Physical Memory Address. */
|
---|
1321 | typedef RTGCPHYS32 *PRTGCPHYS32;
|
---|
1322 | /** Pointer to const Guest Physical Memory Address. */
|
---|
1323 | typedef const RTGCPHYS32 *PCRTGCPHYS32;
|
---|
1324 | /** @def NIL_RTGCPHYS32
|
---|
1325 | * NIL GC Physical Address.
|
---|
1326 | * NIL_RTGCPHYS32 is used to signal an invalid physical address, similar
|
---|
1327 | * to the NULL pointer. Note that this value may actually be valid in
|
---|
1328 | * some contexts.
|
---|
1329 | */
|
---|
1330 | #define NIL_RTGCPHYS32 (~(RTGCPHYS32)0)
|
---|
1331 |
|
---|
1332 |
|
---|
1333 | /** Guest Physical Memory Address; limited to 64 bits.*/
|
---|
1334 | typedef uint64_t RTGCPHYS64;
|
---|
1335 | /** Pointer to Guest Physical Memory Address. */
|
---|
1336 | typedef RTGCPHYS64 *PRTGCPHYS64;
|
---|
1337 | /** Pointer to const Guest Physical Memory Address. */
|
---|
1338 | typedef const RTGCPHYS64 *PCRTGCPHYS64;
|
---|
1339 | /** @def NIL_RTGCPHYS64
|
---|
1340 | * NIL GC Physical Address.
|
---|
1341 | * NIL_RTGCPHYS64 is used to signal an invalid physical address, similar
|
---|
1342 | * to the NULL pointer. Note that this value may actually be valid in
|
---|
1343 | * some contexts.
|
---|
1344 | */
|
---|
1345 | #define NIL_RTGCPHYS64 (~(RTGCPHYS64)0)
|
---|
1346 |
|
---|
1347 | /** Guest context pointer, 32 bits.
|
---|
1348 | * Keep in mind that this type is an unsigned integer in
|
---|
1349 | * HC and void pointer in GC.
|
---|
1350 | */
|
---|
1351 | typedef RTGCUINTPTR32 RTGCPTR32;
|
---|
1352 | /** Pointer to a guest context pointer. */
|
---|
1353 | typedef RTGCPTR32 *PRTGCPTR32;
|
---|
1354 | /** Pointer to a const guest context pointer. */
|
---|
1355 | typedef const RTGCPTR32 *PCRTGCPTR32;
|
---|
1356 | /** @def NIL_RTGCPTR32
|
---|
1357 | * NIL GC pointer.
|
---|
1358 | */
|
---|
1359 | #define NIL_RTGCPTR32 ((RTGCPTR32)0)
|
---|
1360 |
|
---|
1361 | /** Guest context pointer, 64 bits.
|
---|
1362 | */
|
---|
1363 | typedef RTGCUINTPTR64 RTGCPTR64;
|
---|
1364 | /** Pointer to a guest context pointer. */
|
---|
1365 | typedef RTGCPTR64 *PRTGCPTR64;
|
---|
1366 | /** Pointer to a const guest context pointer. */
|
---|
1367 | typedef const RTGCPTR64 *PCRTGCPTR64;
|
---|
1368 | /** @def NIL_RTGCPTR64
|
---|
1369 | * NIL GC pointer.
|
---|
1370 | */
|
---|
1371 | #define NIL_RTGCPTR64 ((RTGCPTR64)0)
|
---|
1372 |
|
---|
1373 | /** Guest context pointer.
|
---|
1374 | * Keep in mind that this type is an unsigned integer in
|
---|
1375 | * HC and void pointer in GC.
|
---|
1376 | */
|
---|
1377 | #if GC_ARCH_BITS == 64
|
---|
1378 | typedef RTGCPTR64 RTGCPTR;
|
---|
1379 | /** Pointer to a guest context pointer. */
|
---|
1380 | typedef PRTGCPTR64 PRTGCPTR;
|
---|
1381 | /** Pointer to a const guest context pointer. */
|
---|
1382 | typedef PCRTGCPTR64 PCRTGCPTR;
|
---|
1383 | /** @def NIL_RTGCPTR
|
---|
1384 | * NIL GC pointer.
|
---|
1385 | */
|
---|
1386 | # define NIL_RTGCPTR NIL_RTGCPTR64
|
---|
1387 | /** Max RTGCPTR value. */
|
---|
1388 | # define RTGCPTR_MAX UINT64_MAX
|
---|
1389 | #elif GC_ARCH_BITS == 32
|
---|
1390 | typedef RTGCPTR32 RTGCPTR;
|
---|
1391 | /** Pointer to a guest context pointer. */
|
---|
1392 | typedef PRTGCPTR32 PRTGCPTR;
|
---|
1393 | /** Pointer to a const guest context pointer. */
|
---|
1394 | typedef PCRTGCPTR32 PCRTGCPTR;
|
---|
1395 | /** @def NIL_RTGCPTR
|
---|
1396 | * NIL GC pointer.
|
---|
1397 | */
|
---|
1398 | # define NIL_RTGCPTR NIL_RTGCPTR32
|
---|
1399 | /** Max RTGCPTR value. */
|
---|
1400 | # define RTGCPTR_MAX UINT32_MAX
|
---|
1401 | #else
|
---|
1402 | # error "Unsupported GC_ARCH_BITS!"
|
---|
1403 | #endif
|
---|
1404 |
|
---|
1405 | /** Unsigned integer register in the guest context. */
|
---|
1406 | typedef uint32_t RTGCUINTREG32;
|
---|
1407 | /** Pointer to an unsigned integer register in the guest context. */
|
---|
1408 | typedef RTGCUINTREG32 *PRTGCUINTREG32;
|
---|
1409 | /** Pointer to a const unsigned integer register in the guest context. */
|
---|
1410 | typedef const RTGCUINTREG32 *PCRTGCUINTREG32;
|
---|
1411 |
|
---|
1412 | typedef uint64_t RTGCUINTREG64;
|
---|
1413 | /** Pointer to an unsigned integer register in the guest context. */
|
---|
1414 | typedef RTGCUINTREG64 *PRTGCUINTREG64;
|
---|
1415 | /** Pointer to a const unsigned integer register in the guest context. */
|
---|
1416 | typedef const RTGCUINTREG64 *PCRTGCUINTREG64;
|
---|
1417 |
|
---|
1418 | #if GC_ARCH_BITS == 64
|
---|
1419 | typedef RTGCUINTREG64 RTGCUINTREG;
|
---|
1420 | #elif GC_ARCH_BITS == 32
|
---|
1421 | typedef RTGCUINTREG32 RTGCUINTREG;
|
---|
1422 | #else
|
---|
1423 | # error "Unsupported GC_ARCH_BITS!"
|
---|
1424 | #endif
|
---|
1425 | /** Pointer to an unsigned integer register in the guest context. */
|
---|
1426 | typedef RTGCUINTREG *PRTGCUINTREG;
|
---|
1427 | /** Pointer to a const unsigned integer register in the guest context. */
|
---|
1428 | typedef const RTGCUINTREG *PCRTGCUINTREG;
|
---|
1429 |
|
---|
1430 | /** @} */
|
---|
1431 |
|
---|
1432 | /** @defgroup grp_rt_types_rc Raw mode Context Basic Types
|
---|
1433 | * @ingroup grp_rt_types
|
---|
1434 | * @{
|
---|
1435 | */
|
---|
1436 |
|
---|
1437 | /** Raw mode context pointer; a 32 bits guest context pointer.
|
---|
1438 | * Keep in mind that this type is an unsigned integer in
|
---|
1439 | * HC and void pointer in RC.
|
---|
1440 | */
|
---|
1441 | #ifdef IN_RC
|
---|
1442 | typedef void * RTRCPTR;
|
---|
1443 | #else
|
---|
1444 | typedef uint32_t RTRCPTR;
|
---|
1445 | #endif
|
---|
1446 | /** Pointer to a raw mode context pointer. */
|
---|
1447 | typedef RTRCPTR *PRTRCPTR;
|
---|
1448 | /** Pointer to a const raw mode context pointer. */
|
---|
1449 | typedef const RTRCPTR *PCRTRCPTR;
|
---|
1450 | /** @def NIL_RTGCPTR
|
---|
1451 | * NIL RC pointer.
|
---|
1452 | */
|
---|
1453 | #ifndef IN_RC
|
---|
1454 | # define NIL_RTRCPTR ((RTRCPTR)0)
|
---|
1455 | #else
|
---|
1456 | # define NIL_RTRCPTR (NULL)
|
---|
1457 | #endif
|
---|
1458 | /** @def RTRCPTR_MAX
|
---|
1459 | * The maximum value a RTRCPTR can have. Mostly used as INVALID value.
|
---|
1460 | */
|
---|
1461 | #define RTRCPTR_MAX ((RTRCPTR)UINT32_MAX)
|
---|
1462 |
|
---|
1463 | /** Raw mode context pointer, unsigned integer variant. */
|
---|
1464 | typedef int32_t RTRCINTPTR;
|
---|
1465 | /** @def RTRCUINTPTR_MAX
|
---|
1466 | * The maximum value a RTRCUINPTR can have.
|
---|
1467 | */
|
---|
1468 | #define RTRCUINTPTR_MAX ((RTRCUINTPTR)UINT32_MAX)
|
---|
1469 |
|
---|
1470 | /** Raw mode context pointer, signed integer variant. */
|
---|
1471 | typedef uint32_t RTRCUINTPTR;
|
---|
1472 | /** @def RTRCINTPTR_MIN
|
---|
1473 | * The minimum value a RTRCINPTR can have.
|
---|
1474 | */
|
---|
1475 | #define RTRCINTPTR_MIN ((RTRCINTPTR)INT32_MIN)
|
---|
1476 | /** @def RTRCINTPTR_MAX
|
---|
1477 | * The maximum value a RTRCINPTR can have.
|
---|
1478 | */
|
---|
1479 | #define RTRCINTPTR_MAX ((RTRCINTPTR)INT32_MAX)
|
---|
1480 |
|
---|
1481 | /** @} */
|
---|
1482 |
|
---|
1483 |
|
---|
1484 | /** @defgroup grp_rt_types_cc Current Context Basic Types
|
---|
1485 | * @ingroup grp_rt_types
|
---|
1486 | * @{
|
---|
1487 | */
|
---|
1488 |
|
---|
1489 | /** Current Context Physical Memory Address.*/
|
---|
1490 | #ifdef IN_RC
|
---|
1491 | typedef RTGCPHYS RTCCPHYS;
|
---|
1492 | #else
|
---|
1493 | typedef RTHCPHYS RTCCPHYS;
|
---|
1494 | #endif
|
---|
1495 | /** Pointer to Current Context Physical Memory Address. */
|
---|
1496 | typedef RTCCPHYS *PRTCCPHYS;
|
---|
1497 | /** Pointer to const Current Context Physical Memory Address. */
|
---|
1498 | typedef const RTCCPHYS *PCRTCCPHYS;
|
---|
1499 | /** @def NIL_RTCCPHYS
|
---|
1500 | * NIL CC Physical Address.
|
---|
1501 | * NIL_RTCCPHYS is used to signal an invalid physical address, similar
|
---|
1502 | * to the NULL pointer.
|
---|
1503 | */
|
---|
1504 | #ifdef IN_RC
|
---|
1505 | # define NIL_RTCCPHYS NIL_RTGCPHYS
|
---|
1506 | #else
|
---|
1507 | # define NIL_RTCCPHYS NIL_RTHCPHYS
|
---|
1508 | #endif
|
---|
1509 |
|
---|
1510 | /** Unsigned integer register in the current context. */
|
---|
1511 | #if ARCH_BITS == 32
|
---|
1512 | typedef uint32_t RTCCUINTREG;
|
---|
1513 | #elif ARCH_BITS == 64
|
---|
1514 | typedef uint64_t RTCCUINTREG;
|
---|
1515 | #else
|
---|
1516 | # error "Unsupported ARCH_BITS!"
|
---|
1517 | #endif
|
---|
1518 | /** Pointer to an unsigned integer register in the current context. */
|
---|
1519 | typedef RTCCUINTREG *PRTCCUINTREG;
|
---|
1520 | /** Pointer to a const unsigned integer register in the current context. */
|
---|
1521 | typedef RTCCUINTREG const *PCRTCCUINTREG;
|
---|
1522 |
|
---|
1523 | /** Signed integer register in the current context. */
|
---|
1524 | #if ARCH_BITS == 32
|
---|
1525 | typedef int32_t RTCCINTREG;
|
---|
1526 | #elif ARCH_BITS == 64
|
---|
1527 | typedef int64_t RTCCINTREG;
|
---|
1528 | #endif
|
---|
1529 | /** Pointer to a signed integer register in the current context. */
|
---|
1530 | typedef RTCCINTREG *PRTCCINTREG;
|
---|
1531 | /** Pointer to a const signed integer register in the current context. */
|
---|
1532 | typedef RTCCINTREG const *PCRTCCINTREG;
|
---|
1533 |
|
---|
1534 | /** @} */
|
---|
1535 |
|
---|
1536 |
|
---|
1537 |
|
---|
1538 | /** Pointer to a big integer number. */
|
---|
1539 | typedef struct RTBIGNUM *PRTBIGNUM;
|
---|
1540 | /** Pointer to a const big integer number. */
|
---|
1541 | typedef struct RTBIGNUM const *PCRTBIGNUM;
|
---|
1542 |
|
---|
1543 |
|
---|
1544 | /** Pointer to a critical section. */
|
---|
1545 | typedef struct RTCRITSECT *PRTCRITSECT;
|
---|
1546 | /** Pointer to a const critical section. */
|
---|
1547 | typedef const struct RTCRITSECT *PCRTCRITSECT;
|
---|
1548 |
|
---|
1549 | /** Pointer to a read/write critical section. */
|
---|
1550 | typedef struct RTCRITSECTRW *PRTCRITSECTRW;
|
---|
1551 | /** Pointer to a const read/write critical section. */
|
---|
1552 | typedef const struct RTCRITSECTRW *PCRTCRITSECTRW;
|
---|
1553 |
|
---|
1554 |
|
---|
1555 | /** Condition variable handle. */
|
---|
1556 | typedef R3PTRTYPE(struct RTCONDVARINTERNAL *) RTCONDVAR;
|
---|
1557 | /** Pointer to a condition variable handle. */
|
---|
1558 | typedef RTCONDVAR *PRTCONDVAR;
|
---|
1559 | /** Nil condition variable handle. */
|
---|
1560 | #define NIL_RTCONDVAR 0
|
---|
1561 |
|
---|
1562 | /** Cryptographic (certificate) store handle. */
|
---|
1563 | typedef R3R0PTRTYPE(struct RTCRSTOREINT *) RTCRSTORE;
|
---|
1564 | /** Pointer to a Cryptographic (certificate) store handle. */
|
---|
1565 | typedef RTCRSTORE *PRTCRSTORE;
|
---|
1566 | /** Nil Cryptographic (certificate) store handle. */
|
---|
1567 | #define NIL_RTCRSTORE 0
|
---|
1568 |
|
---|
1569 | /** Pointer to a const (store) certificate context. */
|
---|
1570 | typedef struct RTCRCERTCTX const *PCRTCRCERTCTX;
|
---|
1571 |
|
---|
1572 | /** Cryptographic message digest handle. */
|
---|
1573 | typedef R3R0PTRTYPE(struct RTCRDIGESTINT *) RTCRDIGEST;
|
---|
1574 | /** Pointer to a cryptographic message digest handle. */
|
---|
1575 | typedef RTCRDIGEST *PRTCRDIGEST;
|
---|
1576 | /** NIL cryptographic message digest handle. */
|
---|
1577 | #define NIL_RTCRDIGEST (0)
|
---|
1578 |
|
---|
1579 | /** Public key encryption schema handle. */
|
---|
1580 | typedef R3R0PTRTYPE(struct RTCRPKIXENCRYPTIONINT *) RTCRPKIXENCRYPTION;
|
---|
1581 | /** Pointer to a public key encryption schema handle. */
|
---|
1582 | typedef RTCRPKIXENCRYPTION *PRTCRPKIXENCRYPTION;
|
---|
1583 | /** NIL public key encryption schema handle */
|
---|
1584 | #define NIL_RTCRPKIXENCRYPTION (0)
|
---|
1585 |
|
---|
1586 | /** Public key signature schema handle. */
|
---|
1587 | typedef R3R0PTRTYPE(struct RTCRPKIXSIGNATUREINT *) RTCRPKIXSIGNATURE;
|
---|
1588 | /** Pointer to a public key signature schema handle. */
|
---|
1589 | typedef RTCRPKIXSIGNATURE *PRTCRPKIXSIGNATURE;
|
---|
1590 | /** NIL public key signature schema handle */
|
---|
1591 | #define NIL_RTCRPKIXSIGNATURE (0)
|
---|
1592 |
|
---|
1593 | /** X.509 certificate paths builder & validator handle. */
|
---|
1594 | typedef R3R0PTRTYPE(struct RTCRX509CERTPATHSINT *) RTCRX509CERTPATHS;
|
---|
1595 | /** Pointer to a certificate paths builder & validator handle. */
|
---|
1596 | typedef RTCRX509CERTPATHS *PRTCRX509CERTPATHS;
|
---|
1597 | /** Nil certificate paths builder & validator handle. */
|
---|
1598 | #define NIL_RTCRX509CERTPATHS 0
|
---|
1599 |
|
---|
1600 | /** File handle. */
|
---|
1601 | typedef R3R0PTRTYPE(struct RTFILEINT *) RTFILE;
|
---|
1602 | /** Pointer to file handle. */
|
---|
1603 | typedef RTFILE *PRTFILE;
|
---|
1604 | /** Nil file handle. */
|
---|
1605 | #define NIL_RTFILE ((RTFILE)~(RTHCINTPTR)0)
|
---|
1606 |
|
---|
1607 | /** Async I/O request handle. */
|
---|
1608 | typedef R3PTRTYPE(struct RTFILEAIOREQINTERNAL *) RTFILEAIOREQ;
|
---|
1609 | /** Pointer to an async I/O request handle. */
|
---|
1610 | typedef RTFILEAIOREQ *PRTFILEAIOREQ;
|
---|
1611 | /** Nil request handle. */
|
---|
1612 | #define NIL_RTFILEAIOREQ 0
|
---|
1613 |
|
---|
1614 | /** Async I/O completion context handle. */
|
---|
1615 | typedef R3PTRTYPE(struct RTFILEAIOCTXINTERNAL *) RTFILEAIOCTX;
|
---|
1616 | /** Pointer to an async I/O completion context handle. */
|
---|
1617 | typedef RTFILEAIOCTX *PRTFILEAIOCTX;
|
---|
1618 | /** Nil context handle. */
|
---|
1619 | #define NIL_RTFILEAIOCTX 0
|
---|
1620 |
|
---|
1621 | /** Loader module handle. */
|
---|
1622 | typedef R3R0PTRTYPE(struct RTLDRMODINTERNAL *) RTLDRMOD;
|
---|
1623 | /** Pointer to a loader module handle. */
|
---|
1624 | typedef RTLDRMOD *PRTLDRMOD;
|
---|
1625 | /** Nil loader module handle. */
|
---|
1626 | #define NIL_RTLDRMOD 0
|
---|
1627 |
|
---|
1628 | /** Lock validator class handle. */
|
---|
1629 | typedef R3R0PTRTYPE(struct RTLOCKVALCLASSINT *) RTLOCKVALCLASS;
|
---|
1630 | /** Pointer to a lock validator class handle. */
|
---|
1631 | typedef RTLOCKVALCLASS *PRTLOCKVALCLASS;
|
---|
1632 | /** Nil lock validator class handle. */
|
---|
1633 | #define NIL_RTLOCKVALCLASS ((RTLOCKVALCLASS)0)
|
---|
1634 |
|
---|
1635 | /** Ring-0 memory object handle. */
|
---|
1636 | typedef R0PTRTYPE(struct RTR0MEMOBJINTERNAL *) RTR0MEMOBJ;
|
---|
1637 | /** Pointer to a Ring-0 memory object handle. */
|
---|
1638 | typedef RTR0MEMOBJ *PRTR0MEMOBJ;
|
---|
1639 | /** Nil ring-0 memory object handle. */
|
---|
1640 | #define NIL_RTR0MEMOBJ 0
|
---|
1641 |
|
---|
1642 | /** Native thread handle. */
|
---|
1643 | typedef RTHCUINTPTR RTNATIVETHREAD;
|
---|
1644 | /** Pointer to an native thread handle. */
|
---|
1645 | typedef RTNATIVETHREAD *PRTNATIVETHREAD;
|
---|
1646 | /** Nil native thread handle. */
|
---|
1647 | #define NIL_RTNATIVETHREAD (~(RTNATIVETHREAD)0)
|
---|
1648 |
|
---|
1649 | /** Pipe handle. */
|
---|
1650 | typedef R3R0PTRTYPE(struct RTPIPEINTERNAL *) RTPIPE;
|
---|
1651 | /** Pointer to a pipe handle. */
|
---|
1652 | typedef RTPIPE *PRTPIPE;
|
---|
1653 | /** Nil pipe handle.
|
---|
1654 | * @remarks This is not 0 because of UNIX and OS/2 handle values. Take care! */
|
---|
1655 | #define NIL_RTPIPE ((RTPIPE)RTHCUINTPTR_MAX)
|
---|
1656 |
|
---|
1657 | /** @typedef RTPOLLSET
|
---|
1658 | * Poll set handle. */
|
---|
1659 | typedef R3R0PTRTYPE(struct RTPOLLSETINTERNAL *) RTPOLLSET;
|
---|
1660 | /** Pointer to a poll set handle. */
|
---|
1661 | typedef RTPOLLSET *PRTPOLLSET;
|
---|
1662 | /** Nil poll set handle handle. */
|
---|
1663 | #define NIL_RTPOLLSET ((RTPOLLSET)0)
|
---|
1664 |
|
---|
1665 | /** Process identifier. */
|
---|
1666 | typedef uint32_t RTPROCESS;
|
---|
1667 | /** Pointer to a process identifier. */
|
---|
1668 | typedef RTPROCESS *PRTPROCESS;
|
---|
1669 | /** Nil process identifier. */
|
---|
1670 | #define NIL_RTPROCESS (~(RTPROCESS)0)
|
---|
1671 |
|
---|
1672 | /** Process ring-0 handle. */
|
---|
1673 | typedef RTR0UINTPTR RTR0PROCESS;
|
---|
1674 | /** Pointer to a ring-0 process handle. */
|
---|
1675 | typedef RTR0PROCESS *PRTR0PROCESS;
|
---|
1676 | /** Nil ring-0 process handle. */
|
---|
1677 | #define NIL_RTR0PROCESS (~(RTR0PROCESS)0)
|
---|
1678 |
|
---|
1679 | /** @typedef RTSEMEVENT
|
---|
1680 | * Event Semaphore handle. */
|
---|
1681 | typedef R3R0PTRTYPE(struct RTSEMEVENTINTERNAL *) RTSEMEVENT;
|
---|
1682 | /** Pointer to an event semaphore handle. */
|
---|
1683 | typedef RTSEMEVENT *PRTSEMEVENT;
|
---|
1684 | /** Nil event semaphore handle. */
|
---|
1685 | #define NIL_RTSEMEVENT 0
|
---|
1686 |
|
---|
1687 | /** @typedef RTSEMEVENTMULTI
|
---|
1688 | * Event Multiple Release Semaphore handle. */
|
---|
1689 | typedef R3R0PTRTYPE(struct RTSEMEVENTMULTIINTERNAL *) RTSEMEVENTMULTI;
|
---|
1690 | /** Pointer to an event multiple release semaphore handle. */
|
---|
1691 | typedef RTSEMEVENTMULTI *PRTSEMEVENTMULTI;
|
---|
1692 | /** Nil multiple release event semaphore handle. */
|
---|
1693 | #define NIL_RTSEMEVENTMULTI 0
|
---|
1694 |
|
---|
1695 | /** @typedef RTSEMFASTMUTEX
|
---|
1696 | * Fast mutex Semaphore handle. */
|
---|
1697 | typedef R3R0PTRTYPE(struct RTSEMFASTMUTEXINTERNAL *) RTSEMFASTMUTEX;
|
---|
1698 | /** Pointer to a fast mutex semaphore handle. */
|
---|
1699 | typedef RTSEMFASTMUTEX *PRTSEMFASTMUTEX;
|
---|
1700 | /** Nil fast mutex semaphore handle. */
|
---|
1701 | #define NIL_RTSEMFASTMUTEX 0
|
---|
1702 |
|
---|
1703 | /** @typedef RTSEMMUTEX
|
---|
1704 | * Mutex Semaphore handle. */
|
---|
1705 | typedef R3R0PTRTYPE(struct RTSEMMUTEXINTERNAL *) RTSEMMUTEX;
|
---|
1706 | /** Pointer to a mutex semaphore handle. */
|
---|
1707 | typedef RTSEMMUTEX *PRTSEMMUTEX;
|
---|
1708 | /** Nil mutex semaphore handle. */
|
---|
1709 | #define NIL_RTSEMMUTEX 0
|
---|
1710 |
|
---|
1711 | /** @typedef RTSEMSPINMUTEX
|
---|
1712 | * Spinning mutex Semaphore handle. */
|
---|
1713 | typedef R3R0PTRTYPE(struct RTSEMSPINMUTEXINTERNAL *) RTSEMSPINMUTEX;
|
---|
1714 | /** Pointer to a spinning mutex semaphore handle. */
|
---|
1715 | typedef RTSEMSPINMUTEX *PRTSEMSPINMUTEX;
|
---|
1716 | /** Nil spinning mutex semaphore handle. */
|
---|
1717 | #define NIL_RTSEMSPINMUTEX 0
|
---|
1718 |
|
---|
1719 | /** @typedef RTSEMRW
|
---|
1720 | * Read/Write Semaphore handle. */
|
---|
1721 | typedef R3R0PTRTYPE(struct RTSEMRWINTERNAL *) RTSEMRW;
|
---|
1722 | /** Pointer to a read/write semaphore handle. */
|
---|
1723 | typedef RTSEMRW *PRTSEMRW;
|
---|
1724 | /** Nil read/write semaphore handle. */
|
---|
1725 | #define NIL_RTSEMRW 0
|
---|
1726 |
|
---|
1727 | /** @typedef RTSEMXROADS
|
---|
1728 | * Crossroads semaphore handle. */
|
---|
1729 | typedef R3R0PTRTYPE(struct RTSEMXROADSINTERNAL *) RTSEMXROADS;
|
---|
1730 | /** Pointer to a crossroads semaphore handle. */
|
---|
1731 | typedef RTSEMXROADS *PRTSEMXROADS;
|
---|
1732 | /** Nil crossroads semaphore handle. */
|
---|
1733 | #define NIL_RTSEMXROADS ((RTSEMXROADS)0)
|
---|
1734 |
|
---|
1735 | /** Spinlock handle. */
|
---|
1736 | typedef R3R0PTRTYPE(struct RTSPINLOCKINTERNAL *) RTSPINLOCK;
|
---|
1737 | /** Pointer to a spinlock handle. */
|
---|
1738 | typedef RTSPINLOCK *PRTSPINLOCK;
|
---|
1739 | /** Nil spinlock handle. */
|
---|
1740 | #define NIL_RTSPINLOCK 0
|
---|
1741 |
|
---|
1742 | /** Socket handle. */
|
---|
1743 | typedef R3R0PTRTYPE(struct RTSOCKETINT *) RTSOCKET;
|
---|
1744 | /** Pointer to socket handle. */
|
---|
1745 | typedef RTSOCKET *PRTSOCKET;
|
---|
1746 | /** Nil socket handle. */
|
---|
1747 | #define NIL_RTSOCKET ((RTSOCKET)0)
|
---|
1748 |
|
---|
1749 | /** Pointer to a RTTCPSERVER handle. */
|
---|
1750 | typedef struct RTTCPSERVER *PRTTCPSERVER;
|
---|
1751 | /** Pointer to a RTTCPSERVER handle. */
|
---|
1752 | typedef PRTTCPSERVER *PPRTTCPSERVER;
|
---|
1753 | /** Nil RTTCPSERVER handle. */
|
---|
1754 | #define NIL_RTTCPSERVER ((PRTTCPSERVER)0)
|
---|
1755 |
|
---|
1756 | /** Pointer to a RTUDPSERVER handle. */
|
---|
1757 | typedef struct RTUDPSERVER *PRTUDPSERVER;
|
---|
1758 | /** Pointer to a RTUDPSERVER handle. */
|
---|
1759 | typedef PRTUDPSERVER *PPRTUDPSERVER;
|
---|
1760 | /** Nil RTUDPSERVER handle. */
|
---|
1761 | #define NIL_RTUDPSERVER ((PRTUDPSERVER)0)
|
---|
1762 |
|
---|
1763 | /** Thread handle.*/
|
---|
1764 | typedef R3R0PTRTYPE(struct RTTHREADINT *) RTTHREAD;
|
---|
1765 | /** Pointer to thread handle. */
|
---|
1766 | typedef RTTHREAD *PRTTHREAD;
|
---|
1767 | /** Nil thread handle. */
|
---|
1768 | #define NIL_RTTHREAD 0
|
---|
1769 |
|
---|
1770 | /** Thread-context handle.*/
|
---|
1771 | typedef R0PTRTYPE(struct RTTHREADCTXINT *) RTTHREADCTX;
|
---|
1772 | /** Pointer to thread handle. */
|
---|
1773 | typedef RTTHREADCTX *PRTTHREADCTX;
|
---|
1774 | /** Nil thread-context handle. */
|
---|
1775 | #define NIL_RTTHREADCTX 0
|
---|
1776 |
|
---|
1777 | /** A TLS index. */
|
---|
1778 | typedef RTHCINTPTR RTTLS;
|
---|
1779 | /** Pointer to a TLS index. */
|
---|
1780 | typedef RTTLS *PRTTLS;
|
---|
1781 | /** Pointer to a const TLS index. */
|
---|
1782 | typedef RTTLS const *PCRTTLS;
|
---|
1783 | /** NIL TLS index value. */
|
---|
1784 | #define NIL_RTTLS ((RTTLS)-1)
|
---|
1785 |
|
---|
1786 | /** Trace buffer handle.
|
---|
1787 | * @remarks This is not a R3/R0 type like most other handles!
|
---|
1788 | */
|
---|
1789 | typedef struct RTTRACEBUFINT *RTTRACEBUF;
|
---|
1790 | /** Pointer to a trace buffer handle. */
|
---|
1791 | typedef RTTRACEBUF *PRTTRACEBUF;
|
---|
1792 | /** Nil trace buffer handle. */
|
---|
1793 | #define NIL_RTTRACEBUF ((RTTRACEBUF)0)
|
---|
1794 | /** The handle of the default trace buffer.
|
---|
1795 | * This can be used with any of the RTTraceBufAdd APIs. */
|
---|
1796 | #define RTTRACEBUF_DEFAULT ((RTTRACEBUF)-2)
|
---|
1797 |
|
---|
1798 | /** Handle to a simple heap. */
|
---|
1799 | typedef R3R0PTRTYPE(struct RTHEAPSIMPLEINTERNAL *) RTHEAPSIMPLE;
|
---|
1800 | /** Pointer to a handle to a simple heap. */
|
---|
1801 | typedef RTHEAPSIMPLE *PRTHEAPSIMPLE;
|
---|
1802 | /** NIL simple heap handle. */
|
---|
1803 | #define NIL_RTHEAPSIMPLE ((RTHEAPSIMPLE)0)
|
---|
1804 |
|
---|
1805 | /** Handle to an offset based heap. */
|
---|
1806 | typedef R3R0PTRTYPE(struct RTHEAPOFFSETINTERNAL *) RTHEAPOFFSET;
|
---|
1807 | /** Pointer to a handle to an offset based heap. */
|
---|
1808 | typedef RTHEAPOFFSET *PRTHEAPOFFSET;
|
---|
1809 | /** NIL offset based heap handle. */
|
---|
1810 | #define NIL_RTHEAPOFFSET ((RTHEAPOFFSET)0)
|
---|
1811 |
|
---|
1812 | /** Handle to an environment block. */
|
---|
1813 | typedef R3PTRTYPE(struct RTENVINTERNAL *) RTENV;
|
---|
1814 | /** Pointer to a handle to an environment block. */
|
---|
1815 | typedef RTENV *PRTENV;
|
---|
1816 | /** NIL simple heap handle. */
|
---|
1817 | #define NIL_RTENV ((RTENV)0)
|
---|
1818 |
|
---|
1819 | /** A CPU identifier.
|
---|
1820 | * @remarks This doesn't have to correspond to the APIC ID (intel/amd). Nor
|
---|
1821 | * does it have to correspond to the bits in the affinity mask, at
|
---|
1822 | * least not until we've sorted out Windows NT. */
|
---|
1823 | typedef uint32_t RTCPUID;
|
---|
1824 | /** Pointer to a CPU identifier. */
|
---|
1825 | typedef RTCPUID *PRTCPUID;
|
---|
1826 | /** Pointer to a const CPU identifier. */
|
---|
1827 | typedef RTCPUID const *PCRTCPUID;
|
---|
1828 | /** Nil CPU Id. */
|
---|
1829 | #define NIL_RTCPUID ((RTCPUID)~0)
|
---|
1830 |
|
---|
1831 | /** The maximum number of CPUs a set can contain and IPRT is able
|
---|
1832 | * to reference. (Should be max of support arch/platforms.)
|
---|
1833 | * @remarks Must be a multiple of 64 (see RTCPUSET). */
|
---|
1834 | #if defined(RT_ARCH_X86) || defined(RT_ARCH_AMD64)
|
---|
1835 | # define RTCPUSET_MAX_CPUS 256
|
---|
1836 | #elif defined(RT_ARCH_SPARC) || defined(RT_ARCH_SPARC64)
|
---|
1837 | # define RTCPUSET_MAX_CPUS 1024
|
---|
1838 | #else
|
---|
1839 | # define RTCPUSET_MAX_CPUS 64
|
---|
1840 | #endif
|
---|
1841 | /** A CPU set.
|
---|
1842 | * @note Treat this as an opaque type and always use RTCpuSet* for
|
---|
1843 | * manipulating it. */
|
---|
1844 | typedef struct RTCPUSET
|
---|
1845 | {
|
---|
1846 | /** The bitmap. */
|
---|
1847 | uint64_t bmSet[RTCPUSET_MAX_CPUS / 64];
|
---|
1848 | } RTCPUSET;
|
---|
1849 | /** Pointer to a CPU set. */
|
---|
1850 | typedef RTCPUSET *PRTCPUSET;
|
---|
1851 | /** Pointer to a const CPU set. */
|
---|
1852 | typedef RTCPUSET const *PCRTCPUSET;
|
---|
1853 |
|
---|
1854 | /** A handle table handle. */
|
---|
1855 | typedef R3R0PTRTYPE(struct RTHANDLETABLEINT *) RTHANDLETABLE;
|
---|
1856 | /** A pointer to a handle table handle. */
|
---|
1857 | typedef RTHANDLETABLE *PRTHANDLETABLE;
|
---|
1858 | /** @def NIL_RTHANDLETABLE
|
---|
1859 | * NIL handle table handle. */
|
---|
1860 | #define NIL_RTHANDLETABLE ((RTHANDLETABLE)0)
|
---|
1861 |
|
---|
1862 | /** A handle to a low resolution timer. */
|
---|
1863 | typedef R3R0PTRTYPE(struct RTTIMERLRINT *) RTTIMERLR;
|
---|
1864 | /** A pointer to a low resolution timer handle. */
|
---|
1865 | typedef RTTIMERLR *PRTTIMERLR;
|
---|
1866 | /** @def NIL_RTTIMERLR
|
---|
1867 | * NIL low resolution timer handle value. */
|
---|
1868 | #define NIL_RTTIMERLR ((RTTIMERLR)0)
|
---|
1869 |
|
---|
1870 | /** Handle to a random number generator. */
|
---|
1871 | typedef R3R0PTRTYPE(struct RTRANDINT *) RTRAND;
|
---|
1872 | /** Pointer to a random number generator handle. */
|
---|
1873 | typedef RTRAND *PRTRAND;
|
---|
1874 | /** NIL random number generator handle value. */
|
---|
1875 | #define NIL_RTRAND ((RTRAND)0)
|
---|
1876 |
|
---|
1877 | /** Debug address space handle. */
|
---|
1878 | typedef R3R0PTRTYPE(struct RTDBGASINT *) RTDBGAS;
|
---|
1879 | /** Pointer to a debug address space handle. */
|
---|
1880 | typedef RTDBGAS *PRTDBGAS;
|
---|
1881 | /** NIL debug address space handle. */
|
---|
1882 | #define NIL_RTDBGAS ((RTDBGAS)0)
|
---|
1883 |
|
---|
1884 | /** Debug module handle. */
|
---|
1885 | typedef R3R0PTRTYPE(struct RTDBGMODINT *) RTDBGMOD;
|
---|
1886 | /** Pointer to a debug module handle. */
|
---|
1887 | typedef RTDBGMOD *PRTDBGMOD;
|
---|
1888 | /** NIL debug module handle. */
|
---|
1889 | #define NIL_RTDBGMOD ((RTDBGMOD)0)
|
---|
1890 |
|
---|
1891 | /** Manifest handle. */
|
---|
1892 | typedef struct RTMANIFESTINT *RTMANIFEST;
|
---|
1893 | /** Pointer to a manifest handle. */
|
---|
1894 | typedef RTMANIFEST *PRTMANIFEST;
|
---|
1895 | /** NIL manifest handle. */
|
---|
1896 | #define NIL_RTMANIFEST ((RTMANIFEST)~(uintptr_t)0)
|
---|
1897 |
|
---|
1898 | /** Memory pool handle. */
|
---|
1899 | typedef R3R0PTRTYPE(struct RTMEMPOOLINT *) RTMEMPOOL;
|
---|
1900 | /** Pointer to a memory pool handle. */
|
---|
1901 | typedef RTMEMPOOL *PRTMEMPOOL;
|
---|
1902 | /** NIL memory pool handle. */
|
---|
1903 | #define NIL_RTMEMPOOL ((RTMEMPOOL)0)
|
---|
1904 | /** The default memory pool handle. */
|
---|
1905 | #define RTMEMPOOL_DEFAULT ((RTMEMPOOL)-2)
|
---|
1906 |
|
---|
1907 | /** String cache handle. */
|
---|
1908 | typedef R3R0PTRTYPE(struct RTSTRCACHEINT *) RTSTRCACHE;
|
---|
1909 | /** Pointer to a string cache handle. */
|
---|
1910 | typedef RTSTRCACHE *PRTSTRCACHE;
|
---|
1911 | /** NIL string cache handle. */
|
---|
1912 | #define NIL_RTSTRCACHE ((RTSTRCACHE)0)
|
---|
1913 | /** The default string cache handle. */
|
---|
1914 | #define RTSTRCACHE_DEFAULT ((RTSTRCACHE)-2)
|
---|
1915 |
|
---|
1916 |
|
---|
1917 | /** Virtual Filesystem handle. */
|
---|
1918 | typedef struct RTVFSINTERNAL *RTVFS;
|
---|
1919 | /** Pointer to a VFS handle. */
|
---|
1920 | typedef RTVFS *PRTVFS;
|
---|
1921 | /** A NIL VFS handle. */
|
---|
1922 | #define NIL_RTVFS ((RTVFS)~(uintptr_t)0)
|
---|
1923 |
|
---|
1924 | /** Virtual Filesystem base object handle. */
|
---|
1925 | typedef struct RTVFSOBJINTERNAL *RTVFSOBJ;
|
---|
1926 | /** Pointer to a VFS base object handle. */
|
---|
1927 | typedef RTVFSOBJ *PRTVFSOBJ;
|
---|
1928 | /** A NIL VFS base object handle. */
|
---|
1929 | #define NIL_RTVFSOBJ ((RTVFSOBJ)~(uintptr_t)0)
|
---|
1930 |
|
---|
1931 | /** Virtual Filesystem directory handle. */
|
---|
1932 | typedef struct RTVFSDIRINTERNAL *RTVFSDIR;
|
---|
1933 | /** Pointer to a VFS directory handle. */
|
---|
1934 | typedef RTVFSDIR *PRTVFSDIR;
|
---|
1935 | /** A NIL VFS directory handle. */
|
---|
1936 | #define NIL_RTVFSDIR ((RTVFSDIR)~(uintptr_t)0)
|
---|
1937 |
|
---|
1938 | /** Virtual Filesystem filesystem stream handle. */
|
---|
1939 | typedef struct RTVFSFSSTREAMINTERNAL *RTVFSFSSTREAM;
|
---|
1940 | /** Pointer to a VFS filesystem stream handle. */
|
---|
1941 | typedef RTVFSFSSTREAM *PRTVFSFSSTREAM;
|
---|
1942 | /** A NIL VFS filesystem stream handle. */
|
---|
1943 | #define NIL_RTVFSFSSTREAM ((RTVFSFSSTREAM)~(uintptr_t)0)
|
---|
1944 |
|
---|
1945 | /** Virtual Filesystem I/O stream handle. */
|
---|
1946 | typedef struct RTVFSIOSTREAMINTERNAL *RTVFSIOSTREAM;
|
---|
1947 | /** Pointer to a VFS I/O stream handle. */
|
---|
1948 | typedef RTVFSIOSTREAM *PRTVFSIOSTREAM;
|
---|
1949 | /** A NIL VFS I/O stream handle. */
|
---|
1950 | #define NIL_RTVFSIOSTREAM ((RTVFSIOSTREAM)~(uintptr_t)0)
|
---|
1951 |
|
---|
1952 | /** Virtual Filesystem file handle. */
|
---|
1953 | typedef struct RTVFSFILEINTERNAL *RTVFSFILE;
|
---|
1954 | /** Pointer to a VFS file handle. */
|
---|
1955 | typedef RTVFSFILE *PRTVFSFILE;
|
---|
1956 | /** A NIL VFS file handle. */
|
---|
1957 | #define NIL_RTVFSFILE ((RTVFSFILE)~(uintptr_t)0)
|
---|
1958 |
|
---|
1959 | /** Virtual Filesystem symbolic link handle. */
|
---|
1960 | typedef struct RTVFSSYMLINKINTERNAL *RTVFSSYMLINK;
|
---|
1961 | /** Pointer to a VFS symbolic link handle. */
|
---|
1962 | typedef RTVFSSYMLINK *PRTVFSSYMLINK;
|
---|
1963 | /** A NIL VFS symbolic link handle. */
|
---|
1964 | #define NIL_RTVFSSYMLINK ((RTVFSSYMLINK)~(uintptr_t)0)
|
---|
1965 |
|
---|
1966 | /** Async I/O manager handle. */
|
---|
1967 | typedef struct RTAIOMGRINT *RTAIOMGR;
|
---|
1968 | /** Pointer to a async I/O manager handle. */
|
---|
1969 | typedef RTAIOMGR *PRTAIOMGR;
|
---|
1970 | /** A NIL async I/O manager handle. */
|
---|
1971 | #define NIL_RTAIOMGR ((RTAIOMGR)~(uintptr_t)0)
|
---|
1972 |
|
---|
1973 | /** Async I/O manager file handle. */
|
---|
1974 | typedef struct RTAIOMGRFILEINT *RTAIOMGRFILE;
|
---|
1975 | /** Pointer to a async I/O manager file handle. */
|
---|
1976 | typedef RTAIOMGRFILE *PRTAIOMGRFILE;
|
---|
1977 | /** A NIL async I/O manager file handle. */
|
---|
1978 | #define NIL_RTAIOMGRFILE ((RTAIOMGRFILE)~(uintptr_t)0)
|
---|
1979 |
|
---|
1980 | /**
|
---|
1981 | * Handle type.
|
---|
1982 | *
|
---|
1983 | * This is usually used together with RTHANDLEUNION.
|
---|
1984 | */
|
---|
1985 | typedef enum RTHANDLETYPE
|
---|
1986 | {
|
---|
1987 | /** The invalid zero value. */
|
---|
1988 | RTHANDLETYPE_INVALID = 0,
|
---|
1989 | /** File handle. */
|
---|
1990 | RTHANDLETYPE_FILE,
|
---|
1991 | /** Pipe handle */
|
---|
1992 | RTHANDLETYPE_PIPE,
|
---|
1993 | /** Socket handle. */
|
---|
1994 | RTHANDLETYPE_SOCKET,
|
---|
1995 | /** Thread handle. */
|
---|
1996 | RTHANDLETYPE_THREAD,
|
---|
1997 | /** The end of the valid values. */
|
---|
1998 | RTHANDLETYPE_END,
|
---|
1999 | /** The 32-bit type blow up. */
|
---|
2000 | RTHANDLETYPE_32BIT_HACK = 0x7fffffff
|
---|
2001 | } RTHANDLETYPE;
|
---|
2002 | /** Pointer to a handle type. */
|
---|
2003 | typedef RTHANDLETYPE *PRTHANDLETYPE;
|
---|
2004 |
|
---|
2005 | /**
|
---|
2006 | * Handle union.
|
---|
2007 | *
|
---|
2008 | * This is usually used together with RTHANDLETYPE or as RTHANDLE.
|
---|
2009 | */
|
---|
2010 | typedef union RTHANDLEUNION
|
---|
2011 | {
|
---|
2012 | RTFILE hFile; /**< File handle. */
|
---|
2013 | RTPIPE hPipe; /**< Pipe handle. */
|
---|
2014 | RTSOCKET hSocket; /**< Socket handle. */
|
---|
2015 | RTTHREAD hThread; /**< Thread handle. */
|
---|
2016 | /** Generic integer handle value.
|
---|
2017 | * Note that RTFILE is not yet pointer sized, so accessing it via this member
|
---|
2018 | * isn't necessarily safe or fully portable. */
|
---|
2019 | RTHCUINTPTR uInt;
|
---|
2020 | } RTHANDLEUNION;
|
---|
2021 | /** Pointer to a handle union. */
|
---|
2022 | typedef RTHANDLEUNION *PRTHANDLEUNION;
|
---|
2023 | /** Pointer to a const handle union. */
|
---|
2024 | typedef RTHANDLEUNION const *PCRTHANDLEUNION;
|
---|
2025 |
|
---|
2026 | /**
|
---|
2027 | * Generic handle.
|
---|
2028 | */
|
---|
2029 | typedef struct RTHANDLE
|
---|
2030 | {
|
---|
2031 | /** The handle type. */
|
---|
2032 | RTHANDLETYPE enmType;
|
---|
2033 | /** The handle value. */
|
---|
2034 | RTHANDLEUNION u;
|
---|
2035 | } RTHANDLE;
|
---|
2036 | /** Pointer to a generic handle. */
|
---|
2037 | typedef RTHANDLE *PRTHANDLE;
|
---|
2038 | /** Pointer to a const generic handle. */
|
---|
2039 | typedef RTHANDLE const *PCRTHANDLE;
|
---|
2040 |
|
---|
2041 |
|
---|
2042 | /**
|
---|
2043 | * Standard handles.
|
---|
2044 | *
|
---|
2045 | * @remarks These have the correct file descriptor values for unixy systems and
|
---|
2046 | * can be used directly in code specific to those platforms.
|
---|
2047 | */
|
---|
2048 | typedef enum RTHANDLESTD
|
---|
2049 | {
|
---|
2050 | /** Invalid standard handle. */
|
---|
2051 | RTHANDLESTD_INVALID = -1,
|
---|
2052 | /** The standard input handle. */
|
---|
2053 | RTHANDLESTD_INPUT = 0,
|
---|
2054 | /** The standard output handle. */
|
---|
2055 | RTHANDLESTD_OUTPUT,
|
---|
2056 | /** The standard error handle. */
|
---|
2057 | RTHANDLESTD_ERROR,
|
---|
2058 | /** The typical 32-bit type hack. */
|
---|
2059 | RTHANDLESTD_32BIT_HACK = 0x7fffffff
|
---|
2060 | } RTHANDLESTD;
|
---|
2061 |
|
---|
2062 |
|
---|
2063 | /**
|
---|
2064 | * Error info.
|
---|
2065 | *
|
---|
2066 | * See RTErrInfo*.
|
---|
2067 | */
|
---|
2068 | typedef struct RTERRINFO
|
---|
2069 | {
|
---|
2070 | /** Flags, see RTERRINFO_FLAGS_XXX. */
|
---|
2071 | uint32_t fFlags;
|
---|
2072 | /** The status code. */
|
---|
2073 | int32_t rc;
|
---|
2074 | /** The size of the message */
|
---|
2075 | size_t cbMsg;
|
---|
2076 | /** The error buffer. */
|
---|
2077 | char *pszMsg;
|
---|
2078 | /** Reserved for future use. */
|
---|
2079 | void *apvReserved[2];
|
---|
2080 | } RTERRINFO;
|
---|
2081 | /** Pointer to an error info structure. */
|
---|
2082 | typedef RTERRINFO *PRTERRINFO;
|
---|
2083 | /** Pointer to a const error info structure. */
|
---|
2084 | typedef RTERRINFO const *PCRTERRINFO;
|
---|
2085 |
|
---|
2086 | /**
|
---|
2087 | * Static error info structure, see RTErrInfoInitStatic.
|
---|
2088 | */
|
---|
2089 | typedef struct RTERRINFOSTATIC
|
---|
2090 | {
|
---|
2091 | /** The core error info. */
|
---|
2092 | RTERRINFO Core;
|
---|
2093 | /** The static message buffer. */
|
---|
2094 | char szMsg[3072];
|
---|
2095 | } RTERRINFOSTATIC;
|
---|
2096 | /** Pointer to a error info buffer. */
|
---|
2097 | typedef RTERRINFOSTATIC *PRTERRINFOSTATIC;
|
---|
2098 | /** Pointer to a const static error info buffer. */
|
---|
2099 | typedef RTERRINFOSTATIC const *PCRTERRINFOSTATIC;
|
---|
2100 |
|
---|
2101 |
|
---|
2102 | /**
|
---|
2103 | * UUID data type.
|
---|
2104 | *
|
---|
2105 | * See RTUuid*.
|
---|
2106 | *
|
---|
2107 | * @remarks IPRT defines that the first three integers in the @c Gen struct
|
---|
2108 | * interpretation are in little endian representation. This is
|
---|
2109 | * different to many other UUID implementation, and requires
|
---|
2110 | * conversion if you need to achieve consistent results.
|
---|
2111 | */
|
---|
2112 | typedef union RTUUID
|
---|
2113 | {
|
---|
2114 | /** 8-bit view. */
|
---|
2115 | uint8_t au8[16];
|
---|
2116 | /** 16-bit view. */
|
---|
2117 | uint16_t au16[8];
|
---|
2118 | /** 32-bit view. */
|
---|
2119 | uint32_t au32[4];
|
---|
2120 | /** 64-bit view. */
|
---|
2121 | uint64_t au64[2];
|
---|
2122 | /** The way the UUID is declared by the DCE specification. */
|
---|
2123 | struct
|
---|
2124 | {
|
---|
2125 | uint32_t u32TimeLow;
|
---|
2126 | uint16_t u16TimeMid;
|
---|
2127 | uint16_t u16TimeHiAndVersion;
|
---|
2128 | uint8_t u8ClockSeqHiAndReserved;
|
---|
2129 | uint8_t u8ClockSeqLow;
|
---|
2130 | uint8_t au8Node[6];
|
---|
2131 | } Gen;
|
---|
2132 | } RTUUID;
|
---|
2133 | /** Pointer to UUID data. */
|
---|
2134 | typedef RTUUID *PRTUUID;
|
---|
2135 | /** Pointer to readonly UUID data. */
|
---|
2136 | typedef const RTUUID *PCRTUUID;
|
---|
2137 |
|
---|
2138 | /** Initializes a RTUUID structure with all zeros (RTUuidIsNull() true). */
|
---|
2139 | #define RTUUID_INITIALIZE_NULL { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }
|
---|
2140 |
|
---|
2141 | /** UUID string maximum length. */
|
---|
2142 | #define RTUUID_STR_LENGTH 37
|
---|
2143 |
|
---|
2144 |
|
---|
2145 | /** Compression handle. */
|
---|
2146 | typedef struct RTZIPCOMP *PRTZIPCOMP;
|
---|
2147 | /** Decompressor handle. */
|
---|
2148 | typedef struct RTZIPDECOMP *PRTZIPDECOMP;
|
---|
2149 |
|
---|
2150 |
|
---|
2151 | /**
|
---|
2152 | * Unicode Code Point.
|
---|
2153 | */
|
---|
2154 | typedef uint32_t RTUNICP;
|
---|
2155 | /** Pointer to an Unicode Code Point. */
|
---|
2156 | typedef RTUNICP *PRTUNICP;
|
---|
2157 | /** Pointer to an Unicode Code Point. */
|
---|
2158 | typedef const RTUNICP *PCRTUNICP;
|
---|
2159 | /** Max value a RTUNICP type can hold. */
|
---|
2160 | #define RTUNICP_MAX ( ~(RTUNICP)0 )
|
---|
2161 | /** Invalid code point.
|
---|
2162 | * This is returned when encountered invalid encodings or invalid
|
---|
2163 | * unicode code points. */
|
---|
2164 | #define RTUNICP_INVALID ( UINT32_C(0xfffffffe) )
|
---|
2165 |
|
---|
2166 |
|
---|
2167 | /**
|
---|
2168 | * UTF-16 character.
|
---|
2169 | * @remark wchar_t is not usable since it's compiler defined.
|
---|
2170 | * @remark When we use the term character we're not talking about unicode code point, but
|
---|
2171 | * the basic unit of the string encoding. Thus cwc - count of wide chars - means
|
---|
2172 | * count of RTUTF16; cuc - count of unicode chars - means count of RTUNICP;
|
---|
2173 | * and cch means count of the typedef 'char', which is assumed to be an octet.
|
---|
2174 | */
|
---|
2175 | typedef uint16_t RTUTF16;
|
---|
2176 | /** Pointer to a UTF-16 character. */
|
---|
2177 | typedef RTUTF16 *PRTUTF16;
|
---|
2178 | /** Pointer to a const UTF-16 character. */
|
---|
2179 | typedef const RTUTF16 *PCRTUTF16;
|
---|
2180 |
|
---|
2181 |
|
---|
2182 | /**
|
---|
2183 | * Wait for ever if we have to.
|
---|
2184 | */
|
---|
2185 | #define RT_INDEFINITE_WAIT (~0U)
|
---|
2186 |
|
---|
2187 |
|
---|
2188 | /**
|
---|
2189 | * Generic process callback.
|
---|
2190 | *
|
---|
2191 | * @returns VBox status code. Failure will cancel the operation.
|
---|
2192 | * @param uPercentage The percentage of the operation which has been completed.
|
---|
2193 | * @param pvUser The user specified argument.
|
---|
2194 | */
|
---|
2195 | typedef DECLCALLBACK(int) FNRTPROGRESS(unsigned uPrecentage, void *pvUser);
|
---|
2196 | /** Pointer to a generic progress callback function, FNRTPROCESS(). */
|
---|
2197 | typedef FNRTPROGRESS *PFNRTPROGRESS;
|
---|
2198 |
|
---|
2199 | /**
|
---|
2200 | * Generic vprintf-like callback function for dumpers.
|
---|
2201 | *
|
---|
2202 | * @param pvUser User argument.
|
---|
2203 | * @param pszFormat The format string.
|
---|
2204 | * @param va Arguments for the format string.
|
---|
2205 | */
|
---|
2206 | typedef DECLCALLBACK(void) FNRTDUMPPRINTFV(void *pvUser, const char *pszFormat, va_list va);
|
---|
2207 | /** Pointer to a generic printf-like function for dumping. */
|
---|
2208 | typedef FNRTDUMPPRINTFV *PFNRTDUMPPRINTFV;
|
---|
2209 |
|
---|
2210 |
|
---|
2211 | /**
|
---|
2212 | * A point in a two dimentional coordinate system.
|
---|
2213 | */
|
---|
2214 | typedef struct RTPOINT
|
---|
2215 | {
|
---|
2216 | /** X coordinate. */
|
---|
2217 | int32_t x;
|
---|
2218 | /** Y coordinate. */
|
---|
2219 | int32_t y;
|
---|
2220 | } RTPOINT;
|
---|
2221 | /** Pointer to a point. */
|
---|
2222 | typedef RTPOINT *PRTPOINT;
|
---|
2223 | /** Pointer to a const point. */
|
---|
2224 | typedef const RTPOINT *PCRTPOINT;
|
---|
2225 |
|
---|
2226 |
|
---|
2227 | /**
|
---|
2228 | * Rectangle data type, double point.
|
---|
2229 | */
|
---|
2230 | typedef struct RTRECT
|
---|
2231 | {
|
---|
2232 | /** left X coordinate. */
|
---|
2233 | int32_t xLeft;
|
---|
2234 | /** top Y coordinate. */
|
---|
2235 | int32_t yTop;
|
---|
2236 | /** right X coordinate. (exclusive) */
|
---|
2237 | int32_t xRight;
|
---|
2238 | /** bottom Y coordinate. (exclusive) */
|
---|
2239 | int32_t yBottom;
|
---|
2240 | } RTRECT;
|
---|
2241 | /** Pointer to a double point rectangle. */
|
---|
2242 | typedef RTRECT *PRTRECT;
|
---|
2243 | /** Pointer to a const double point rectangle. */
|
---|
2244 | typedef const RTRECT *PCRTRECT;
|
---|
2245 |
|
---|
2246 |
|
---|
2247 | /**
|
---|
2248 | * Rectangle data type, point + size.
|
---|
2249 | */
|
---|
2250 | typedef struct RTRECT2
|
---|
2251 | {
|
---|
2252 | /** X coordinate.
|
---|
2253 | * Unless stated otherwise, this is the top left corner. */
|
---|
2254 | int32_t x;
|
---|
2255 | /** Y coordinate.
|
---|
2256 | * Unless stated otherwise, this is the top left corner. */
|
---|
2257 | int32_t y;
|
---|
2258 | /** The width.
|
---|
2259 | * Unless stated otherwise, this is to the right of (x,y) and will not
|
---|
2260 | * be a negative number. */
|
---|
2261 | int32_t cx;
|
---|
2262 | /** The height.
|
---|
2263 | * Unless stated otherwise, this is down from (x,y) and will not be a
|
---|
2264 | * negative number. */
|
---|
2265 | int32_t cy;
|
---|
2266 | } RTRECT2;
|
---|
2267 | /** Pointer to a point + size rectangle. */
|
---|
2268 | typedef RTRECT2 *PRTRECT2;
|
---|
2269 | /** Pointer to a const point + size rectangle. */
|
---|
2270 | typedef const RTRECT2 *PCRTRECT2;
|
---|
2271 |
|
---|
2272 |
|
---|
2273 | /**
|
---|
2274 | * The size of a rectangle.
|
---|
2275 | */
|
---|
2276 | typedef struct RTRECTSIZE
|
---|
2277 | {
|
---|
2278 | /** The width (along the x-axis). */
|
---|
2279 | uint32_t cx;
|
---|
2280 | /** The height (along the y-axis). */
|
---|
2281 | uint32_t cy;
|
---|
2282 | } RTRECTSIZE;
|
---|
2283 | /** Pointer to a rectangle size. */
|
---|
2284 | typedef RTRECTSIZE *PRTRECTSIZE;
|
---|
2285 | /** Pointer to a const rectangle size. */
|
---|
2286 | typedef const RTRECTSIZE *PCRTRECTSIZE;
|
---|
2287 |
|
---|
2288 |
|
---|
2289 | /**
|
---|
2290 | * Ethernet MAC address.
|
---|
2291 | *
|
---|
2292 | * The first 24 bits make up the Organisationally Unique Identifier (OUI),
|
---|
2293 | * where the first bit (little endian) indicates multicast (set) / unicast,
|
---|
2294 | * and the second bit indicates locally (set) / global administered. If all
|
---|
2295 | * bits are set, it's a broadcast.
|
---|
2296 | */
|
---|
2297 | typedef union RTMAC
|
---|
2298 | {
|
---|
2299 | /** @todo add a bitfield view of this stuff. */
|
---|
2300 | /** 8-bit view. */
|
---|
2301 | uint8_t au8[6];
|
---|
2302 | /** 16-bit view. */
|
---|
2303 | uint16_t au16[3];
|
---|
2304 | } RTMAC;
|
---|
2305 | /** Pointer to a MAC address. */
|
---|
2306 | typedef RTMAC *PRTMAC;
|
---|
2307 | /** Pointer to a readonly MAC address. */
|
---|
2308 | typedef const RTMAC *PCRTMAC;
|
---|
2309 |
|
---|
2310 |
|
---|
2311 | /** Pointer to a lock validator record.
|
---|
2312 | * The structure definition is found in iprt/lockvalidator.h. */
|
---|
2313 | typedef struct RTLOCKVALRECEXCL *PRTLOCKVALRECEXCL;
|
---|
2314 | /** Pointer to a record of one ownership share.
|
---|
2315 | * The structure definition is found in iprt/lockvalidator.h. */
|
---|
2316 | typedef struct RTLOCKVALRECSHRD *PRTLOCKVALRECSHRD;
|
---|
2317 | /** Pointer to a lock validator source position.
|
---|
2318 | * The structure definition is found in iprt/lockvalidator.h. */
|
---|
2319 | typedef struct RTLOCKVALSRCPOS *PRTLOCKVALSRCPOS;
|
---|
2320 | /** Pointer to a const lock validator source position.
|
---|
2321 | * The structure definition is found in iprt/lockvalidator.h. */
|
---|
2322 | typedef struct RTLOCKVALSRCPOS const *PCRTLOCKVALSRCPOS;
|
---|
2323 |
|
---|
2324 | /** @name Special sub-class values.
|
---|
2325 | * The range 16..UINT32_MAX is available to the user, the range 0..15 is
|
---|
2326 | * reserved for the lock validator. In the user range the locks can only be
|
---|
2327 | * taking in ascending order.
|
---|
2328 | * @{ */
|
---|
2329 | /** Invalid value. */
|
---|
2330 | #define RTLOCKVAL_SUB_CLASS_INVALID UINT32_C(0)
|
---|
2331 | /** Not allowed to be taken with any other locks in the same class.
|
---|
2332 | * This is the recommended value. */
|
---|
2333 | #define RTLOCKVAL_SUB_CLASS_NONE UINT32_C(1)
|
---|
2334 | /** Any order is allowed within the class. */
|
---|
2335 | #define RTLOCKVAL_SUB_CLASS_ANY UINT32_C(2)
|
---|
2336 | /** The first user value. */
|
---|
2337 | #define RTLOCKVAL_SUB_CLASS_USER UINT32_C(16)
|
---|
2338 | /** @} */
|
---|
2339 |
|
---|
2340 |
|
---|
2341 | /**
|
---|
2342 | * Digest types.
|
---|
2343 | */
|
---|
2344 | typedef enum RTDIGESTTYPE
|
---|
2345 | {
|
---|
2346 | /** Invalid digest value. */
|
---|
2347 | RTDIGESTTYPE_INVALID = 0,
|
---|
2348 | /** Unknown digest type. */
|
---|
2349 | RTDIGESTTYPE_UNKNOWN,
|
---|
2350 | /** CRC32 checksum. */
|
---|
2351 | RTDIGESTTYPE_CRC32,
|
---|
2352 | /** CRC64 checksum. */
|
---|
2353 | RTDIGESTTYPE_CRC64,
|
---|
2354 | /** MD2 checksum (unsafe!). */
|
---|
2355 | RTDIGESTTYPE_MD2,
|
---|
2356 | /** MD4 checksum (unsafe!!). */
|
---|
2357 | RTDIGESTTYPE_MD4,
|
---|
2358 | /** MD5 checksum (unsafe!). */
|
---|
2359 | RTDIGESTTYPE_MD5,
|
---|
2360 | /** SHA-1 checksum (unsafe!). */
|
---|
2361 | RTDIGESTTYPE_SHA1,
|
---|
2362 | /** SHA-224 checksum. */
|
---|
2363 | RTDIGESTTYPE_SHA224,
|
---|
2364 | /** SHA-256 checksum. */
|
---|
2365 | RTDIGESTTYPE_SHA256,
|
---|
2366 | /** SHA-384 checksum. */
|
---|
2367 | RTDIGESTTYPE_SHA384,
|
---|
2368 | /** SHA-512 checksum. */
|
---|
2369 | RTDIGESTTYPE_SHA512,
|
---|
2370 | /** SHA-512/224 checksum. */
|
---|
2371 | RTDIGESTTYPE_SHA512T224,
|
---|
2372 | /** SHA-512/256 checksum. */
|
---|
2373 | RTDIGESTTYPE_SHA512T256,
|
---|
2374 | /** End of valid types. */
|
---|
2375 | RTDIGESTTYPE_END,
|
---|
2376 | /** Usual 32-bit type blowup. */
|
---|
2377 | RTDIGESTTYPE_32BIT_HACK = 0x7fffffff
|
---|
2378 | } RTDIGESTTYPE;
|
---|
2379 |
|
---|
2380 | /**
|
---|
2381 | * Process exit codes.
|
---|
2382 | */
|
---|
2383 | typedef enum RTEXITCODE
|
---|
2384 | {
|
---|
2385 | /** Success. */
|
---|
2386 | RTEXITCODE_SUCCESS = 0,
|
---|
2387 | /** General failure. */
|
---|
2388 | RTEXITCODE_FAILURE = 1,
|
---|
2389 | /** Invalid arguments. */
|
---|
2390 | RTEXITCODE_SYNTAX = 2,
|
---|
2391 | /** Initialization failure (usually IPRT, but could be used for other
|
---|
2392 | * components as well). */
|
---|
2393 | RTEXITCODE_INIT = 3,
|
---|
2394 | /** Test skipped. */
|
---|
2395 | RTEXITCODE_SKIPPED = 4,
|
---|
2396 | /** The end of valid exit codes. */
|
---|
2397 | RTEXITCODE_END,
|
---|
2398 | /** The usual 32-bit type hack. */
|
---|
2399 | RTEXITCODE_32BIT_HACK = 0x7fffffff
|
---|
2400 | } RTEXITCODE;
|
---|
2401 |
|
---|
2402 | /**
|
---|
2403 | * Range descriptor.
|
---|
2404 | */
|
---|
2405 | typedef struct RTRANGE
|
---|
2406 | {
|
---|
2407 | /** Start offset. */
|
---|
2408 | uint64_t offStart;
|
---|
2409 | /** Range size. */
|
---|
2410 | size_t cbRange;
|
---|
2411 | } RTRANGE;
|
---|
2412 | /** Pointer to a range descriptor. */
|
---|
2413 | typedef RTRANGE *PRTRANGE;
|
---|
2414 | /** Pointer to a readonly range descriptor. */
|
---|
2415 | typedef const RTRANGE *PCRTRANGE;
|
---|
2416 |
|
---|
2417 |
|
---|
2418 | /**
|
---|
2419 | * Generic pointer union.
|
---|
2420 | */
|
---|
2421 | typedef union RTPTRUNION
|
---|
2422 | {
|
---|
2423 | /** Pointer into the void... */
|
---|
2424 | void *pv;
|
---|
2425 | /** As a signed integer. */
|
---|
2426 | intptr_t i;
|
---|
2427 | /** As an unsigned integer. */
|
---|
2428 | intptr_t u;
|
---|
2429 | /** Pointer to char value. */
|
---|
2430 | char *pch;
|
---|
2431 | /** Pointer to char value. */
|
---|
2432 | unsigned char *puch;
|
---|
2433 | /** Pointer to a int value. */
|
---|
2434 | int *pi;
|
---|
2435 | /** Pointer to a unsigned int value. */
|
---|
2436 | unsigned int *pu;
|
---|
2437 | /** Pointer to a long value. */
|
---|
2438 | long *pl;
|
---|
2439 | /** Pointer to a long value. */
|
---|
2440 | unsigned long *pul;
|
---|
2441 | /** Pointer to a 8-bit unsigned value. */
|
---|
2442 | uint8_t *pu8;
|
---|
2443 | /** Pointer to a 16-bit unsigned value. */
|
---|
2444 | uint16_t *pu16;
|
---|
2445 | /** Pointer to a 32-bit unsigned value. */
|
---|
2446 | uint32_t *pu32;
|
---|
2447 | /** Pointer to a 64-bit unsigned value. */
|
---|
2448 | uint64_t *pu64;
|
---|
2449 | /** Pointer to a UTF-16 character. */
|
---|
2450 | PRTUTF16 pwc;
|
---|
2451 | /** Pointer to a UUID character. */
|
---|
2452 | PRTUUID pUuid;
|
---|
2453 | } RTPTRUNION;
|
---|
2454 | /** Pointer to a pointer union. */
|
---|
2455 | typedef RTPTRUNION *PRTPTRUNION;
|
---|
2456 |
|
---|
2457 | /**
|
---|
2458 | * Generic const pointer union.
|
---|
2459 | */
|
---|
2460 | typedef union RTCPTRUNION
|
---|
2461 | {
|
---|
2462 | /** Pointer into the void... */
|
---|
2463 | void const *pv;
|
---|
2464 | /** As a signed integer. */
|
---|
2465 | intptr_t i;
|
---|
2466 | /** As an unsigned integer. */
|
---|
2467 | intptr_t u;
|
---|
2468 | /** Pointer to char value. */
|
---|
2469 | char const *pch;
|
---|
2470 | /** Pointer to char value. */
|
---|
2471 | unsigned char const *puch;
|
---|
2472 | /** Pointer to a int value. */
|
---|
2473 | int const *pi;
|
---|
2474 | /** Pointer to a unsigned int value. */
|
---|
2475 | unsigned int const *pu;
|
---|
2476 | /** Pointer to a long value. */
|
---|
2477 | long const *pl;
|
---|
2478 | /** Pointer to a long value. */
|
---|
2479 | unsigned long const *pul;
|
---|
2480 | /** Pointer to a 8-bit unsigned value. */
|
---|
2481 | uint8_t const *pu8;
|
---|
2482 | /** Pointer to a 16-bit unsigned value. */
|
---|
2483 | uint16_t const *pu16;
|
---|
2484 | /** Pointer to a 32-bit unsigned value. */
|
---|
2485 | uint32_t const *pu32;
|
---|
2486 | /** Pointer to a 64-bit unsigned value. */
|
---|
2487 | uint64_t const *pu64;
|
---|
2488 | /** Pointer to a UTF-16 character. */
|
---|
2489 | PCRTUTF16 pwc;
|
---|
2490 | /** Pointer to a UUID character. */
|
---|
2491 | PCRTUUID pUuid;
|
---|
2492 | } RTCPTRUNION;
|
---|
2493 | /** Pointer to a const pointer union. */
|
---|
2494 | typedef RTCPTRUNION *PRTCPTRUNION;
|
---|
2495 |
|
---|
2496 | /**
|
---|
2497 | * Generic volatile pointer union.
|
---|
2498 | */
|
---|
2499 | typedef union RTVPTRUNION
|
---|
2500 | {
|
---|
2501 | /** Pointer into the void... */
|
---|
2502 | void volatile *pv;
|
---|
2503 | /** As a signed integer. */
|
---|
2504 | intptr_t i;
|
---|
2505 | /** As an unsigned integer. */
|
---|
2506 | intptr_t u;
|
---|
2507 | /** Pointer to char value. */
|
---|
2508 | char volatile *pch;
|
---|
2509 | /** Pointer to char value. */
|
---|
2510 | unsigned char volatile *puch;
|
---|
2511 | /** Pointer to a int value. */
|
---|
2512 | int volatile *pi;
|
---|
2513 | /** Pointer to a unsigned int value. */
|
---|
2514 | unsigned int volatile *pu;
|
---|
2515 | /** Pointer to a long value. */
|
---|
2516 | long volatile *pl;
|
---|
2517 | /** Pointer to a long value. */
|
---|
2518 | unsigned long volatile *pul;
|
---|
2519 | /** Pointer to a 8-bit unsigned value. */
|
---|
2520 | uint8_t volatile *pu8;
|
---|
2521 | /** Pointer to a 16-bit unsigned value. */
|
---|
2522 | uint16_t volatile *pu16;
|
---|
2523 | /** Pointer to a 32-bit unsigned value. */
|
---|
2524 | uint32_t volatile *pu32;
|
---|
2525 | /** Pointer to a 64-bit unsigned value. */
|
---|
2526 | uint64_t volatile *pu64;
|
---|
2527 | /** Pointer to a UTF-16 character. */
|
---|
2528 | RTUTF16 volatile *pwc;
|
---|
2529 | /** Pointer to a UUID character. */
|
---|
2530 | RTUUID volatile *pUuid;
|
---|
2531 | } RTVPTRUNION;
|
---|
2532 | /** Pointer to a const pointer union. */
|
---|
2533 | typedef RTVPTRUNION *PRTVPTRUNION;
|
---|
2534 |
|
---|
2535 | /**
|
---|
2536 | * Generic const volatile pointer union.
|
---|
2537 | */
|
---|
2538 | typedef union RTCVPTRUNION
|
---|
2539 | {
|
---|
2540 | /** Pointer into the void... */
|
---|
2541 | void const volatile *pv;
|
---|
2542 | /** As a signed integer. */
|
---|
2543 | intptr_t i;
|
---|
2544 | /** As an unsigned integer. */
|
---|
2545 | intptr_t u;
|
---|
2546 | /** Pointer to char value. */
|
---|
2547 | char const volatile *pch;
|
---|
2548 | /** Pointer to char value. */
|
---|
2549 | unsigned char const volatile *puch;
|
---|
2550 | /** Pointer to a int value. */
|
---|
2551 | int const volatile *pi;
|
---|
2552 | /** Pointer to a unsigned int value. */
|
---|
2553 | unsigned int const volatile *pu;
|
---|
2554 | /** Pointer to a long value. */
|
---|
2555 | long const volatile *pl;
|
---|
2556 | /** Pointer to a long value. */
|
---|
2557 | unsigned long const volatile *pul;
|
---|
2558 | /** Pointer to a 8-bit unsigned value. */
|
---|
2559 | uint8_t const volatile *pu8;
|
---|
2560 | /** Pointer to a 16-bit unsigned value. */
|
---|
2561 | uint16_t const volatile *pu16;
|
---|
2562 | /** Pointer to a 32-bit unsigned value. */
|
---|
2563 | uint32_t const volatile *pu32;
|
---|
2564 | /** Pointer to a 64-bit unsigned value. */
|
---|
2565 | uint64_t const volatile *pu64;
|
---|
2566 | /** Pointer to a UTF-16 character. */
|
---|
2567 | RTUTF16 const volatile *pwc;
|
---|
2568 | /** Pointer to a UUID character. */
|
---|
2569 | RTUUID const volatile *pUuid;
|
---|
2570 | } RTCVPTRUNION;
|
---|
2571 | /** Pointer to a const pointer union. */
|
---|
2572 | typedef RTCVPTRUNION *PRTCVPTRUNION;
|
---|
2573 |
|
---|
2574 |
|
---|
2575 |
|
---|
2576 | #ifdef __cplusplus
|
---|
2577 | /**
|
---|
2578 | * Strict type validation helper class.
|
---|
2579 | *
|
---|
2580 | * See RTErrStrictType and RT_SUCCESS_NP.
|
---|
2581 | */
|
---|
2582 | class RTErrStrictType2
|
---|
2583 | {
|
---|
2584 | protected:
|
---|
2585 | /** The status code. */
|
---|
2586 | int32_t m_rc;
|
---|
2587 |
|
---|
2588 | public:
|
---|
2589 | /**
|
---|
2590 | * Constructor.
|
---|
2591 | * @param rc IPRT style status code.
|
---|
2592 | */
|
---|
2593 | RTErrStrictType2(int32_t rc) : m_rc(rc)
|
---|
2594 | {
|
---|
2595 | }
|
---|
2596 |
|
---|
2597 | /**
|
---|
2598 | * Get the status code.
|
---|
2599 | * @returns IPRT style status code.
|
---|
2600 | */
|
---|
2601 | int32_t getValue() const
|
---|
2602 | {
|
---|
2603 | return m_rc;
|
---|
2604 | }
|
---|
2605 | };
|
---|
2606 | #endif /* __cplusplus */
|
---|
2607 | /** @} */
|
---|
2608 |
|
---|
2609 | #endif
|
---|
2610 |
|
---|