1 | /** @file
|
---|
2 | * IPRT - Types.
|
---|
3 | */
|
---|
4 |
|
---|
5 | /*
|
---|
6 | * Copyright (C) 2006-2007 Sun Microsystems, Inc.
|
---|
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 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
|
---|
26 | * Clara, CA 95054 USA or visit http://www.sun.com if you need
|
---|
27 | * additional information or have any questions.
|
---|
28 | */
|
---|
29 |
|
---|
30 | #ifndef ___iprt_types_h
|
---|
31 | #define ___iprt_types_h
|
---|
32 |
|
---|
33 | #include <iprt/cdefs.h>
|
---|
34 | #include <iprt/stdint.h>
|
---|
35 |
|
---|
36 | /*
|
---|
37 | * Include standard C types.
|
---|
38 | */
|
---|
39 | #ifndef IPRT_NO_CRT
|
---|
40 |
|
---|
41 | # if defined(RT_OS_DARWIN) && defined(KERNEL)
|
---|
42 | /*
|
---|
43 | * Kludge for the darwin kernel:
|
---|
44 | * stddef.h is missing IIRC.
|
---|
45 | */
|
---|
46 | # ifndef _PTRDIFF_T
|
---|
47 | # define _PTRDIFF_T
|
---|
48 | typedef __darwin_ptrdiff_t ptrdiff_t;
|
---|
49 | # endif
|
---|
50 | # include <sys/types.h>
|
---|
51 |
|
---|
52 | # elif defined(RT_OS_FREEBSD) && defined(_KERNEL)
|
---|
53 | /*
|
---|
54 | * Kludge for the FreeBSD kernel:
|
---|
55 | * stddef.h and sys/types.h have slightly different offsetof definitions
|
---|
56 | * when compiling in kernel mode. This is just to make GCC shut up.
|
---|
57 | */
|
---|
58 | # ifndef _STDDEF_H_
|
---|
59 | # undef offsetof
|
---|
60 | # endif
|
---|
61 | # include <sys/stddef.h>
|
---|
62 | # ifndef _SYS_TYPES_H_
|
---|
63 | # undef offsetof
|
---|
64 | # endif
|
---|
65 | # include <sys/types.h>
|
---|
66 | # ifndef offsetof
|
---|
67 | # error "offsetof is not defined..."
|
---|
68 | # endif
|
---|
69 |
|
---|
70 | # elif defined(RT_OS_FREEBSD) && HC_ARCH_BITS == 64 && defined(RT_ARCH_X86)
|
---|
71 | /*
|
---|
72 | * Kludge for compiling 32-bit code on a 64-bit FreeBSD:
|
---|
73 | * FreeBSD declares uint64_t and int64_t wrong (long unsigned and long int
|
---|
74 | * though they need to be long long unsigned and long long int). These
|
---|
75 | * defines conflict with our decleration in stdint.h. Adding the defines
|
---|
76 | * below omits the definitions in the system header.
|
---|
77 | */
|
---|
78 | # include <stddef.h>
|
---|
79 | # define _UINT64_T_DECLARED
|
---|
80 | # define _INT64_T_DECLARED
|
---|
81 | # include <sys/types.h>
|
---|
82 |
|
---|
83 | # elif defined(RT_OS_LINUX) && defined(__KERNEL__)
|
---|
84 | /*
|
---|
85 | * Kludge for the linux kernel:
|
---|
86 | * 1. sys/types.h doesn't mix with the kernel.
|
---|
87 | * 2. Starting with 2.6.19, linux/types.h typedefs bool and linux/stddef.h
|
---|
88 | * declares false and true as enum values.
|
---|
89 | * 3. Starting with 2.6.24, linux/types.h typedefs uintptr_t.
|
---|
90 | * We work around these issues here and nowhere else.
|
---|
91 | */
|
---|
92 | # include <stddef.h>
|
---|
93 | # if defined(__cplusplus)
|
---|
94 | typedef bool _Bool;
|
---|
95 | # endif
|
---|
96 | # define bool linux_bool
|
---|
97 | # define true linux_true
|
---|
98 | # define false linux_false
|
---|
99 | # define uintptr_t linux_uintptr_t
|
---|
100 | # ifndef AUTOCONF_INCLUDED
|
---|
101 | # include <linux/autoconf.h>
|
---|
102 | # endif
|
---|
103 | # include <linux/types.h>
|
---|
104 | # include <linux/stddef.h>
|
---|
105 | # undef uintptr_t
|
---|
106 | # undef false
|
---|
107 | # undef true
|
---|
108 | # undef bool
|
---|
109 |
|
---|
110 | # else
|
---|
111 | # include <stddef.h>
|
---|
112 | # include <sys/types.h>
|
---|
113 | # endif
|
---|
114 |
|
---|
115 | /* Define any types missing from sys/types.h on windows. */
|
---|
116 | # ifdef _MSC_VER
|
---|
117 | # undef ssize_t
|
---|
118 | typedef intptr_t ssize_t;
|
---|
119 | # endif
|
---|
120 |
|
---|
121 | #else /* no crt */
|
---|
122 | # include <iprt/nocrt/compiler/compiler.h>
|
---|
123 | #endif /* no crt */
|
---|
124 |
|
---|
125 |
|
---|
126 |
|
---|
127 | /** @defgroup grp_rt_types IPRT Base Types
|
---|
128 | * @{
|
---|
129 | */
|
---|
130 |
|
---|
131 | /* define wchar_t, we don't wanna include all the wcsstuff to get this. */
|
---|
132 | #ifdef _MSC_VER
|
---|
133 | # ifndef _WCHAR_T_DEFINED
|
---|
134 | typedef unsigned short wchar_t;
|
---|
135 | # define _WCHAR_T_DEFINED
|
---|
136 | # endif
|
---|
137 | #endif
|
---|
138 | #ifdef __GNUC__
|
---|
139 | /** @todo wchar_t on GNUC */
|
---|
140 | #endif
|
---|
141 |
|
---|
142 | /*
|
---|
143 | * C doesn't have bool.
|
---|
144 | */
|
---|
145 | #ifndef __cplusplus
|
---|
146 | # if defined(__GNUC__)
|
---|
147 | # if defined(RT_OS_LINUX) && __GNUC__ < 3
|
---|
148 | typedef uint8_t bool;
|
---|
149 | # else
|
---|
150 | # if defined(RT_OS_DARWIN) && defined(_STDBOOL_H)
|
---|
151 | # undef bool
|
---|
152 | # endif
|
---|
153 | typedef _Bool bool;
|
---|
154 | # endif
|
---|
155 | # else
|
---|
156 | typedef unsigned char bool;
|
---|
157 | # endif
|
---|
158 | # ifndef true
|
---|
159 | # define true (1)
|
---|
160 | # endif
|
---|
161 | # ifndef false
|
---|
162 | # define false (0)
|
---|
163 | # endif
|
---|
164 | #endif
|
---|
165 |
|
---|
166 | /**
|
---|
167 | * 128-bit unsigned integer.
|
---|
168 | */
|
---|
169 | #if defined(__GNUC__) && defined(RT_ARCH_AMD64)
|
---|
170 | typedef __uint128_t uint128_t;
|
---|
171 | #else
|
---|
172 | typedef struct uint128_s
|
---|
173 | {
|
---|
174 | uint64_t Lo;
|
---|
175 | uint64_t Hi;
|
---|
176 | } uint128_t;
|
---|
177 | #endif
|
---|
178 |
|
---|
179 |
|
---|
180 | /**
|
---|
181 | * 128-bit signed integer.
|
---|
182 | */
|
---|
183 | #if defined(__GNUC__) && defined(RT_ARCH_AMD64)
|
---|
184 | typedef __int128_t int128_t;
|
---|
185 | #else
|
---|
186 | typedef struct int128_s
|
---|
187 | {
|
---|
188 | uint64_t lo;
|
---|
189 | int64_t hi;
|
---|
190 | } int128_t;
|
---|
191 | #endif
|
---|
192 |
|
---|
193 |
|
---|
194 | /**
|
---|
195 | * 16-bit unsigned integer union.
|
---|
196 | */
|
---|
197 | typedef union RTUINT16U
|
---|
198 | {
|
---|
199 | /** natural view. */
|
---|
200 | uint16_t u;
|
---|
201 |
|
---|
202 | /** 16-bit view. */
|
---|
203 | uint16_t au16[1];
|
---|
204 | /** 8-bit view. */
|
---|
205 | uint8_t au8[2];
|
---|
206 | /** 16-bit hi/lo view. */
|
---|
207 | struct
|
---|
208 | {
|
---|
209 | uint8_t Lo;
|
---|
210 | uint8_t Hi;
|
---|
211 | } s;
|
---|
212 | } RTUINT16U;
|
---|
213 | /** Pointer to a 16-bit unsigned integer union. */
|
---|
214 | typedef RTUINT16U *PRTUINT16U;
|
---|
215 | /** Pointer to a const 32-bit unsigned integer union. */
|
---|
216 | typedef const RTUINT16U *PCRTUINT16U;
|
---|
217 |
|
---|
218 |
|
---|
219 | /**
|
---|
220 | * 32-bit unsigned integer union.
|
---|
221 | */
|
---|
222 | typedef union RTUINT32U
|
---|
223 | {
|
---|
224 | /** natural view. */
|
---|
225 | uint32_t u;
|
---|
226 | /** Hi/Low view. */
|
---|
227 | struct
|
---|
228 | {
|
---|
229 | uint16_t Lo;
|
---|
230 | uint16_t Hi;
|
---|
231 | } s;
|
---|
232 | /** Word view. */
|
---|
233 | struct
|
---|
234 | {
|
---|
235 | uint16_t w0;
|
---|
236 | uint16_t w1;
|
---|
237 | } Words;
|
---|
238 |
|
---|
239 | /** 32-bit view. */
|
---|
240 | uint32_t au32[1];
|
---|
241 | /** 16-bit view. */
|
---|
242 | uint16_t au16[2];
|
---|
243 | /** 8-bit view. */
|
---|
244 | uint8_t au8[4];
|
---|
245 | } RTUINT32U;
|
---|
246 | /** Pointer to a 32-bit unsigned integer union. */
|
---|
247 | typedef RTUINT32U *PRTUINT32U;
|
---|
248 | /** Pointer to a const 32-bit unsigned integer union. */
|
---|
249 | typedef const RTUINT32U *PCRTUINT32U;
|
---|
250 |
|
---|
251 |
|
---|
252 | /**
|
---|
253 | * 64-bit unsigned integer union.
|
---|
254 | */
|
---|
255 | typedef union RTUINT64U
|
---|
256 | {
|
---|
257 | /** Natural view. */
|
---|
258 | uint64_t u;
|
---|
259 | /** Hi/Low view. */
|
---|
260 | struct
|
---|
261 | {
|
---|
262 | uint32_t Lo;
|
---|
263 | uint32_t Hi;
|
---|
264 | } s;
|
---|
265 | /** Double-Word view. */
|
---|
266 | struct
|
---|
267 | {
|
---|
268 | uint32_t dw0;
|
---|
269 | uint32_t dw1;
|
---|
270 | } DWords;
|
---|
271 | /** Word view. */
|
---|
272 | struct
|
---|
273 | {
|
---|
274 | uint16_t w0;
|
---|
275 | uint16_t w1;
|
---|
276 | uint16_t w2;
|
---|
277 | uint16_t w3;
|
---|
278 | } Words;
|
---|
279 |
|
---|
280 | /** 64-bit view. */
|
---|
281 | uint64_t au64[1];
|
---|
282 | /** 32-bit view. */
|
---|
283 | uint32_t au32[2];
|
---|
284 | /** 16-bit view. */
|
---|
285 | uint16_t au16[4];
|
---|
286 | /** 8-bit view. */
|
---|
287 | uint8_t au8[8];
|
---|
288 | } RTUINT64U;
|
---|
289 | /** Pointer to a 64-bit unsigned integer union. */
|
---|
290 | typedef RTUINT64U *PRTUINT64U;
|
---|
291 | /** Pointer to a const 64-bit unsigned integer union. */
|
---|
292 | typedef const RTUINT64U *PCRTUINT64U;
|
---|
293 |
|
---|
294 |
|
---|
295 | /**
|
---|
296 | * 128-bit unsigned integer union.
|
---|
297 | */
|
---|
298 | typedef union RTUINT128U
|
---|
299 | {
|
---|
300 | /** Natural view.
|
---|
301 | * WARNING! This member depends on the compiler supporting 128-bit stuff. */
|
---|
302 | uint128_t u;
|
---|
303 | /** Hi/Low view. */
|
---|
304 | struct
|
---|
305 | {
|
---|
306 | uint64_t Lo;
|
---|
307 | uint64_t Hi;
|
---|
308 | } s;
|
---|
309 | /** Quad-Word view. */
|
---|
310 | struct
|
---|
311 | {
|
---|
312 | uint64_t qw0;
|
---|
313 | uint64_t qw1;
|
---|
314 | } QWords;
|
---|
315 | /** Double-Word view. */
|
---|
316 | struct
|
---|
317 | {
|
---|
318 | uint32_t dw0;
|
---|
319 | uint32_t dw1;
|
---|
320 | uint32_t dw2;
|
---|
321 | uint32_t dw3;
|
---|
322 | } DWords;
|
---|
323 | /** Word view. */
|
---|
324 | struct
|
---|
325 | {
|
---|
326 | uint16_t w0;
|
---|
327 | uint16_t w1;
|
---|
328 | uint16_t w2;
|
---|
329 | uint16_t w3;
|
---|
330 | uint16_t w4;
|
---|
331 | uint16_t w5;
|
---|
332 | uint16_t w6;
|
---|
333 | uint16_t w7;
|
---|
334 | } Words;
|
---|
335 |
|
---|
336 | /** 64-bit view. */
|
---|
337 | uint64_t au64[2];
|
---|
338 | /** 32-bit view. */
|
---|
339 | uint32_t au32[4];
|
---|
340 | /** 16-bit view. */
|
---|
341 | uint16_t au16[8];
|
---|
342 | /** 8-bit view. */
|
---|
343 | uint8_t au8[16];
|
---|
344 | } RTUINT128U;
|
---|
345 | /** Pointer to a 64-bit unsigned integer union. */
|
---|
346 | typedef RTUINT128U *PRTUINT128U;
|
---|
347 | /** Pointer to a const 64-bit unsigned integer union. */
|
---|
348 | typedef const RTUINT128U *PCRTUINT128U;
|
---|
349 |
|
---|
350 |
|
---|
351 | /** Generic function type.
|
---|
352 | * @see PFNRT
|
---|
353 | */
|
---|
354 | typedef DECLCALLBACK(void) FNRT(void);
|
---|
355 |
|
---|
356 | /** Generic function pointer.
|
---|
357 | * With -pedantic, gcc-4 complains when casting a function to a data object, for
|
---|
358 | * example:
|
---|
359 | *
|
---|
360 | * @code
|
---|
361 | * void foo(void)
|
---|
362 | * {
|
---|
363 | * }
|
---|
364 | *
|
---|
365 | * void *bar = (void *)foo;
|
---|
366 | * @endcode
|
---|
367 | *
|
---|
368 | * The compiler would warn with "ISO C++ forbids casting between
|
---|
369 | * pointer-to-function and pointer-to-object". The purpose of this warning is
|
---|
370 | * not to bother the programmer but to point out that he is probably doing
|
---|
371 | * something dangerous, assigning a pointer to executable code to a data object.
|
---|
372 | */
|
---|
373 | typedef FNRT *PFNRT;
|
---|
374 |
|
---|
375 | /** Millisecond interval. */
|
---|
376 | typedef uint32_t RTMSINTERVAL;
|
---|
377 | /** Pointer to a millisecond interval. */
|
---|
378 | typedef RTMSINTERVAL *PRTMSINTERVAL;
|
---|
379 | /** Pointer to a const millisecond interval. */
|
---|
380 | typedef const RTMSINTERVAL *PCRTMSINTERVAL;
|
---|
381 |
|
---|
382 |
|
---|
383 | /** @defgroup grp_rt_types_both Common Guest and Host Context Basic Types
|
---|
384 | * @ingroup grp_rt_types
|
---|
385 | * @{
|
---|
386 | */
|
---|
387 |
|
---|
388 | /** Signed integer which can contain both GC and HC pointers. */
|
---|
389 | #if (HC_ARCH_BITS == 32 && GC_ARCH_BITS == 32)
|
---|
390 | typedef int32_t RTINTPTR;
|
---|
391 | #elif (HC_ARCH_BITS == 64 || GC_ARCH_BITS == 64)
|
---|
392 | typedef int64_t RTINTPTR;
|
---|
393 | #else
|
---|
394 | # error Unsupported HC_ARCH_BITS and/or GC_ARCH_BITS values.
|
---|
395 | #endif
|
---|
396 | /** Pointer to signed integer which can contain both GC and HC pointers. */
|
---|
397 | typedef RTINTPTR *PRTINTPTR;
|
---|
398 | /** Pointer const to signed integer which can contain both GC and HC pointers. */
|
---|
399 | typedef const RTINTPTR *PCRTINTPTR;
|
---|
400 |
|
---|
401 | /** Unsigned integer which can contain both GC and HC pointers. */
|
---|
402 | #if (HC_ARCH_BITS == 32 && GC_ARCH_BITS == 32)
|
---|
403 | typedef uint32_t RTUINTPTR;
|
---|
404 | #elif (HC_ARCH_BITS == 64 || GC_ARCH_BITS == 64)
|
---|
405 | typedef uint64_t RTUINTPTR;
|
---|
406 | #else
|
---|
407 | # error Unsupported HC_ARCH_BITS and/or GC_ARCH_BITS values.
|
---|
408 | #endif
|
---|
409 | /** Pointer to unsigned integer which can contain both GC and HC pointers. */
|
---|
410 | typedef RTUINTPTR *PRTUINTPTR;
|
---|
411 | /** Pointer const to unsigned integer which can contain both GC and HC pointers. */
|
---|
412 | typedef const RTUINTPTR *PCRTUINTPTR;
|
---|
413 | /** The maximum value the RTUINTPTR type can hold. */
|
---|
414 | #if (HC_ARCH_BITS == 32 && GC_ARCH_BITS == 32)
|
---|
415 | # define RTUINTPTR_MAX UINT32_MAX
|
---|
416 | #elif (HC_ARCH_BITS == 64 || GC_ARCH_BITS == 64)
|
---|
417 | # define RTUINTPTR_MAX UINT64_MAX
|
---|
418 | #else
|
---|
419 | # error Unsupported HC_ARCH_BITS and/or GC_ARCH_BITS values.
|
---|
420 | #endif
|
---|
421 |
|
---|
422 | /** Signed integer. */
|
---|
423 | typedef int32_t RTINT;
|
---|
424 | /** Pointer to signed integer. */
|
---|
425 | typedef RTINT *PRTINT;
|
---|
426 | /** Pointer to const signed integer. */
|
---|
427 | typedef const RTINT *PCRTINT;
|
---|
428 |
|
---|
429 | /** Unsigned integer. */
|
---|
430 | typedef uint32_t RTUINT;
|
---|
431 | /** Pointer to unsigned integer. */
|
---|
432 | typedef RTUINT *PRTUINT;
|
---|
433 | /** Pointer to const unsigned integer. */
|
---|
434 | typedef const RTUINT *PCRTUINT;
|
---|
435 |
|
---|
436 | /** A file offset / size (off_t). */
|
---|
437 | typedef int64_t RTFOFF;
|
---|
438 | /** Pointer to a file offset / size. */
|
---|
439 | typedef RTFOFF *PRTFOFF;
|
---|
440 | /** The max value for RTFOFF. */
|
---|
441 | #define RTFOFF_MAX INT64_MAX
|
---|
442 | /** The min value for RTFOFF. */
|
---|
443 | #define RTFOFF_MIN INT64_MIN
|
---|
444 |
|
---|
445 | /** File mode (see iprt/fs.h). */
|
---|
446 | typedef uint32_t RTFMODE;
|
---|
447 | /** Pointer to file mode. */
|
---|
448 | typedef RTFMODE *PRTFMODE;
|
---|
449 |
|
---|
450 | /** Device unix number. */
|
---|
451 | typedef uint32_t RTDEV;
|
---|
452 | /** Pointer to a device unix number. */
|
---|
453 | typedef RTDEV *PRTDEV;
|
---|
454 |
|
---|
455 | /** i-node number. */
|
---|
456 | typedef uint64_t RTINODE;
|
---|
457 | /** Pointer to a i-node number. */
|
---|
458 | typedef RTINODE *PRTINODE;
|
---|
459 |
|
---|
460 | /** User id. */
|
---|
461 | typedef uint32_t RTUID;
|
---|
462 | /** Pointer to a user id. */
|
---|
463 | typedef RTUID *PRTUID;
|
---|
464 | /** NIL user id.
|
---|
465 | * @todo check this for portability! */
|
---|
466 | #define NIL_RTUID (~(RTUID)0);
|
---|
467 |
|
---|
468 | /** Group id. */
|
---|
469 | typedef uint32_t RTGID;
|
---|
470 | /** Pointer to a group id. */
|
---|
471 | typedef RTGID *PRTGID;
|
---|
472 | /** NIL group id.
|
---|
473 | * @todo check this for portability! */
|
---|
474 | #define NIL_RTGID (~(RTGID)0);
|
---|
475 |
|
---|
476 | /** I/O Port. */
|
---|
477 | typedef uint16_t RTIOPORT;
|
---|
478 | /** Pointer to I/O Port. */
|
---|
479 | typedef RTIOPORT *PRTIOPORT;
|
---|
480 | /** Pointer to const I/O Port. */
|
---|
481 | typedef const RTIOPORT *PCRTIOPORT;
|
---|
482 |
|
---|
483 | /** Selector. */
|
---|
484 | typedef uint16_t RTSEL;
|
---|
485 | /** Pointer to selector. */
|
---|
486 | typedef RTSEL *PRTSEL;
|
---|
487 | /** Pointer to const selector. */
|
---|
488 | typedef const RTSEL *PCRTSEL;
|
---|
489 | /** Max selector value. */
|
---|
490 | #define RTSEL_MAX UINT16_MAX
|
---|
491 |
|
---|
492 | /** Far 16-bit pointer. */
|
---|
493 | #pragma pack(1)
|
---|
494 | typedef struct RTFAR16
|
---|
495 | {
|
---|
496 | uint16_t off;
|
---|
497 | RTSEL sel;
|
---|
498 | } RTFAR16;
|
---|
499 | #pragma pack()
|
---|
500 | /** Pointer to Far 16-bit pointer. */
|
---|
501 | typedef RTFAR16 *PRTFAR16;
|
---|
502 | /** Pointer to const Far 16-bit pointer. */
|
---|
503 | typedef const RTFAR16 *PCRTFAR16;
|
---|
504 |
|
---|
505 | /** Far 32-bit pointer. */
|
---|
506 | #pragma pack(1)
|
---|
507 | typedef struct RTFAR32
|
---|
508 | {
|
---|
509 | uint32_t off;
|
---|
510 | RTSEL sel;
|
---|
511 | } RTFAR32;
|
---|
512 | #pragma pack()
|
---|
513 | /** Pointer to Far 32-bit pointer. */
|
---|
514 | typedef RTFAR32 *PRTFAR32;
|
---|
515 | /** Pointer to const Far 32-bit pointer. */
|
---|
516 | typedef const RTFAR32 *PCRTFAR32;
|
---|
517 |
|
---|
518 | /** Far 64-bit pointer. */
|
---|
519 | #pragma pack(1)
|
---|
520 | typedef struct RTFAR64
|
---|
521 | {
|
---|
522 | uint64_t off;
|
---|
523 | RTSEL sel;
|
---|
524 | } RTFAR64;
|
---|
525 | #pragma pack()
|
---|
526 | /** Pointer to Far 64-bit pointer. */
|
---|
527 | typedef RTFAR64 *PRTFAR64;
|
---|
528 | /** Pointer to const Far 64-bit pointer. */
|
---|
529 | typedef const RTFAR64 *PCRTFAR64;
|
---|
530 |
|
---|
531 | /** @} */
|
---|
532 |
|
---|
533 |
|
---|
534 | /** @defgroup grp_rt_types_hc Host Context Basic Types
|
---|
535 | * @ingroup grp_rt_types
|
---|
536 | * @{
|
---|
537 | */
|
---|
538 |
|
---|
539 | /** HC Natural signed integer.
|
---|
540 | * @deprecated silly type. */
|
---|
541 | typedef int32_t RTHCINT;
|
---|
542 | /** Pointer to HC Natural signed integer.
|
---|
543 | * @deprecated silly type. */
|
---|
544 | typedef RTHCINT *PRTHCINT;
|
---|
545 | /** Pointer to const HC Natural signed integer.
|
---|
546 | * @deprecated silly type. */
|
---|
547 | typedef const RTHCINT *PCRTHCINT;
|
---|
548 |
|
---|
549 | /** HC Natural unsigned integer.
|
---|
550 | * @deprecated silly type. */
|
---|
551 | typedef uint32_t RTHCUINT;
|
---|
552 | /** Pointer to HC Natural unsigned integer.
|
---|
553 | * @deprecated silly type. */
|
---|
554 | typedef RTHCUINT *PRTHCUINT;
|
---|
555 | /** Pointer to const HC Natural unsigned integer.
|
---|
556 | * @deprecated silly type. */
|
---|
557 | typedef const RTHCUINT *PCRTHCUINT;
|
---|
558 |
|
---|
559 |
|
---|
560 | /** Signed integer which can contain a HC pointer. */
|
---|
561 | #if HC_ARCH_BITS == 32
|
---|
562 | typedef int32_t RTHCINTPTR;
|
---|
563 | #elif HC_ARCH_BITS == 64
|
---|
564 | typedef int64_t RTHCINTPTR;
|
---|
565 | #else
|
---|
566 | # error Unsupported HC_ARCH_BITS value.
|
---|
567 | #endif
|
---|
568 | /** Pointer to signed integer which can contain a HC pointer. */
|
---|
569 | typedef RTHCINTPTR *PRTHCINTPTR;
|
---|
570 | /** Pointer to const signed integer which can contain a HC pointer. */
|
---|
571 | typedef const RTHCINTPTR *PCRTHCINTPTR;
|
---|
572 | /** Max RTHCINTPTR value. */
|
---|
573 | #if HC_ARCH_BITS == 32
|
---|
574 | # define RTHCINTPTR_MAX INT32_MAX
|
---|
575 | #else
|
---|
576 | # define RTHCINTPTR_MAX INT64_MAX
|
---|
577 | #endif
|
---|
578 | /** Min RTHCINTPTR value. */
|
---|
579 | #if HC_ARCH_BITS == 32
|
---|
580 | # define RTHCINTPTR_MIN INT32_MIN
|
---|
581 | #else
|
---|
582 | # define RTHCINTPTR_MIN INT64_MIN
|
---|
583 | #endif
|
---|
584 |
|
---|
585 | /** Signed integer which can contain a HC ring-3 pointer. */
|
---|
586 | #if R3_ARCH_BITS == 32
|
---|
587 | typedef int32_t RTR3INTPTR;
|
---|
588 | #elif R3_ARCH_BITS == 64
|
---|
589 | typedef int64_t RTR3INTPTR;
|
---|
590 | #else
|
---|
591 | # error Unsupported R3_ARCH_BITS value.
|
---|
592 | #endif
|
---|
593 | /** Pointer to signed integer which can contain a HC ring-3 pointer. */
|
---|
594 | typedef RTR3INTPTR *PRTR3INTPTR;
|
---|
595 | /** Pointer to const signed integer which can contain a HC ring-3 pointer. */
|
---|
596 | typedef const RTR3INTPTR *PCRTR3INTPTR;
|
---|
597 | /** Max RTR3INTPTR value. */
|
---|
598 | #if R3_ARCH_BITS == 32
|
---|
599 | # define RTR3INTPTR_MAX INT32_MAX
|
---|
600 | #else
|
---|
601 | # define RTR3INTPTR_MAX INT64_MAX
|
---|
602 | #endif
|
---|
603 | /** Min RTR3INTPTR value. */
|
---|
604 | #if R3_ARCH_BITS == 32
|
---|
605 | # define RTR3INTPTR_MIN INT32_MIN
|
---|
606 | #else
|
---|
607 | # define RTR3INTPTR_MIN INT64_MIN
|
---|
608 | #endif
|
---|
609 |
|
---|
610 | /** Signed integer which can contain a HC ring-0 pointer. */
|
---|
611 | #if R0_ARCH_BITS == 32
|
---|
612 | typedef int32_t RTR0INTPTR;
|
---|
613 | #elif R0_ARCH_BITS == 64
|
---|
614 | typedef int64_t RTR0INTPTR;
|
---|
615 | #else
|
---|
616 | # error Unsupported R0_ARCH_BITS value.
|
---|
617 | #endif
|
---|
618 | /** Pointer to signed integer which can contain a HC ring-0 pointer. */
|
---|
619 | typedef RTR0INTPTR *PRTR0INTPTR;
|
---|
620 | /** Pointer to const signed integer which can contain a HC ring-0 pointer. */
|
---|
621 | typedef const RTR0INTPTR *PCRTR0INTPTR;
|
---|
622 | /** Max RTR0INTPTR value. */
|
---|
623 | #if R0_ARCH_BITS == 32
|
---|
624 | # define RTR0INTPTR_MAX INT32_MAX
|
---|
625 | #else
|
---|
626 | # define RTR0INTPTR_MAX INT64_MAX
|
---|
627 | #endif
|
---|
628 | /** Min RTHCINTPTR value. */
|
---|
629 | #if R0_ARCH_BITS == 32
|
---|
630 | # define RTR0INTPTR_MIN INT32_MIN
|
---|
631 | #else
|
---|
632 | # define RTR0INTPTR_MIN INT64_MIN
|
---|
633 | #endif
|
---|
634 |
|
---|
635 |
|
---|
636 | /** Unsigned integer which can contain a HC pointer. */
|
---|
637 | #if HC_ARCH_BITS == 32
|
---|
638 | typedef uint32_t RTHCUINTPTR;
|
---|
639 | #elif HC_ARCH_BITS == 64
|
---|
640 | typedef uint64_t RTHCUINTPTR;
|
---|
641 | #else
|
---|
642 | # error Unsupported HC_ARCH_BITS value.
|
---|
643 | #endif
|
---|
644 | /** Pointer to unsigned integer which can contain a HC pointer. */
|
---|
645 | typedef RTHCUINTPTR *PRTHCUINTPTR;
|
---|
646 | /** Pointer to unsigned integer which can contain a HC pointer. */
|
---|
647 | typedef const RTHCUINTPTR *PCRTHCUINTPTR;
|
---|
648 | /** Max RTHCUINTTPR value. */
|
---|
649 | #if HC_ARCH_BITS == 32
|
---|
650 | # define RTHCUINTPTR_MAX UINT32_MAX
|
---|
651 | #else
|
---|
652 | # define RTHCUINTPTR_MAX UINT64_MAX
|
---|
653 | #endif
|
---|
654 |
|
---|
655 | /** Unsigned integer which can contain a HC ring-3 pointer. */
|
---|
656 | #if R3_ARCH_BITS == 32
|
---|
657 | typedef uint32_t RTR3UINTPTR;
|
---|
658 | #elif R3_ARCH_BITS == 64
|
---|
659 | typedef uint64_t RTR3UINTPTR;
|
---|
660 | #else
|
---|
661 | # error Unsupported R3_ARCH_BITS value.
|
---|
662 | #endif
|
---|
663 | /** Pointer to unsigned integer which can contain a HC ring-3 pointer. */
|
---|
664 | typedef RTR3UINTPTR *PRTR3UINTPTR;
|
---|
665 | /** Pointer to unsigned integer which can contain a HC ring-3 pointer. */
|
---|
666 | typedef const RTR3UINTPTR *PCRTR3UINTPTR;
|
---|
667 | /** Max RTHCUINTTPR value. */
|
---|
668 | #if R3_ARCH_BITS == 32
|
---|
669 | # define RTR3UINTPTR_MAX UINT32_MAX
|
---|
670 | #else
|
---|
671 | # define RTR3UINTPTR_MAX UINT64_MAX
|
---|
672 | #endif
|
---|
673 |
|
---|
674 | /** Unsigned integer which can contain a HC ring-0 pointer. */
|
---|
675 | #if R0_ARCH_BITS == 32
|
---|
676 | typedef uint32_t RTR0UINTPTR;
|
---|
677 | #elif R0_ARCH_BITS == 64
|
---|
678 | typedef uint64_t RTR0UINTPTR;
|
---|
679 | #else
|
---|
680 | # error Unsupported R0_ARCH_BITS value.
|
---|
681 | #endif
|
---|
682 | /** Pointer to unsigned integer which can contain a HC ring-0 pointer. */
|
---|
683 | typedef RTR0UINTPTR *PRTR0UINTPTR;
|
---|
684 | /** Pointer to unsigned integer which can contain a HC ring-0 pointer. */
|
---|
685 | typedef const RTR0UINTPTR *PCRTR0UINTPTR;
|
---|
686 | /** Max RTR0UINTTPR value. */
|
---|
687 | #if HC_ARCH_BITS == 32
|
---|
688 | # define RTR0UINTPTR_MAX UINT32_MAX
|
---|
689 | #else
|
---|
690 | # define RTR0UINTPTR_MAX UINT64_MAX
|
---|
691 | #endif
|
---|
692 |
|
---|
693 |
|
---|
694 | /** Host Physical Memory Address. */
|
---|
695 | typedef uint64_t RTHCPHYS;
|
---|
696 | /** Pointer to Host Physical Memory Address. */
|
---|
697 | typedef RTHCPHYS *PRTHCPHYS;
|
---|
698 | /** Pointer to const Host Physical Memory Address. */
|
---|
699 | typedef const RTHCPHYS *PCRTHCPHYS;
|
---|
700 | /** @def NIL_RTHCPHYS
|
---|
701 | * NIL HC Physical Address.
|
---|
702 | * NIL_RTHCPHYS is used to signal an invalid physical address, similar
|
---|
703 | * to the NULL pointer.
|
---|
704 | */
|
---|
705 | #define NIL_RTHCPHYS (~(RTHCPHYS)0)
|
---|
706 | /** Max RTHCPHYS value. */
|
---|
707 | #define RTHCPHYS_MAX UINT64_MAX
|
---|
708 |
|
---|
709 |
|
---|
710 | /** HC pointer. */
|
---|
711 | #ifndef IN_RC
|
---|
712 | typedef void * RTHCPTR;
|
---|
713 | #else
|
---|
714 | typedef RTHCUINTPTR RTHCPTR;
|
---|
715 | #endif
|
---|
716 | /** Pointer to HC pointer. */
|
---|
717 | typedef RTHCPTR *PRTHCPTR;
|
---|
718 | /** Pointer to const HC pointer. */
|
---|
719 | typedef const RTHCPTR *PCRTHCPTR;
|
---|
720 | /** @def NIL_RTHCPTR
|
---|
721 | * NIL HC pointer.
|
---|
722 | */
|
---|
723 | #define NIL_RTHCPTR ((RTHCPTR)0)
|
---|
724 | /** Max RTHCPTR value. */
|
---|
725 | #define RTHCPTR_MAX ((RTHCPTR)RTHCUINTPTR_MAX)
|
---|
726 |
|
---|
727 |
|
---|
728 | /** HC ring-3 pointer. */
|
---|
729 | #ifdef IN_RING3
|
---|
730 | typedef void * RTR3PTR;
|
---|
731 | #else
|
---|
732 | typedef RTR3UINTPTR RTR3PTR;
|
---|
733 | #endif
|
---|
734 | /** Pointer to HC ring-3 pointer. */
|
---|
735 | typedef RTR3PTR *PRTR3PTR;
|
---|
736 | /** Pointer to const HC ring-3 pointer. */
|
---|
737 | typedef const RTR3PTR *PCRTR3PTR;
|
---|
738 | /** @def NIL_RTR3PTR
|
---|
739 | * NIL HC ring-3 pointer.
|
---|
740 | */
|
---|
741 | #define NIL_RTR3PTR ((RTR3PTR)0)
|
---|
742 | /** Max RTR3PTR value. */
|
---|
743 | #define RTR3PTR_MAX ((RTR3PTR)RTR3UINTPTR_MAX)
|
---|
744 |
|
---|
745 | /** HC ring-0 pointer. */
|
---|
746 | #ifdef IN_RING0
|
---|
747 | typedef void * RTR0PTR;
|
---|
748 | #else
|
---|
749 | typedef RTR0UINTPTR RTR0PTR;
|
---|
750 | #endif
|
---|
751 | /** Pointer to HC ring-0 pointer. */
|
---|
752 | typedef RTR0PTR *PRTR0PTR;
|
---|
753 | /** Pointer to const HC ring-0 pointer. */
|
---|
754 | typedef const RTR0PTR *PCRTR0PTR;
|
---|
755 | /** @def NIL_RTR0PTR
|
---|
756 | * NIL HC ring-0 pointer.
|
---|
757 | */
|
---|
758 | #define NIL_RTR0PTR ((RTR0PTR)0)
|
---|
759 | /** Max RTR3PTR value. */
|
---|
760 | #define RTR0PTR_MAX ((RTR0PTR)RTR0UINTPTR_MAX)
|
---|
761 |
|
---|
762 |
|
---|
763 | /** Unsigned integer register in the host context. */
|
---|
764 | #if HC_ARCH_BITS == 32
|
---|
765 | typedef uint32_t RTHCUINTREG;
|
---|
766 | #elif HC_ARCH_BITS == 64
|
---|
767 | typedef uint64_t RTHCUINTREG;
|
---|
768 | #else
|
---|
769 | # error "Unsupported HC_ARCH_BITS!"
|
---|
770 | #endif
|
---|
771 | /** Pointer to an unsigned integer register in the host context. */
|
---|
772 | typedef RTHCUINTREG *PRTHCUINTREG;
|
---|
773 | /** Pointer to a const unsigned integer register in the host context. */
|
---|
774 | typedef const RTHCUINTREG *PCRTHCUINTREG;
|
---|
775 |
|
---|
776 | /** Unsigned integer register in the host ring-3 context. */
|
---|
777 | #if R3_ARCH_BITS == 32
|
---|
778 | typedef uint32_t RTR3UINTREG;
|
---|
779 | #elif R3_ARCH_BITS == 64
|
---|
780 | typedef uint64_t RTR3UINTREG;
|
---|
781 | #else
|
---|
782 | # error "Unsupported R3_ARCH_BITS!"
|
---|
783 | #endif
|
---|
784 | /** Pointer to an unsigned integer register in the host ring-3 context. */
|
---|
785 | typedef RTR3UINTREG *PRTR3UINTREG;
|
---|
786 | /** Pointer to a const unsigned integer register in the host ring-3 context. */
|
---|
787 | typedef const RTR3UINTREG *PCRTR3UINTREG;
|
---|
788 |
|
---|
789 | /** Unsigned integer register in the host ring-3 context. */
|
---|
790 | #if R0_ARCH_BITS == 32
|
---|
791 | typedef uint32_t RTR0UINTREG;
|
---|
792 | #elif R0_ARCH_BITS == 64
|
---|
793 | typedef uint64_t RTR0UINTREG;
|
---|
794 | #else
|
---|
795 | # error "Unsupported R3_ARCH_BITS!"
|
---|
796 | #endif
|
---|
797 | /** Pointer to an unsigned integer register in the host ring-3 context. */
|
---|
798 | typedef RTR0UINTREG *PRTR0UINTREG;
|
---|
799 | /** Pointer to a const unsigned integer register in the host ring-3 context. */
|
---|
800 | typedef const RTR0UINTREG *PCRTR0UINTREG;
|
---|
801 |
|
---|
802 | /** @} */
|
---|
803 |
|
---|
804 |
|
---|
805 | /** @defgroup grp_rt_types_gc Guest Context Basic Types
|
---|
806 | * @ingroup grp_rt_types
|
---|
807 | * @{
|
---|
808 | */
|
---|
809 |
|
---|
810 | /** Natural signed integer in the GC.
|
---|
811 | * @deprecated silly type. */
|
---|
812 | #if GC_ARCH_BITS == 32
|
---|
813 | typedef int32_t RTGCINT;
|
---|
814 | #elif GC_ARCH_BITS == 64 /** @todo this isn't right, natural int is 32-bit, see RTHCINT. */
|
---|
815 | typedef int64_t RTGCINT;
|
---|
816 | #endif
|
---|
817 | /** Pointer to natural signed integer in GC.
|
---|
818 | * @deprecated silly type. */
|
---|
819 | typedef RTGCINT *PRTGCINT;
|
---|
820 | /** Pointer to const natural signed integer in GC.
|
---|
821 | * @deprecated silly type. */
|
---|
822 | typedef const RTGCINT *PCRTGCINT;
|
---|
823 |
|
---|
824 | /** Natural unsigned integer in the GC.
|
---|
825 | * @deprecated silly type. */
|
---|
826 | #if GC_ARCH_BITS == 32
|
---|
827 | typedef uint32_t RTGCUINT;
|
---|
828 | #elif GC_ARCH_BITS == 64 /** @todo this isn't right, natural int is 32-bit, see RTHCUINT. */
|
---|
829 | typedef uint64_t RTGCUINT;
|
---|
830 | #endif
|
---|
831 | /** Pointer to natural unsigned integer in GC.
|
---|
832 | * @deprecated silly type. */
|
---|
833 | typedef RTGCUINT *PRTGCUINT;
|
---|
834 | /** Pointer to const natural unsigned integer in GC.
|
---|
835 | * @deprecated silly type. */
|
---|
836 | typedef const RTGCUINT *PCRTGCUINT;
|
---|
837 |
|
---|
838 | /** Signed integer which can contain a GC pointer. */
|
---|
839 | #if GC_ARCH_BITS == 32
|
---|
840 | typedef int32_t RTGCINTPTR;
|
---|
841 | #elif GC_ARCH_BITS == 64
|
---|
842 | typedef int64_t RTGCINTPTR;
|
---|
843 | #endif
|
---|
844 | /** Pointer to signed integer which can contain a GC pointer. */
|
---|
845 | typedef RTGCINTPTR *PRTGCINTPTR;
|
---|
846 | /** Pointer to const signed integer which can contain a GC pointer. */
|
---|
847 | typedef const RTGCINTPTR *PCRTGCINTPTR;
|
---|
848 |
|
---|
849 | /** Unsigned integer which can contain a GC pointer. */
|
---|
850 | #if GC_ARCH_BITS == 32
|
---|
851 | typedef uint32_t RTGCUINTPTR;
|
---|
852 | #elif GC_ARCH_BITS == 64
|
---|
853 | typedef uint64_t RTGCUINTPTR;
|
---|
854 | #else
|
---|
855 | # error Unsupported GC_ARCH_BITS value.
|
---|
856 | #endif
|
---|
857 | /** Pointer to unsigned integer which can contain a GC pointer. */
|
---|
858 | typedef RTGCUINTPTR *PRTGCUINTPTR;
|
---|
859 | /** Pointer to unsigned integer which can contain a GC pointer. */
|
---|
860 | typedef const RTGCUINTPTR *PCRTGCUINTPTR;
|
---|
861 |
|
---|
862 | /** Unsigned integer which can contain a 32 bits GC pointer. */
|
---|
863 | typedef uint32_t RTGCUINTPTR32;
|
---|
864 | /** Pointer to unsigned integer which can contain a 32 bits GC pointer. */
|
---|
865 | typedef RTGCUINTPTR32 *PRTGCUINTPTR32;
|
---|
866 | /** Pointer to unsigned integer which can contain a 32 bits GC pointer. */
|
---|
867 | typedef const RTGCUINTPTR32 *PCRTGCUINTPTR32;
|
---|
868 |
|
---|
869 | /** Unsigned integer which can contain a 64 bits GC pointer. */
|
---|
870 | typedef uint64_t RTGCUINTPTR64;
|
---|
871 | /** Pointer to unsigned integer which can contain a 32 bits GC pointer. */
|
---|
872 | typedef RTGCUINTPTR64 *PRTGCUINTPTR64;
|
---|
873 | /** Pointer to unsigned integer which can contain a 32 bits GC pointer. */
|
---|
874 | typedef const RTGCUINTPTR64 *PCRTGCUINTPTR64;
|
---|
875 |
|
---|
876 | /** Guest Physical Memory Address.*/
|
---|
877 | typedef uint64_t RTGCPHYS;
|
---|
878 | /** Pointer to Guest Physical Memory Address. */
|
---|
879 | typedef RTGCPHYS *PRTGCPHYS;
|
---|
880 | /** Pointer to const Guest Physical Memory Address. */
|
---|
881 | typedef const RTGCPHYS *PCRTGCPHYS;
|
---|
882 | /** @def NIL_RTGCPHYS
|
---|
883 | * NIL GC Physical Address.
|
---|
884 | * NIL_RTGCPHYS is used to signal an invalid physical address, similar
|
---|
885 | * to the NULL pointer. Note that this value may actually be valid in
|
---|
886 | * some contexts.
|
---|
887 | */
|
---|
888 | #define NIL_RTGCPHYS (~(RTGCPHYS)0U)
|
---|
889 | /** Max guest physical memory address value. */
|
---|
890 | #define RTGCPHYS_MAX UINT64_MAX
|
---|
891 |
|
---|
892 |
|
---|
893 | /** Guest Physical Memory Address; limited to 32 bits.*/
|
---|
894 | typedef uint32_t RTGCPHYS32;
|
---|
895 | /** Pointer to Guest Physical Memory Address. */
|
---|
896 | typedef RTGCPHYS32 *PRTGCPHYS32;
|
---|
897 | /** Pointer to const Guest Physical Memory Address. */
|
---|
898 | typedef const RTGCPHYS32 *PCRTGCPHYS32;
|
---|
899 | /** @def NIL_RTGCPHYS32
|
---|
900 | * NIL GC Physical Address.
|
---|
901 | * NIL_RTGCPHYS32 is used to signal an invalid physical address, similar
|
---|
902 | * to the NULL pointer. Note that this value may actually be valid in
|
---|
903 | * some contexts.
|
---|
904 | */
|
---|
905 | #define NIL_RTGCPHYS32 (~(RTGCPHYS32)0)
|
---|
906 |
|
---|
907 |
|
---|
908 | /** Guest Physical Memory Address; limited to 64 bits.*/
|
---|
909 | typedef uint64_t RTGCPHYS64;
|
---|
910 | /** Pointer to Guest Physical Memory Address. */
|
---|
911 | typedef RTGCPHYS64 *PRTGCPHYS64;
|
---|
912 | /** Pointer to const Guest Physical Memory Address. */
|
---|
913 | typedef const RTGCPHYS64 *PCRTGCPHYS64;
|
---|
914 | /** @def NIL_RTGCPHYS64
|
---|
915 | * NIL GC Physical Address.
|
---|
916 | * NIL_RTGCPHYS64 is used to signal an invalid physical address, similar
|
---|
917 | * to the NULL pointer. Note that this value may actually be valid in
|
---|
918 | * some contexts.
|
---|
919 | */
|
---|
920 | #define NIL_RTGCPHYS64 (~(RTGCPHYS64)0)
|
---|
921 |
|
---|
922 | /** Guest context pointer, 32 bits.
|
---|
923 | * Keep in mind that this type is an unsigned integer in
|
---|
924 | * HC and void pointer in GC.
|
---|
925 | */
|
---|
926 | typedef RTGCUINTPTR32 RTGCPTR32;
|
---|
927 | /** Pointer to a guest context pointer. */
|
---|
928 | typedef RTGCPTR32 *PRTGCPTR32;
|
---|
929 | /** Pointer to a const guest context pointer. */
|
---|
930 | typedef const RTGCPTR32 *PCRTGCPTR32;
|
---|
931 | /** @def NIL_RTGCPTR32
|
---|
932 | * NIL GC pointer.
|
---|
933 | */
|
---|
934 | #define NIL_RTGCPTR32 ((RTGCPTR32)0)
|
---|
935 |
|
---|
936 | /** Guest context pointer, 64 bits.
|
---|
937 | */
|
---|
938 | typedef RTGCUINTPTR64 RTGCPTR64;
|
---|
939 | /** Pointer to a guest context pointer. */
|
---|
940 | typedef RTGCPTR64 *PRTGCPTR64;
|
---|
941 | /** Pointer to a const guest context pointer. */
|
---|
942 | typedef const RTGCPTR64 *PCRTGCPTR64;
|
---|
943 | /** @def NIL_RTGCPTR64
|
---|
944 | * NIL GC pointer.
|
---|
945 | */
|
---|
946 | #define NIL_RTGCPTR64 ((RTGCPTR64)0)
|
---|
947 |
|
---|
948 | /** Guest context pointer.
|
---|
949 | * Keep in mind that this type is an unsigned integer in
|
---|
950 | * HC and void pointer in GC.
|
---|
951 | */
|
---|
952 | #if GC_ARCH_BITS == 64
|
---|
953 | typedef RTGCPTR64 RTGCPTR;
|
---|
954 | /** Pointer to a guest context pointer. */
|
---|
955 | typedef PRTGCPTR64 PRTGCPTR;
|
---|
956 | /** Pointer to a const guest context pointer. */
|
---|
957 | typedef PCRTGCPTR64 PCRTGCPTR;
|
---|
958 | /** @def NIL_RTGCPTR
|
---|
959 | * NIL GC pointer.
|
---|
960 | */
|
---|
961 | # define NIL_RTGCPTR NIL_RTGCPTR64
|
---|
962 | /** Max RTGCPTR value. */
|
---|
963 | # define RTGCPTR_MAX UINT64_MAX
|
---|
964 | #elif GC_ARCH_BITS == 32
|
---|
965 | typedef RTGCPTR32 RTGCPTR;
|
---|
966 | /** Pointer to a guest context pointer. */
|
---|
967 | typedef PRTGCPTR32 PRTGCPTR;
|
---|
968 | /** Pointer to a const guest context pointer. */
|
---|
969 | typedef PCRTGCPTR32 PCRTGCPTR;
|
---|
970 | /** @def NIL_RTGCPTR
|
---|
971 | * NIL GC pointer.
|
---|
972 | */
|
---|
973 | # define NIL_RTGCPTR NIL_RTGCPTR32
|
---|
974 | /** Max RTGCPTR value. */
|
---|
975 | # define RTGCPTR_MAX UINT32_MAX
|
---|
976 | #else
|
---|
977 | # error "Unsupported GC_ARCH_BITS!"
|
---|
978 | #endif
|
---|
979 |
|
---|
980 | /** Unsigned integer register in the guest context. */
|
---|
981 | typedef uint32_t RTGCUINTREG32;
|
---|
982 | /** Pointer to an unsigned integer register in the guest context. */
|
---|
983 | typedef RTGCUINTREG32 *PRTGCUINTREG32;
|
---|
984 | /** Pointer to a const unsigned integer register in the guest context. */
|
---|
985 | typedef const RTGCUINTREG32 *PCRTGCUINTREG32;
|
---|
986 |
|
---|
987 | typedef uint64_t RTGCUINTREG64;
|
---|
988 | /** Pointer to an unsigned integer register in the guest context. */
|
---|
989 | typedef RTGCUINTREG64 *PRTGCUINTREG64;
|
---|
990 | /** Pointer to a const unsigned integer register in the guest context. */
|
---|
991 | typedef const RTGCUINTREG64 *PCRTGCUINTREG64;
|
---|
992 |
|
---|
993 | #if GC_ARCH_BITS == 64
|
---|
994 | typedef RTGCUINTREG64 RTGCUINTREG;
|
---|
995 | #elif GC_ARCH_BITS == 32
|
---|
996 | typedef RTGCUINTREG32 RTGCUINTREG;
|
---|
997 | #else
|
---|
998 | # error "Unsupported GC_ARCH_BITS!"
|
---|
999 | #endif
|
---|
1000 | /** Pointer to an unsigned integer register in the guest context. */
|
---|
1001 | typedef RTGCUINTREG *PRTGCUINTREG;
|
---|
1002 | /** Pointer to a const unsigned integer register in the guest context. */
|
---|
1003 | typedef const RTGCUINTREG *PCRTGCUINTREG;
|
---|
1004 |
|
---|
1005 | /** @} */
|
---|
1006 |
|
---|
1007 | /** @defgroup grp_rt_types_rc Raw mode Context Basic Types
|
---|
1008 | * @ingroup grp_rt_types
|
---|
1009 | * @{
|
---|
1010 | */
|
---|
1011 |
|
---|
1012 | /** Raw mode context pointer; a 32 bits guest context pointer.
|
---|
1013 | * Keep in mind that this type is an unsigned integer in
|
---|
1014 | * HC and void pointer in RC.
|
---|
1015 | */
|
---|
1016 | #ifdef IN_RC
|
---|
1017 | typedef void * RTRCPTR;
|
---|
1018 | #else
|
---|
1019 | typedef uint32_t RTRCPTR;
|
---|
1020 | #endif
|
---|
1021 | /** Pointer to a raw mode context pointer. */
|
---|
1022 | typedef RTRCPTR *PRTRCPTR;
|
---|
1023 | /** Pointer to a const raw mode context pointer. */
|
---|
1024 | typedef const RTRCPTR *PCRTRCPTR;
|
---|
1025 | /** @def NIL_RTGCPTR
|
---|
1026 | * NIL RC pointer.
|
---|
1027 | */
|
---|
1028 | #define NIL_RTRCPTR ((RTRCPTR)0)
|
---|
1029 | /** @def RTRCPTR_MAX
|
---|
1030 | * The maximum value a RTRCPTR can have. Mostly used as INVALID value.
|
---|
1031 | */
|
---|
1032 | #define RTRCPTR_MAX ((RTRCPTR)UINT32_MAX)
|
---|
1033 |
|
---|
1034 | /** Raw mode context pointer, unsigned integer variant. */
|
---|
1035 | typedef int32_t RTRCINTPTR;
|
---|
1036 | /** @def RTRCUINTPTR_MAX
|
---|
1037 | * The maximum value a RTRCUINPTR can have.
|
---|
1038 | */
|
---|
1039 | #define RTRCUINTPTR_MAX ((RTRCUINTPTR)UINT32_MAX)
|
---|
1040 |
|
---|
1041 | /** Raw mode context pointer, signed integer variant. */
|
---|
1042 | typedef uint32_t RTRCUINTPTR;
|
---|
1043 | /** @def RTRCINTPTR_MIN
|
---|
1044 | * The minimum value a RTRCINPTR can have.
|
---|
1045 | */
|
---|
1046 | #define RTRCINTPTR_MIN ((RTRCINTPTR)INT32_MIN)
|
---|
1047 | /** @def RTRCINTPTR_MAX
|
---|
1048 | * The maximum value a RTRCINPTR can have.
|
---|
1049 | */
|
---|
1050 | #define RTRCINTPTR_MAX ((RTRCINTPTR)INT32_MAX)
|
---|
1051 |
|
---|
1052 | /** @} */
|
---|
1053 |
|
---|
1054 |
|
---|
1055 | /** @defgroup grp_rt_types_cc Current Context Basic Types
|
---|
1056 | * @ingroup grp_rt_types
|
---|
1057 | * @{
|
---|
1058 | */
|
---|
1059 |
|
---|
1060 | /** Current Context Physical Memory Address.*/
|
---|
1061 | #ifdef IN_RC
|
---|
1062 | typedef RTGCPHYS RTCCPHYS;
|
---|
1063 | #else
|
---|
1064 | typedef RTHCPHYS RTCCPHYS;
|
---|
1065 | #endif
|
---|
1066 | /** Pointer to Current Context Physical Memory Address. */
|
---|
1067 | typedef RTCCPHYS *PRTCCPHYS;
|
---|
1068 | /** Pointer to const Current Context Physical Memory Address. */
|
---|
1069 | typedef const RTCCPHYS *PCRTCCPHYS;
|
---|
1070 | /** @def NIL_RTCCPHYS
|
---|
1071 | * NIL CC Physical Address.
|
---|
1072 | * NIL_RTCCPHYS is used to signal an invalid physical address, similar
|
---|
1073 | * to the NULL pointer.
|
---|
1074 | */
|
---|
1075 | #ifdef IN_RC
|
---|
1076 | # define NIL_RTCCPHYS NIL_RTGCPHYS
|
---|
1077 | #else
|
---|
1078 | # define NIL_RTCCPHYS NIL_RTHCPHYS
|
---|
1079 | #endif
|
---|
1080 |
|
---|
1081 | /** Unsigned integer register in the current context. */
|
---|
1082 | #if ARCH_BITS == 32
|
---|
1083 | typedef uint32_t RTCCUINTREG;
|
---|
1084 | #elif ARCH_BITS == 64
|
---|
1085 | typedef uint64_t RTCCUINTREG;
|
---|
1086 | #else
|
---|
1087 | # error "Unsupported ARCH_BITS!"
|
---|
1088 | #endif
|
---|
1089 | /** Pointer to an unsigned integer register in the current context. */
|
---|
1090 | typedef RTCCUINTREG *PRTCCUINTREG;
|
---|
1091 | /** Pointer to a const unsigned integer register in the current context. */
|
---|
1092 | typedef RTCCUINTREG const *PCRTCCUINTREG;
|
---|
1093 |
|
---|
1094 | /** Signed integer register in the current context. */
|
---|
1095 | #if ARCH_BITS == 32
|
---|
1096 | typedef int32_t RTCCINTREG;
|
---|
1097 | #elif ARCH_BITS == 64
|
---|
1098 | typedef int64_t RTCCINTREG;
|
---|
1099 | #endif
|
---|
1100 | /** Pointer to a signed integer register in the current context. */
|
---|
1101 | typedef RTCCINTREG *PRTCCINTREG;
|
---|
1102 | /** Pointer to a const signed integer register in the current context. */
|
---|
1103 | typedef RTCCINTREG const *PCRTCCINTREG;
|
---|
1104 |
|
---|
1105 | /** @} */
|
---|
1106 |
|
---|
1107 |
|
---|
1108 | /** File handle. */
|
---|
1109 | typedef RTUINT RTFILE;
|
---|
1110 | /** Pointer to file handle. */
|
---|
1111 | typedef RTFILE *PRTFILE;
|
---|
1112 | /** Nil file handle. */
|
---|
1113 | #define NIL_RTFILE (~(RTFILE)0)
|
---|
1114 |
|
---|
1115 | /** Async I/O request handle. */
|
---|
1116 | typedef R3PTRTYPE(struct RTFILEAIOREQINTERNAL *) RTFILEAIOREQ;
|
---|
1117 | /** Pointer to a async I/O request handle. */
|
---|
1118 | typedef RTFILEAIOREQ *PRTFILEAIOREQ;
|
---|
1119 | /** Nil request handle. */
|
---|
1120 | #define NIL_RTFILEAIOREQ 0
|
---|
1121 |
|
---|
1122 | /** Async I/O completion context handle. */
|
---|
1123 | typedef R3PTRTYPE(struct RTFILEAIOCTXINTERNAL *) RTFILEAIOCTX;
|
---|
1124 | /** Pointer to a async I/O completion context handle. */
|
---|
1125 | typedef RTFILEAIOCTX *PRTFILEAIOCTX;
|
---|
1126 | /** Nil context handle. */
|
---|
1127 | #define NIL_RTFILEAIOCTX 0
|
---|
1128 |
|
---|
1129 | /** Loader module handle. */
|
---|
1130 | typedef R3PTRTYPE(struct RTLDRMODINTERNAL *) RTLDRMOD;
|
---|
1131 | /** Pointer to a loader module handle. */
|
---|
1132 | typedef RTLDRMOD *PRTLDRMOD;
|
---|
1133 | /** Nil loader module handle. */
|
---|
1134 | #define NIL_RTLDRMOD 0
|
---|
1135 |
|
---|
1136 | /** Lock validator class handle. */
|
---|
1137 | typedef R3R0PTRTYPE(struct RTLOCKVALCLASSINT *) RTLOCKVALCLASS;
|
---|
1138 | /** Pointer to a lock validator class handle. */
|
---|
1139 | typedef RTLOCKVALCLASS *PRTLOCKVALCLASS;
|
---|
1140 | /** Nil lock validator class handle. */
|
---|
1141 | #define NIL_RTLOCKVALCLASS ((RTLOCKVALCLASS)0)
|
---|
1142 |
|
---|
1143 | /** Ring-0 memory object handle. */
|
---|
1144 | typedef R0PTRTYPE(struct RTR0MEMOBJINTERNAL *) RTR0MEMOBJ;
|
---|
1145 | /** Pointer to a Ring-0 memory object handle. */
|
---|
1146 | typedef RTR0MEMOBJ *PRTR0MEMOBJ;
|
---|
1147 | /** Nil ring-0 memory object handle. */
|
---|
1148 | #define NIL_RTR0MEMOBJ 0
|
---|
1149 |
|
---|
1150 | /** Native thread handle. */
|
---|
1151 | typedef RTHCUINTPTR RTNATIVETHREAD;
|
---|
1152 | /** Pointer to an native thread handle. */
|
---|
1153 | typedef RTNATIVETHREAD *PRTNATIVETHREAD;
|
---|
1154 | /** Nil native thread handle. */
|
---|
1155 | #define NIL_RTNATIVETHREAD (~(RTNATIVETHREAD)0)
|
---|
1156 |
|
---|
1157 | /** Process identifier. */
|
---|
1158 | typedef uint32_t RTPROCESS;
|
---|
1159 | /** Pointer to a process identifier. */
|
---|
1160 | typedef RTPROCESS *PRTPROCESS;
|
---|
1161 | /** Nil process identifier. */
|
---|
1162 | #define NIL_RTPROCESS (~(RTPROCESS)0)
|
---|
1163 |
|
---|
1164 | /** Process ring-0 handle. */
|
---|
1165 | typedef RTR0UINTPTR RTR0PROCESS;
|
---|
1166 | /** Pointer to a ring-0 process handle. */
|
---|
1167 | typedef RTR0PROCESS *PRTR0PROCESS;
|
---|
1168 | /** Nil ring-0 process handle. */
|
---|
1169 | #define NIL_RTR0PROCESS (~(RTR0PROCESS)0)
|
---|
1170 |
|
---|
1171 | /** @typedef RTSEMEVENT
|
---|
1172 | * Event Semaphore handle. */
|
---|
1173 | typedef R3R0PTRTYPE(struct RTSEMEVENTINTERNAL *) RTSEMEVENT;
|
---|
1174 | /** Pointer to an event semaphore handle. */
|
---|
1175 | typedef RTSEMEVENT *PRTSEMEVENT;
|
---|
1176 | /** Nil event semaphore handle. */
|
---|
1177 | #define NIL_RTSEMEVENT 0
|
---|
1178 |
|
---|
1179 | /** @typedef RTSEMEVENTMULTI
|
---|
1180 | * Event Multiple Release Semaphore handle. */
|
---|
1181 | typedef R3R0PTRTYPE(struct RTSEMEVENTMULTIINTERNAL *) RTSEMEVENTMULTI;
|
---|
1182 | /** Pointer to an event multiple release semaphore handle. */
|
---|
1183 | typedef RTSEMEVENTMULTI *PRTSEMEVENTMULTI;
|
---|
1184 | /** Nil multiple release event semaphore handle. */
|
---|
1185 | #define NIL_RTSEMEVENTMULTI 0
|
---|
1186 |
|
---|
1187 | /** @typedef RTSEMFASTMUTEX
|
---|
1188 | * Fast mutex Semaphore handle. */
|
---|
1189 | typedef R3R0PTRTYPE(struct RTSEMFASTMUTEXINTERNAL *) RTSEMFASTMUTEX;
|
---|
1190 | /** Pointer to a fast mutex semaphore handle. */
|
---|
1191 | typedef RTSEMFASTMUTEX *PRTSEMFASTMUTEX;
|
---|
1192 | /** Nil fast mutex semaphore handle. */
|
---|
1193 | #define NIL_RTSEMFASTMUTEX 0
|
---|
1194 |
|
---|
1195 | /** @typedef RTSEMMUTEX
|
---|
1196 | * Mutex Semaphore handle. */
|
---|
1197 | typedef R3R0PTRTYPE(struct RTSEMMUTEXINTERNAL *) RTSEMMUTEX;
|
---|
1198 | /** Pointer to a mutex semaphore handle. */
|
---|
1199 | typedef RTSEMMUTEX *PRTSEMMUTEX;
|
---|
1200 | /** Nil mutex semaphore handle. */
|
---|
1201 | #define NIL_RTSEMMUTEX 0
|
---|
1202 |
|
---|
1203 | /** @typedef RTSEMSPINMUTEX
|
---|
1204 | * Spinning mutex Semaphore handle. */
|
---|
1205 | typedef R3R0PTRTYPE(struct RTSEMSPINMUTEXINTERNAL *) RTSEMSPINMUTEX;
|
---|
1206 | /** Pointer to a spinning mutex semaphore handle. */
|
---|
1207 | typedef RTSEMSPINMUTEX *PRTSEMSPINMUTEX;
|
---|
1208 | /** Nil spinning mutex semaphore handle. */
|
---|
1209 | #define NIL_RTSEMSPINMUTEX 0
|
---|
1210 |
|
---|
1211 | /** @typedef RTSEMRW
|
---|
1212 | * Read/Write Semaphore handle. */
|
---|
1213 | typedef R3R0PTRTYPE(struct RTSEMRWINTERNAL *) RTSEMRW;
|
---|
1214 | /** Pointer to a read/write semaphore handle. */
|
---|
1215 | typedef RTSEMRW *PRTSEMRW;
|
---|
1216 | /** Nil read/write semaphore handle. */
|
---|
1217 | #define NIL_RTSEMRW 0
|
---|
1218 |
|
---|
1219 | /** @typedef RTSEMXROADS
|
---|
1220 | * Crossroads semaphore handle. */
|
---|
1221 | typedef R3R0PTRTYPE(struct RTSEMXROADSINTERNAL *) RTSEMXROADS;
|
---|
1222 | /** Pointer to a crossroads semaphore handle. */
|
---|
1223 | typedef RTSEMXROADS *PRTSEMXROADS;
|
---|
1224 | /** Nil crossroads semaphore handle. */
|
---|
1225 | #define NIL_RTSEMXROADS ((RTSEMXROADS)0)
|
---|
1226 |
|
---|
1227 | /** Spinlock handle. */
|
---|
1228 | typedef R3R0PTRTYPE(struct RTSPINLOCKINTERNAL *) RTSPINLOCK;
|
---|
1229 | /** Pointer to a spinlock handle. */
|
---|
1230 | typedef RTSPINLOCK *PRTSPINLOCK;
|
---|
1231 | /** Nil spinlock handle. */
|
---|
1232 | #define NIL_RTSPINLOCK 0
|
---|
1233 |
|
---|
1234 | /** Socket handle. */
|
---|
1235 | typedef int RTSOCKET;
|
---|
1236 | /** Pointer to socket handle. */
|
---|
1237 | typedef RTSOCKET *PRTSOCKET;
|
---|
1238 | /** Nil socket handle. */
|
---|
1239 | #define NIL_RTSOCKET (~(RTSOCKET)0)
|
---|
1240 |
|
---|
1241 | /** Thread handle.*/
|
---|
1242 | typedef R3R0PTRTYPE(struct RTTHREADINT *) RTTHREAD;
|
---|
1243 | /** Pointer to thread handle. */
|
---|
1244 | typedef RTTHREAD *PRTTHREAD;
|
---|
1245 | /** Nil thread handle. */
|
---|
1246 | #define NIL_RTTHREAD 0
|
---|
1247 |
|
---|
1248 | /** A TLS index. */
|
---|
1249 | typedef RTHCINTPTR RTTLS;
|
---|
1250 | /** Pointer to a TLS index. */
|
---|
1251 | typedef RTTLS *PRTTLS;
|
---|
1252 | /** Pointer to a const TLS index. */
|
---|
1253 | typedef RTTLS const *PCRTTLS;
|
---|
1254 | /** NIL TLS index value. */
|
---|
1255 | #define NIL_RTTLS ((RTTLS)-1)
|
---|
1256 |
|
---|
1257 | /** Handle to a simple heap. */
|
---|
1258 | typedef R3R0PTRTYPE(struct RTHEAPSIMPLEINTERNAL *) RTHEAPSIMPLE;
|
---|
1259 | /** Pointer to a handle to a simple heap. */
|
---|
1260 | typedef RTHEAPSIMPLE *PRTHEAPSIMPLE;
|
---|
1261 | /** NIL simple heap handle. */
|
---|
1262 | #define NIL_RTHEAPSIMPLE ((RTHEAPSIMPLE)0)
|
---|
1263 |
|
---|
1264 | /** Handle to a offset based heap. */
|
---|
1265 | typedef R3R0PTRTYPE(struct RTHEAPOFFSETINTERNAL *) RTHEAPOFFSET;
|
---|
1266 | /** Pointer to a handle to a offset based heap. */
|
---|
1267 | typedef RTHEAPOFFSET *PRTHEAPOFFSET;
|
---|
1268 | /** NIL offset based heap handle. */
|
---|
1269 | #define NIL_RTHEAPOFFSET ((RTHEAPOFFSET)0)
|
---|
1270 |
|
---|
1271 | /** Handle to an environment block. */
|
---|
1272 | typedef R3PTRTYPE(struct RTENVINTERNAL *) RTENV;
|
---|
1273 | /** Pointer to a handle to an environment block. */
|
---|
1274 | typedef RTENV *PRTENV;
|
---|
1275 | /** NIL simple heap handle. */
|
---|
1276 | #define NIL_RTENV ((RTENV)0)
|
---|
1277 |
|
---|
1278 | /** A CPU identifier.
|
---|
1279 | * @remarks This doesn't have to correspond to the APIC ID (intel/amd). Nor
|
---|
1280 | * does it have to correspond to the bits in the affinity mask, at
|
---|
1281 | * least not until we've sorted out Windows NT. */
|
---|
1282 | typedef uint32_t RTCPUID;
|
---|
1283 | /** Pointer to a CPU identifier. */
|
---|
1284 | typedef RTCPUID *PRTCPUID;
|
---|
1285 | /** Pointer to a const CPU identifier. */
|
---|
1286 | typedef RTCPUID const *PCRTCPUID;
|
---|
1287 | /** Nil CPU Id. */
|
---|
1288 | #define NIL_RTCPUID ((RTCPUID)~0)
|
---|
1289 |
|
---|
1290 | /** A CPU set.
|
---|
1291 | * Treat this as an opaque type and always use RTCpuSet* for manupulating it.
|
---|
1292 | * @remarks Subject to change. */
|
---|
1293 | typedef uint64_t RTCPUSET;
|
---|
1294 | /** Pointer to a CPU set. */
|
---|
1295 | typedef RTCPUSET *PRTCPUSET;
|
---|
1296 | /** Pointer to a const CPU set. */
|
---|
1297 | typedef RTCPUSET const *PCRTCPUSET;
|
---|
1298 |
|
---|
1299 | /** A handle table handle. */
|
---|
1300 | typedef R3R0PTRTYPE(struct RTHANDLETABLEINT *) RTHANDLETABLE;
|
---|
1301 | /** A pointer to a handle table handle. */
|
---|
1302 | typedef RTHANDLETABLE *PRTHANDLETABLE;
|
---|
1303 | /** @def NIL_RTHANDLETABLE
|
---|
1304 | * NIL handle table handle. */
|
---|
1305 | #define NIL_RTHANDLETABLE ((RTHANDLETABLE)0)
|
---|
1306 |
|
---|
1307 | /** A handle to a low resolution timer. */
|
---|
1308 | typedef R3R0PTRTYPE(struct RTTIMERLRINT *) RTTIMERLR;
|
---|
1309 | /** A pointer to a low resolution timer handle. */
|
---|
1310 | typedef RTTIMERLR *PRTTIMERLR;
|
---|
1311 | /** @def NIL_RTTIMERLR
|
---|
1312 | * NIL low resolution timer handle value. */
|
---|
1313 | #define NIL_RTTIMERLR ((RTTIMERLR)0)
|
---|
1314 |
|
---|
1315 | /** Handle to a random number generator. */
|
---|
1316 | typedef R3R0PTRTYPE(struct RTRANDINT *) RTRAND;
|
---|
1317 | /** Pointer to a random number generator handle. */
|
---|
1318 | typedef RTRAND *PRTRAND;
|
---|
1319 | /** NIL random number genrator handle value. */
|
---|
1320 | #define NIL_RTRAND ((RTRAND)0)
|
---|
1321 |
|
---|
1322 | /** Debug address space handle. */
|
---|
1323 | typedef R3R0PTRTYPE(struct RTDBGASINT *) RTDBGAS;
|
---|
1324 | /** Pointer to a debug address space handle. */
|
---|
1325 | typedef RTDBGAS *PRTDBGAS;
|
---|
1326 | /** NIL debug address space handle. */
|
---|
1327 | #define NIL_RTDBGAS ((RTDBGAS)0)
|
---|
1328 |
|
---|
1329 | /** Debug module handle. */
|
---|
1330 | typedef R3R0PTRTYPE(struct RTDBGMODINT *) RTDBGMOD;
|
---|
1331 | /** Pointer to a debug module handle. */
|
---|
1332 | typedef RTDBGMOD *PRTDBGMOD;
|
---|
1333 | /** NIL debug module handle. */
|
---|
1334 | #define NIL_RTDBGMOD ((RTDBGMOD)0)
|
---|
1335 |
|
---|
1336 | /** Memory pool handle. */
|
---|
1337 | typedef R3R0PTRTYPE(struct RTMEMPOOLINT *) RTMEMPOOL;
|
---|
1338 | /** Pointer to a memory pool handle. */
|
---|
1339 | typedef RTMEMPOOL *PRTMEMPOOL;
|
---|
1340 | /** NIL memory pool handle. */
|
---|
1341 | #define NIL_RTMEMPOOL ((RTMEMPOOL)0)
|
---|
1342 | /** The default memory pool handle. */
|
---|
1343 | #define RTMEMPOOL_DEFAULT ((RTMEMPOOL)-2)
|
---|
1344 |
|
---|
1345 | /** String cache handle. */
|
---|
1346 | typedef R3R0PTRTYPE(struct RTSTRCACHEINT *) RTSTRCACHE;
|
---|
1347 | /** Pointer to a string cache handle. */
|
---|
1348 | typedef RTSTRCACHE *PRTSTRCACHE;
|
---|
1349 | /** NIL string cache handle. */
|
---|
1350 | #define NIL_RTSTRCACHE ((RTSTRCACHE)0)
|
---|
1351 | /** The default string cache handle. */
|
---|
1352 | #define RTSTRCACHE_DEFAULT ((RTSTRCACHE)-2)
|
---|
1353 |
|
---|
1354 |
|
---|
1355 | /**
|
---|
1356 | * UUID data type.
|
---|
1357 | *
|
---|
1358 | * @note IPRT defines that the first three integers in the @c Gen struct
|
---|
1359 | * interpretation are in little endian representation. This is different to
|
---|
1360 | * many other UUID implementation, and requires conversion if you need to
|
---|
1361 | * achieve consistent results.
|
---|
1362 | */
|
---|
1363 | typedef union RTUUID
|
---|
1364 | {
|
---|
1365 | /** 8-bit view. */
|
---|
1366 | uint8_t au8[16];
|
---|
1367 | /** 16-bit view. */
|
---|
1368 | uint16_t au16[8];
|
---|
1369 | /** 32-bit view. */
|
---|
1370 | uint32_t au32[4];
|
---|
1371 | /** 64-bit view. */
|
---|
1372 | uint64_t au64[2];
|
---|
1373 | /** The way the UUID is declared by the DCE specification. */
|
---|
1374 | struct
|
---|
1375 | {
|
---|
1376 | uint32_t u32TimeLow;
|
---|
1377 | uint16_t u16TimeMid;
|
---|
1378 | uint16_t u16TimeHiAndVersion;
|
---|
1379 | uint8_t u8ClockSeqHiAndReserved;
|
---|
1380 | uint8_t u8ClockSeqLow;
|
---|
1381 | uint8_t au8Node[6];
|
---|
1382 | } Gen;
|
---|
1383 | } RTUUID;
|
---|
1384 | /** Pointer to UUID data. */
|
---|
1385 | typedef RTUUID *PRTUUID;
|
---|
1386 | /** Pointer to readonly UUID data. */
|
---|
1387 | typedef const RTUUID *PCRTUUID;
|
---|
1388 |
|
---|
1389 | /**
|
---|
1390 | * UUID string maximum length.
|
---|
1391 | */
|
---|
1392 | #define RTUUID_STR_LENGTH 37
|
---|
1393 |
|
---|
1394 |
|
---|
1395 | /** Compression handle. */
|
---|
1396 | typedef struct RTZIPCOMP *PRTZIPCOMP;
|
---|
1397 |
|
---|
1398 | /** Decompressor handle. */
|
---|
1399 | typedef struct RTZIPDECOMP *PRTZIPDECOMP;
|
---|
1400 |
|
---|
1401 |
|
---|
1402 | /**
|
---|
1403 | * Unicode Code Point.
|
---|
1404 | */
|
---|
1405 | typedef uint32_t RTUNICP;
|
---|
1406 | /** Pointer to an Unicode Code Point. */
|
---|
1407 | typedef RTUNICP *PRTUNICP;
|
---|
1408 | /** Pointer to an Unicode Code Point. */
|
---|
1409 | typedef const RTUNICP *PCRTUNICP;
|
---|
1410 |
|
---|
1411 |
|
---|
1412 | /**
|
---|
1413 | * UTF-16 character.
|
---|
1414 | * @remark wchar_t is not usable since it's compiler defined.
|
---|
1415 | * @remark When we use the term character we're not talking about unicode code point, but
|
---|
1416 | * the basic unit of the string encoding. Thus cwc - count of wide chars - means
|
---|
1417 | * count of RTUTF16; cuc - count of unicode chars - means count of RTUNICP;
|
---|
1418 | * and cch means count of the typedef 'char', which is assumed to be an octet.
|
---|
1419 | */
|
---|
1420 | typedef uint16_t RTUTF16;
|
---|
1421 | /** Pointer to a UTF-16 character. */
|
---|
1422 | typedef RTUTF16 *PRTUTF16;
|
---|
1423 | /** Pointer to a const UTF-16 character. */
|
---|
1424 | typedef const RTUTF16 *PCRTUTF16;
|
---|
1425 |
|
---|
1426 |
|
---|
1427 | /**
|
---|
1428 | * Wait for ever if we have to.
|
---|
1429 | */
|
---|
1430 | #define RT_INDEFINITE_WAIT (~0U)
|
---|
1431 |
|
---|
1432 |
|
---|
1433 | /**
|
---|
1434 | * Generic process callback.
|
---|
1435 | *
|
---|
1436 | * @returns VBox status code. Failure will cancel the operation.
|
---|
1437 | * @param uPercentage The percentage of the operation which has been completed.
|
---|
1438 | * @param pvUser The user specified argument.
|
---|
1439 | */
|
---|
1440 | typedef DECLCALLBACK(int) FNRTPROGRESS(unsigned uPrecentage, void *pvUser);
|
---|
1441 | /** Pointer to a generic progress callback function, FNRTPROCESS(). */
|
---|
1442 | typedef FNRTPROGRESS *PFNRTPROGRESS;
|
---|
1443 |
|
---|
1444 |
|
---|
1445 | /**
|
---|
1446 | * Rectangle data type.
|
---|
1447 | */
|
---|
1448 | typedef struct RTRECT
|
---|
1449 | {
|
---|
1450 | /** left X coordinate. */
|
---|
1451 | int32_t xLeft;
|
---|
1452 | /** top Y coordinate. */
|
---|
1453 | int32_t yTop;
|
---|
1454 | /** right X coordinate. (exclusive) */
|
---|
1455 | int32_t xRight;
|
---|
1456 | /** bottom Y coordinate. (exclusive) */
|
---|
1457 | int32_t yBottom;
|
---|
1458 | } RTRECT;
|
---|
1459 | /** Pointer to a rectangle. */
|
---|
1460 | typedef RTRECT *PRTRECT;
|
---|
1461 | /** Pointer to a const rectangle. */
|
---|
1462 | typedef const RTRECT *PCRTRECT;
|
---|
1463 |
|
---|
1464 |
|
---|
1465 | /**
|
---|
1466 | * Ethernet MAC address.
|
---|
1467 | *
|
---|
1468 | * The first 24 bits make up the Organisationally Unique Identifier (OUI),
|
---|
1469 | * where the first bit (little endian) indicates multicast (set) / unicast,
|
---|
1470 | * and the second bit indicates locally (set) / global administered. If all
|
---|
1471 | * bits are set, it's a broadcast.
|
---|
1472 | */
|
---|
1473 | typedef union RTMAC
|
---|
1474 | {
|
---|
1475 | /** @todo add a bitfield view of this stuff. */
|
---|
1476 | /** 8-bit view. */
|
---|
1477 | uint8_t au8[6];
|
---|
1478 | /** 16-bit view. */
|
---|
1479 | uint16_t au16[3];
|
---|
1480 | } RTMAC;
|
---|
1481 | /** Pointer to a MAC address. */
|
---|
1482 | typedef RTMAC *PRTMAC;
|
---|
1483 | /** Pointer to a readonly MAC address. */
|
---|
1484 | typedef const RTMAC *PCRTMAC;
|
---|
1485 |
|
---|
1486 |
|
---|
1487 | /** Pointer to a lock validator record.
|
---|
1488 | * The structure definition is found in iprt/lockvalidator.h. */
|
---|
1489 | typedef struct RTLOCKVALRECEXCL *PRTLOCKVALRECEXCL;
|
---|
1490 | /** Pointer to a lock validator source poisition.
|
---|
1491 | * The structure definition is found in iprt/lockvalidator.h. */
|
---|
1492 | typedef struct RTLOCKVALSRCPOS *PRTLOCKVALSRCPOS;
|
---|
1493 | /** Pointer to a const lock validator source poisition.
|
---|
1494 | * The structure definition is found in iprt/lockvalidator.h. */
|
---|
1495 | typedef struct RTLOCKVALSRCPOS const *PCRTLOCKVALSRCPOS;
|
---|
1496 |
|
---|
1497 | /** @name Special sub-class values.
|
---|
1498 | * The range 16..UINT32_MAX is available to the user, the range 0..15 is
|
---|
1499 | * reserved for the lock validator. In the user range the locks can only be
|
---|
1500 | * taking in ascending order.
|
---|
1501 | * @{ */
|
---|
1502 | /** Invalid value. */
|
---|
1503 | #define RTLOCKVAL_SUB_CLASS_INVALID UINT32_C(0)
|
---|
1504 | /** Not allowed to be taken with any other locks in the same class.
|
---|
1505 | * This is the recommended value. */
|
---|
1506 | #define RTLOCKVAL_SUB_CLASS_NONE UINT32_C(1)
|
---|
1507 | /** Any order is allowed within the class. */
|
---|
1508 | #define RTLOCKVAL_SUB_CLASS_ANY UINT32_C(2)
|
---|
1509 | /** The first user value. */
|
---|
1510 | #define RTLOCKVAL_SUB_CLASS_USER UINT32_C(16)
|
---|
1511 | /** @} */
|
---|
1512 |
|
---|
1513 |
|
---|
1514 | #ifdef __cplusplus
|
---|
1515 | /**
|
---|
1516 | * Strict type validation helper class.
|
---|
1517 | *
|
---|
1518 | * See RTErrStrictType and RT_SUCCESS_NP.
|
---|
1519 | */
|
---|
1520 | class RTErrStrictType2
|
---|
1521 | {
|
---|
1522 | protected:
|
---|
1523 | /** The status code. */
|
---|
1524 | int32_t m_rc;
|
---|
1525 |
|
---|
1526 | public:
|
---|
1527 | /**
|
---|
1528 | * Constructor.
|
---|
1529 | * @param rc IPRT style status code.
|
---|
1530 | */
|
---|
1531 | RTErrStrictType2(int32_t rc) : m_rc(rc)
|
---|
1532 | {
|
---|
1533 | }
|
---|
1534 |
|
---|
1535 | /**
|
---|
1536 | * Get the status code.
|
---|
1537 | * @returns IPRT style status code.
|
---|
1538 | */
|
---|
1539 | int32_t getValue() const
|
---|
1540 | {
|
---|
1541 | return m_rc;
|
---|
1542 | }
|
---|
1543 | };
|
---|
1544 | #endif /* __cplusplus */
|
---|
1545 | /** @} */
|
---|
1546 |
|
---|
1547 | #endif
|
---|
1548 |
|
---|