1 | /** @file
|
---|
2 | * innotek Portable Runtime - Types.
|
---|
3 | */
|
---|
4 |
|
---|
5 | /*
|
---|
6 | * Copyright (C) 2006-2007 innotek GmbH
|
---|
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 |
|
---|
32 | /*
|
---|
33 | * Include standard C types.
|
---|
34 | */
|
---|
35 | #ifndef IPRT_NO_CRT
|
---|
36 |
|
---|
37 | # if defined(RT_OS_DARWIN) && defined(KERNEL)
|
---|
38 | /*
|
---|
39 | * Kludge for the darwin kernel:
|
---|
40 | * stddef.h is missing IIRC.
|
---|
41 | */
|
---|
42 | # ifndef _PTRDIFF_T
|
---|
43 | # define _PTRDIFF_T
|
---|
44 | typedef __darwin_ptrdiff_t ptrdiff_t;
|
---|
45 | # endif
|
---|
46 | # include <sys/types.h>
|
---|
47 |
|
---|
48 | # elif defined(RT_OS_FREEBSD) && defined(_KERNEL)
|
---|
49 | /*
|
---|
50 | * Kludge for the FreeBSD kernel:
|
---|
51 | * stddef.h and sys/types.h has sligtly different offsetof definitions
|
---|
52 | * when compiling in kernel mode. This is just to make GCC keep shut.
|
---|
53 | */
|
---|
54 | # ifndef _STDDEF_H_
|
---|
55 | # undef offsetof
|
---|
56 | # endif
|
---|
57 | # include <stddef.h>
|
---|
58 | # ifndef _SYS_TYPES_H_
|
---|
59 | # undef offsetof
|
---|
60 | # endif
|
---|
61 | # include <sys/types.h>
|
---|
62 | # ifndef offsetof
|
---|
63 | # error "offsetof is not defined..."
|
---|
64 | # endif
|
---|
65 |
|
---|
66 | # elif defined(RT_OS_LINUX) && defined(__KERNEL__)
|
---|
67 | /*
|
---|
68 | * Kludge for the linux kernel:
|
---|
69 | * 1. sys/types.h doesn't mix with the kernel.
|
---|
70 | * 2. Starting with 2.6.19, linux/types.h typedefs bool and linux/stddef.h
|
---|
71 | * declares false and true as enum values.
|
---|
72 | * 3. Starting with 2.6.24, linux/types.h typedefs uintptr_t.
|
---|
73 | * We work around these issues here and nowhere else.
|
---|
74 | */
|
---|
75 | # include <stddef.h>
|
---|
76 | # if defined(__cplusplus)
|
---|
77 | typedef bool _Bool;
|
---|
78 | # endif
|
---|
79 | # define bool linux_bool
|
---|
80 | # define true linux_true
|
---|
81 | # define false linux_false
|
---|
82 | # define uintptr_t linux_uintptr_t
|
---|
83 | # include <linux/autoconf.h>
|
---|
84 | # include <linux/types.h>
|
---|
85 | # include <linux/stddef.h>
|
---|
86 | # undef uintptr_t
|
---|
87 | # undef false
|
---|
88 | # undef true
|
---|
89 | # undef bool
|
---|
90 |
|
---|
91 | # else
|
---|
92 | # include <stddef.h>
|
---|
93 | # include <sys/types.h>
|
---|
94 | # endif
|
---|
95 |
|
---|
96 | /* Define any types missing from sys/types.h on windows. */
|
---|
97 | # ifdef _MSC_VER
|
---|
98 | # undef ssize_t
|
---|
99 | typedef intptr_t ssize_t;
|
---|
100 | # endif
|
---|
101 |
|
---|
102 | #else /* no crt */
|
---|
103 | # include <iprt/nocrt/compiler/gcc.h>
|
---|
104 | #endif /* no crt */
|
---|
105 |
|
---|
106 |
|
---|
107 |
|
---|
108 | /** @defgroup grp_rt_types innotek Portable Runtime Base Types
|
---|
109 | * @{
|
---|
110 | */
|
---|
111 |
|
---|
112 | /* define wchar_t, we don't wanna include all the wcsstuff to get this. */
|
---|
113 | #ifdef _MSC_VER
|
---|
114 | # ifndef _WCHAR_T_DEFINED
|
---|
115 | typedef unsigned short wchar_t;
|
---|
116 | # define _WCHAR_T_DEFINED
|
---|
117 | # endif
|
---|
118 | #endif
|
---|
119 | #ifdef __GNUC__
|
---|
120 | /** @todo wchar_t on GNUC */
|
---|
121 | #endif
|
---|
122 |
|
---|
123 | /*
|
---|
124 | * C doesn't have bool.
|
---|
125 | */
|
---|
126 | #ifndef __cplusplus
|
---|
127 | # if defined(__GNUC__)
|
---|
128 | # if defined(RT_OS_LINUX) && __GNUC__ < 3
|
---|
129 | typedef uint8_t bool;
|
---|
130 | # else
|
---|
131 | # if defined(RT_OS_DARWIN) && defined(_STDBOOL_H)
|
---|
132 | # undef bool
|
---|
133 | # endif
|
---|
134 | typedef _Bool bool;
|
---|
135 | # endif
|
---|
136 | # else
|
---|
137 | typedef unsigned char bool;
|
---|
138 | # endif
|
---|
139 | # ifndef true
|
---|
140 | # define true (1)
|
---|
141 | # endif
|
---|
142 | # ifndef false
|
---|
143 | # define false (0)
|
---|
144 | # endif
|
---|
145 | #endif
|
---|
146 |
|
---|
147 | /**
|
---|
148 | * 128-bit unsigned integer.
|
---|
149 | */
|
---|
150 | #if defined(__GNUC__) && defined(RT_ARCH_AMD64)
|
---|
151 | typedef __uint128_t uint128_t;
|
---|
152 | #else
|
---|
153 | typedef struct uint128_s
|
---|
154 | {
|
---|
155 | uint64_t Lo;
|
---|
156 | uint64_t Hi;
|
---|
157 | } uint128_t;
|
---|
158 | #endif
|
---|
159 |
|
---|
160 |
|
---|
161 | /**
|
---|
162 | * 128-bit signed integer.
|
---|
163 | */
|
---|
164 | #if defined(__GNUC__) && defined(RT_ARCH_AMD64)
|
---|
165 | typedef __int128_t int128_t;
|
---|
166 | #else
|
---|
167 | typedef struct int128_s
|
---|
168 | {
|
---|
169 | uint64_t lo;
|
---|
170 | int64_t hi;
|
---|
171 | } int128_t;
|
---|
172 | #endif
|
---|
173 |
|
---|
174 |
|
---|
175 | /**
|
---|
176 | * 16-bit unsigned interger union.
|
---|
177 | */
|
---|
178 | typedef union RTUINT16U
|
---|
179 | {
|
---|
180 | /** natural view. */
|
---|
181 | uint16_t u;
|
---|
182 |
|
---|
183 | /** 16-bit view. */
|
---|
184 | uint16_t au16[1];
|
---|
185 | /** 8-bit view. */
|
---|
186 | uint8_t au8[4];
|
---|
187 | /** 16-bit hi/lo view. */
|
---|
188 | struct
|
---|
189 | {
|
---|
190 | uint16_t Lo;
|
---|
191 | uint16_t Hi;
|
---|
192 | } s;
|
---|
193 | } RTUINT16U;
|
---|
194 | /** Pointer to a 16-bit unsigned interger union. */
|
---|
195 | typedef RTUINT16U *PRTUINT16U;
|
---|
196 | /** Pointer to a const 32-bit unsigned interger union. */
|
---|
197 | typedef const RTUINT16U *PCRTUINT16U;
|
---|
198 |
|
---|
199 |
|
---|
200 | /**
|
---|
201 | * 32-bit unsigned interger union.
|
---|
202 | */
|
---|
203 | typedef union RTUINT32U
|
---|
204 | {
|
---|
205 | /** natural view. */
|
---|
206 | uint32_t u;
|
---|
207 | /** Hi/Low view. */
|
---|
208 | struct
|
---|
209 | {
|
---|
210 | uint16_t Lo;
|
---|
211 | uint16_t Hi;
|
---|
212 | } s;
|
---|
213 | /** Word view. */
|
---|
214 | struct
|
---|
215 | {
|
---|
216 | uint16_t w0;
|
---|
217 | uint16_t w1;
|
---|
218 | } Words;
|
---|
219 |
|
---|
220 | /** 32-bit view. */
|
---|
221 | uint32_t au32[1];
|
---|
222 | /** 16-bit view. */
|
---|
223 | uint16_t au16[2];
|
---|
224 | /** 8-bit view. */
|
---|
225 | uint8_t au8[4];
|
---|
226 | } RTUINT32U;
|
---|
227 | /** Pointer to a 32-bit unsigned interger union. */
|
---|
228 | typedef RTUINT32U *PRTUINT32U;
|
---|
229 | /** Pointer to a const 32-bit unsigned interger union. */
|
---|
230 | typedef const RTUINT32U *PCRTUINT32U;
|
---|
231 |
|
---|
232 |
|
---|
233 | /**
|
---|
234 | * 64-bit unsigned interger union.
|
---|
235 | */
|
---|
236 | typedef union RTUINT64U
|
---|
237 | {
|
---|
238 | /** Natural view. */
|
---|
239 | uint64_t u;
|
---|
240 | /** Hi/Low view. */
|
---|
241 | struct
|
---|
242 | {
|
---|
243 | uint32_t Lo;
|
---|
244 | uint32_t Hi;
|
---|
245 | } s;
|
---|
246 | /** Double-Word view. */
|
---|
247 | struct
|
---|
248 | {
|
---|
249 | uint32_t dw0;
|
---|
250 | uint32_t dw1;
|
---|
251 | } DWords;
|
---|
252 | /** Word view. */
|
---|
253 | struct
|
---|
254 | {
|
---|
255 | uint16_t w0;
|
---|
256 | uint16_t w1;
|
---|
257 | uint16_t w2;
|
---|
258 | uint16_t w3;
|
---|
259 | } Words;
|
---|
260 |
|
---|
261 | /** 64-bit view. */
|
---|
262 | uint64_t au64[1];
|
---|
263 | /** 32-bit view. */
|
---|
264 | uint32_t au32[2];
|
---|
265 | /** 16-bit view. */
|
---|
266 | uint16_t au16[4];
|
---|
267 | /** 8-bit view. */
|
---|
268 | uint8_t au8[8];
|
---|
269 | } RTUINT64U;
|
---|
270 | /** Pointer to a 64-bit unsigned interger union. */
|
---|
271 | typedef RTUINT64U *PRTUINT64U;
|
---|
272 | /** Pointer to a const 64-bit unsigned interger union. */
|
---|
273 | typedef const RTUINT64U *PCRTUINT64U;
|
---|
274 |
|
---|
275 |
|
---|
276 | /**
|
---|
277 | * 128-bit unsigned interger union.
|
---|
278 | */
|
---|
279 | typedef union RTUINT128U
|
---|
280 | {
|
---|
281 | /** Natural view.
|
---|
282 | * WARNING! This member depends on compiler supporing 128-bit stuff. */
|
---|
283 | uint128_t u;
|
---|
284 | /** Hi/Low view. */
|
---|
285 | struct
|
---|
286 | {
|
---|
287 | uint64_t Lo;
|
---|
288 | uint64_t Hi;
|
---|
289 | } s;
|
---|
290 | /** Quad-Word view. */
|
---|
291 | struct
|
---|
292 | {
|
---|
293 | uint64_t qw0;
|
---|
294 | uint64_t qw1;
|
---|
295 | } QWords;
|
---|
296 | /** Double-Word view. */
|
---|
297 | struct
|
---|
298 | {
|
---|
299 | uint32_t dw0;
|
---|
300 | uint32_t dw1;
|
---|
301 | uint32_t dw2;
|
---|
302 | uint32_t dw3;
|
---|
303 | } DWords;
|
---|
304 | /** Word view. */
|
---|
305 | struct
|
---|
306 | {
|
---|
307 | uint16_t w0;
|
---|
308 | uint16_t w1;
|
---|
309 | uint16_t w2;
|
---|
310 | uint16_t w3;
|
---|
311 | uint16_t w4;
|
---|
312 | uint16_t w5;
|
---|
313 | uint16_t w6;
|
---|
314 | uint16_t w7;
|
---|
315 | } Words;
|
---|
316 |
|
---|
317 | /** 64-bit view. */
|
---|
318 | uint64_t au64[2];
|
---|
319 | /** 32-bit view. */
|
---|
320 | uint32_t au32[4];
|
---|
321 | /** 16-bit view. */
|
---|
322 | uint16_t au16[8];
|
---|
323 | /** 8-bit view. */
|
---|
324 | uint8_t au8[16];
|
---|
325 | } RTUINT128U;
|
---|
326 | /** Pointer to a 64-bit unsigned interger union. */
|
---|
327 | typedef RTUINT128U *PRTUINT128U;
|
---|
328 | /** Pointer to a const 64-bit unsigned interger union. */
|
---|
329 | typedef const RTUINT128U *PCRTUINT128U;
|
---|
330 |
|
---|
331 |
|
---|
332 | /** Generic function type.
|
---|
333 | * @see PFNRT
|
---|
334 | */
|
---|
335 | typedef DECLCALLBACK(void) FNRT(void);
|
---|
336 |
|
---|
337 | /** Generic function pointer.
|
---|
338 | * With -pedantic, gcc-4 complains when casting a function to a data object, for example
|
---|
339 | *
|
---|
340 | * @code
|
---|
341 | * void foo(void)
|
---|
342 | * {
|
---|
343 | * }
|
---|
344 | *
|
---|
345 | * void *bar = (void *)foo;
|
---|
346 | * @endcode
|
---|
347 | *
|
---|
348 | * The compiler would warn with "ISO C++ forbids casting between pointer-to-function and
|
---|
349 | * pointer-to-object". The purpose of this warning is not to bother the programmer but to
|
---|
350 | * point out that he is probably doing something dangerous, assigning a pointer to executable
|
---|
351 | * code to a data object.
|
---|
352 | */
|
---|
353 | typedef FNRT *PFNRT;
|
---|
354 |
|
---|
355 |
|
---|
356 | /** @defgroup grp_rt_types_both Common Guest and Host Context Basic Types
|
---|
357 | * @ingroup grp_rt_types
|
---|
358 | * @{
|
---|
359 | */
|
---|
360 |
|
---|
361 | /** Signed integer which can contain both GC and HC pointers. */
|
---|
362 | #if (HC_ARCH_BITS == 32 && GC_ARCH_BITS == 32)
|
---|
363 | typedef int32_t RTINTPTR;
|
---|
364 | #elif (HC_ARCH_BITS == 64 || GC_ARCH_BITS == 64)
|
---|
365 | typedef int64_t RTINTPTR;
|
---|
366 | #else
|
---|
367 | # error Unsupported HC_ARCH_BITS and/or GC_ARCH_BITS values.
|
---|
368 | #endif
|
---|
369 | /** Pointer to signed integer which can contain both GC and HC pointers. */
|
---|
370 | typedef RTINTPTR *PRTINTPTR;
|
---|
371 | /** Pointer const to signed integer which can contain both GC and HC pointers. */
|
---|
372 | typedef const RTINTPTR *PCRTINTPTR;
|
---|
373 |
|
---|
374 | /** Unsigned integer which can contain both GC and HC pointers. */
|
---|
375 | #if (HC_ARCH_BITS == 32 && GC_ARCH_BITS == 32)
|
---|
376 | typedef uint32_t RTUINTPTR;
|
---|
377 | #elif (HC_ARCH_BITS == 64 || GC_ARCH_BITS == 64)
|
---|
378 | typedef uint64_t RTUINTPTR;
|
---|
379 | #else
|
---|
380 | # error Unsupported HC_ARCH_BITS and/or GC_ARCH_BITS values.
|
---|
381 | #endif
|
---|
382 | /** Pointer to unsigned integer which can contain both GC and HC pointers. */
|
---|
383 | typedef RTUINTPTR *PRTUINTPTR;
|
---|
384 | /** Pointer const to unsigned integer which can contain both GC and HC pointers. */
|
---|
385 | typedef const RTUINTPTR *PCRTUINTPTR;
|
---|
386 |
|
---|
387 | /** Signed integer. */
|
---|
388 | typedef int32_t RTINT;
|
---|
389 | /** Pointer to signed integer. */
|
---|
390 | typedef RTINT *PRTINT;
|
---|
391 | /** Pointer to const signed integer. */
|
---|
392 | typedef const RTINT *PCRTINT;
|
---|
393 |
|
---|
394 | /** Unsigned integer. */
|
---|
395 | typedef uint32_t RTUINT;
|
---|
396 | /** Pointer to unsigned integer. */
|
---|
397 | typedef RTUINT *PRTUINT;
|
---|
398 | /** Pointer to const unsigned integer. */
|
---|
399 | typedef const RTUINT *PCRTUINT;
|
---|
400 |
|
---|
401 | /** A file offset / size (off_t). */
|
---|
402 | typedef int64_t RTFOFF;
|
---|
403 | /** Pointer to a file offset / size. */
|
---|
404 | typedef RTFOFF *PRTFOFF;
|
---|
405 |
|
---|
406 | /** File mode (see iprt/fs.h). */
|
---|
407 | typedef uint32_t RTFMODE;
|
---|
408 | /** Pointer to file mode. */
|
---|
409 | typedef RTFMODE *PRTFMODE;
|
---|
410 |
|
---|
411 | /** Device unix number. */
|
---|
412 | typedef uint32_t RTDEV;
|
---|
413 | /** Pointer to a device unix number. */
|
---|
414 | typedef RTDEV *PRTDEV;
|
---|
415 |
|
---|
416 | /** i-node number. */
|
---|
417 | typedef uint64_t RTINODE;
|
---|
418 | /** Pointer to a i-node number. */
|
---|
419 | typedef RTINODE *PRTINODE;
|
---|
420 |
|
---|
421 | /** User id. */
|
---|
422 | typedef uint32_t RTUID;
|
---|
423 | /** Pointer to a user id. */
|
---|
424 | typedef RTUID *PRTUID;
|
---|
425 | /** NIL user id.
|
---|
426 | * @todo check this for portability! */
|
---|
427 | #define NIL_RTUID (~(RTUID)0);
|
---|
428 |
|
---|
429 | /** Group id. */
|
---|
430 | typedef uint32_t RTGID;
|
---|
431 | /** Pointer to a group id. */
|
---|
432 | typedef RTGID *PRTGID;
|
---|
433 | /** NIL group id.
|
---|
434 | * @todo check this for portability! */
|
---|
435 | #define NIL_RTGID (~(RTGID)0);
|
---|
436 |
|
---|
437 | /** I/O Port. */
|
---|
438 | typedef uint16_t RTIOPORT;
|
---|
439 | /** Pointer to I/O Port. */
|
---|
440 | typedef RTIOPORT *PRTIOPORT;
|
---|
441 | /** Pointer to const I/O Port. */
|
---|
442 | typedef const RTIOPORT *PCRTIOPORT;
|
---|
443 |
|
---|
444 | /** Selector. */
|
---|
445 | typedef uint16_t RTSEL;
|
---|
446 | /** Pointer to selector. */
|
---|
447 | typedef RTSEL *PRTSEL;
|
---|
448 | /** Pointer to const selector. */
|
---|
449 | typedef const RTSEL *PCRTSEL;
|
---|
450 |
|
---|
451 | /** Far 16-bit pointer. */
|
---|
452 | #pragma pack(1)
|
---|
453 | typedef struct RTFAR16
|
---|
454 | {
|
---|
455 | uint16_t off;
|
---|
456 | RTSEL sel;
|
---|
457 | } RTFAR16;
|
---|
458 | #pragma pack()
|
---|
459 | /** Pointer to Far 16-bit pointer. */
|
---|
460 | typedef RTFAR16 *PRTFAR16;
|
---|
461 | /** Pointer to const Far 16-bit pointer. */
|
---|
462 | typedef const RTFAR16 *PCRTFAR16;
|
---|
463 |
|
---|
464 | /** Far 32-bit pointer. */
|
---|
465 | #pragma pack(1)
|
---|
466 | typedef struct RTFAR32
|
---|
467 | {
|
---|
468 | uint32_t off;
|
---|
469 | RTSEL sel;
|
---|
470 | } RTFAR32;
|
---|
471 | #pragma pack()
|
---|
472 | /** Pointer to Far 32-bit pointer. */
|
---|
473 | typedef RTFAR32 *PRTFAR32;
|
---|
474 | /** Pointer to const Far 32-bit pointer. */
|
---|
475 | typedef const RTFAR32 *PCRTFAR32;
|
---|
476 |
|
---|
477 | /** Far 64-bit pointer. */
|
---|
478 | #pragma pack(1)
|
---|
479 | typedef struct RTFAR64
|
---|
480 | {
|
---|
481 | uint64_t off;
|
---|
482 | RTSEL sel;
|
---|
483 | } RTFAR64;
|
---|
484 | #pragma pack()
|
---|
485 | /** Pointer to Far 64-bit pointer. */
|
---|
486 | typedef RTFAR64 *PRTFAR64;
|
---|
487 | /** Pointer to const Far 64-bit pointer. */
|
---|
488 | typedef const RTFAR64 *PCRTFAR64;
|
---|
489 |
|
---|
490 | /** @} */
|
---|
491 |
|
---|
492 |
|
---|
493 | /** @defgroup grp_rt_types_hc Host Context Basic Types
|
---|
494 | * @ingroup grp_rt_types
|
---|
495 | * @{
|
---|
496 | */
|
---|
497 |
|
---|
498 | /** HC Natural signed integer. */
|
---|
499 | typedef int32_t RTHCINT;
|
---|
500 | /** Pointer to HC Natural signed integer. */
|
---|
501 | typedef RTHCINT *PRTHCINT;
|
---|
502 | /** Pointer to const HC Natural signed integer. */
|
---|
503 | typedef const RTHCINT *PCRTHCINT;
|
---|
504 |
|
---|
505 | /** HC Natural unsigned integer. */
|
---|
506 | typedef uint32_t RTHCUINT;
|
---|
507 | /** Pointer to HC Natural unsigned integer. */
|
---|
508 | typedef RTHCUINT *PRTHCUINT;
|
---|
509 | /** Pointer to const HC Natural unsigned integer. */
|
---|
510 | typedef const RTHCUINT *PCRTHCUINT;
|
---|
511 |
|
---|
512 |
|
---|
513 | /** Signed integer which can contain a HC pointer. */
|
---|
514 | #if HC_ARCH_BITS == 32
|
---|
515 | typedef int32_t RTHCINTPTR;
|
---|
516 | #elif HC_ARCH_BITS == 64
|
---|
517 | typedef int64_t RTHCINTPTR;
|
---|
518 | #else
|
---|
519 | # error Unsupported HC_ARCH_BITS value.
|
---|
520 | #endif
|
---|
521 | /** Pointer to signed interger which can contain a HC pointer. */
|
---|
522 | typedef RTHCINTPTR *PRTHCINTPTR;
|
---|
523 | /** Pointer to const signed interger which can contain a HC pointer. */
|
---|
524 | typedef const RTHCINTPTR *PCRTHCINTPTR;
|
---|
525 |
|
---|
526 | /** Signed integer which can contain a HC ring-3 pointer. */
|
---|
527 | #if R3_ARCH_BITS == 32
|
---|
528 | typedef int32_t RTR3INTPTR;
|
---|
529 | #elif R3_ARCH_BITS == 64
|
---|
530 | typedef int64_t RTR3INTPTR;
|
---|
531 | #else
|
---|
532 | # error Unsupported R3_ARCH_BITS value.
|
---|
533 | #endif
|
---|
534 | /** Pointer to signed interger which can contain a HC ring-3 pointer. */
|
---|
535 | typedef RTR3INTPTR *PRTR3INTPTR;
|
---|
536 | /** Pointer to const signed interger which can contain a HC ring-3 pointer. */
|
---|
537 | typedef const RTR3INTPTR *PCRTR3INTPTR;
|
---|
538 |
|
---|
539 | /** Signed integer which can contain a HC ring-0 pointer. */
|
---|
540 | #if R0_ARCH_BITS == 32
|
---|
541 | typedef int32_t RTR0INTPTR;
|
---|
542 | #elif R0_ARCH_BITS == 64
|
---|
543 | typedef int64_t RTR0INTPTR;
|
---|
544 | #else
|
---|
545 | # error Unsupported R0_ARCH_BITS value.
|
---|
546 | #endif
|
---|
547 | /** Pointer to signed interger which can contain a HC ring-0 pointer. */
|
---|
548 | typedef RTR0INTPTR *PRTR0INTPTR;
|
---|
549 | /** Pointer to const signed interger which can contain a HC ring-0 pointer. */
|
---|
550 | typedef const RTR0INTPTR *PCRTR0INTPTR;
|
---|
551 |
|
---|
552 |
|
---|
553 | /** Unsigned integer which can contain a HC pointer. */
|
---|
554 | #if HC_ARCH_BITS == 32
|
---|
555 | typedef uint32_t RTHCUINTPTR;
|
---|
556 | #elif HC_ARCH_BITS == 64
|
---|
557 | typedef uint64_t RTHCUINTPTR;
|
---|
558 | #else
|
---|
559 | # error Unsupported HC_ARCH_BITS value.
|
---|
560 | #endif
|
---|
561 | /** Pointer to unsigned interger which can contain a HC pointer. */
|
---|
562 | typedef RTHCUINTPTR *PRTHCUINTPTR;
|
---|
563 | /** Pointer to unsigned interger which can contain a HC pointer. */
|
---|
564 | typedef const RTHCUINTPTR *PCRTHCUINTPTR;
|
---|
565 |
|
---|
566 | /** Unsigned integer which can contain a HC ring-3 pointer. */
|
---|
567 | #if R3_ARCH_BITS == 32
|
---|
568 | typedef uint32_t RTR3UINTPTR;
|
---|
569 | #elif R3_ARCH_BITS == 64
|
---|
570 | typedef uint64_t RTR3UINTPTR;
|
---|
571 | #else
|
---|
572 | # error Unsupported R3_ARCH_BITS value.
|
---|
573 | #endif
|
---|
574 | /** Pointer to unsigned interger which can contain a HC ring-3 pointer. */
|
---|
575 | typedef RTR3UINTPTR *PRTR3UINTPTR;
|
---|
576 | /** Pointer to unsigned interger which can contain a HC ring-3 pointer. */
|
---|
577 | typedef const RTR3UINTPTR *PCRTR3UINTPTR;
|
---|
578 |
|
---|
579 | /** Unsigned integer which can contain a HC ring-0 pointer. */
|
---|
580 | #if R0_ARCH_BITS == 32
|
---|
581 | typedef uint32_t RTR0UINTPTR;
|
---|
582 | #elif R0_ARCH_BITS == 64
|
---|
583 | typedef uint64_t RTR0UINTPTR;
|
---|
584 | #else
|
---|
585 | # error Unsupported R0_ARCH_BITS value.
|
---|
586 | #endif
|
---|
587 | /** Pointer to unsigned interger which can contain a HC ring-0 pointer. */
|
---|
588 | typedef RTR0UINTPTR *PRTR0UINTPTR;
|
---|
589 | /** Pointer to unsigned interger which can contain a HC ring-0 pointer. */
|
---|
590 | typedef const RTR0UINTPTR *PCRTR0UINTPTR;
|
---|
591 |
|
---|
592 |
|
---|
593 | /** Host Physical Memory Address.
|
---|
594 | * @todo This should be configurable at compile time too...
|
---|
595 | */
|
---|
596 | typedef uint64_t RTHCPHYS;
|
---|
597 | /** Pointer to Host Physical Memory Address. */
|
---|
598 | typedef RTHCPHYS *PRTHCPHYS;
|
---|
599 | /** Pointer to const Host Physical Memory Address. */
|
---|
600 | typedef const RTHCPHYS *PCRTHCPHYS;
|
---|
601 | /** @def NIL_RTHCPHYS
|
---|
602 | * NIL HC Physical Address.
|
---|
603 | * NIL_RTHCPHYS is used to signal an invalid physical address, similar
|
---|
604 | * to the NULL pointer.
|
---|
605 | */
|
---|
606 | #define NIL_RTHCPHYS ((RTHCPHYS)~0U) /** @todo change this to (~(VBOXHCPHYS)0) */
|
---|
607 |
|
---|
608 |
|
---|
609 | /** HC pointer. */
|
---|
610 | #ifndef IN_GC
|
---|
611 | typedef void * RTHCPTR;
|
---|
612 | #else
|
---|
613 | typedef RTHCUINTPTR RTHCPTR;
|
---|
614 | #endif
|
---|
615 | /** Pointer to HC pointer. */
|
---|
616 | typedef RTHCPTR *PRTHCPTR;
|
---|
617 | /** Pointer to const HC pointer. */
|
---|
618 | typedef const RTHCPTR *PCRTHCPTR;
|
---|
619 | /** @def NIL_RTHCPTR
|
---|
620 | * NIL HC pointer.
|
---|
621 | */
|
---|
622 | #define NIL_RTHCPTR ((RTHCPTR)0)
|
---|
623 |
|
---|
624 | /** HC ring-3 pointer. */
|
---|
625 | #ifdef IN_RING3
|
---|
626 | typedef void * RTR3PTR;
|
---|
627 | #else
|
---|
628 | typedef RTR3UINTPTR RTR3PTR;
|
---|
629 | #endif
|
---|
630 | /** Pointer to HC ring-3 pointer. */
|
---|
631 | typedef RTR3PTR *PRTR3PTR;
|
---|
632 | /** Pointer to const HC ring-3 pointer. */
|
---|
633 | typedef const RTR3PTR *PCRTR3PTR;
|
---|
634 | /** @def NIL_RTR3PTR
|
---|
635 | * NIL HC ring-3 pointer.
|
---|
636 | */
|
---|
637 | #define NIL_RTR3PTR ((RTR3PTR)0)
|
---|
638 |
|
---|
639 | /** HC ring-0 pointer. */
|
---|
640 | #ifdef IN_RING0
|
---|
641 | typedef void * RTR0PTR;
|
---|
642 | #else
|
---|
643 | typedef RTR0UINTPTR RTR0PTR;
|
---|
644 | #endif
|
---|
645 | /** Pointer to HC ring-0 pointer. */
|
---|
646 | typedef RTR0PTR *PRTR0PTR;
|
---|
647 | /** Pointer to const HC ring-0 pointer. */
|
---|
648 | typedef const RTR0PTR *PCRTR0PTR;
|
---|
649 | /** @def NIL_RTR0PTR
|
---|
650 | * NIL HC ring-0 pointer.
|
---|
651 | */
|
---|
652 | #define NIL_RTR0PTR ((RTR0PTR)0)
|
---|
653 |
|
---|
654 |
|
---|
655 | /** Unsigned integer register in the host context. */
|
---|
656 | #if HC_ARCH_BITS == 32
|
---|
657 | typedef uint32_t RTHCUINTREG;
|
---|
658 | #elif HC_ARCH_BITS == 64
|
---|
659 | typedef uint64_t RTHCUINTREG;
|
---|
660 | #else
|
---|
661 | # error "Unsupported HC_ARCH_BITS!"
|
---|
662 | #endif
|
---|
663 | /** Pointer to an unsigned integer register in the host context. */
|
---|
664 | typedef RTHCUINTREG *PRTHCUINTREG;
|
---|
665 | /** Pointer to a const unsigned integer register in the host context. */
|
---|
666 | typedef const RTHCUINTREG *PCRTHCUINTREG;
|
---|
667 |
|
---|
668 | /** Unsigned integer register in the host ring-3 context. */
|
---|
669 | #if R3_ARCH_BITS == 32
|
---|
670 | typedef uint32_t RTR3UINTREG;
|
---|
671 | #elif R3_ARCH_BITS == 64
|
---|
672 | typedef uint64_t RTR3UINTREG;
|
---|
673 | #else
|
---|
674 | # error "Unsupported R3_ARCH_BITS!"
|
---|
675 | #endif
|
---|
676 | /** Pointer to an unsigned integer register in the host ring-3 context. */
|
---|
677 | typedef RTR3UINTREG *PRTR3UINTREG;
|
---|
678 | /** Pointer to a const unsigned integer register in the host ring-3 context. */
|
---|
679 | typedef const RTR3UINTREG *PCRTR3UINTREG;
|
---|
680 |
|
---|
681 | /** Unsigned integer register in the host ring-3 context. */
|
---|
682 | #if R0_ARCH_BITS == 32
|
---|
683 | typedef uint32_t RTR0UINTREG;
|
---|
684 | #elif R0_ARCH_BITS == 64
|
---|
685 | typedef uint64_t RTR0UINTREG;
|
---|
686 | #else
|
---|
687 | # error "Unsupported R3_ARCH_BITS!"
|
---|
688 | #endif
|
---|
689 | /** Pointer to an unsigned integer register in the host ring-3 context. */
|
---|
690 | typedef RTR0UINTREG *PRTR0UINTREG;
|
---|
691 | /** Pointer to a const unsigned integer register in the host ring-3 context. */
|
---|
692 | typedef const RTR0UINTREG *PCRTR0UINTREG;
|
---|
693 |
|
---|
694 | /** @} */
|
---|
695 |
|
---|
696 |
|
---|
697 | /** @defgroup grp_rt_types_gc Guest Context Basic Types
|
---|
698 | * @ingroup grp_rt_types
|
---|
699 | * @{
|
---|
700 | */
|
---|
701 |
|
---|
702 | /** Natural signed integer in the GC. */
|
---|
703 | typedef int32_t RTGCINT;
|
---|
704 | /** Pointer to natural signed interger in GC. */
|
---|
705 | typedef RTGCINT *PRTGCINT;
|
---|
706 | /** Pointer to const natural signed interger in GC. */
|
---|
707 | typedef const RTGCINT *PCRTGCINT;
|
---|
708 |
|
---|
709 | /** Natural signed uninteger in the GC. */
|
---|
710 | typedef uint32_t RTGCUINT;
|
---|
711 | /** Pointer to natural unsigned interger in GC. */
|
---|
712 | typedef RTGCUINT *PRTGCUINT;
|
---|
713 | /** Pointer to const natural unsigned interger in GC. */
|
---|
714 | typedef const RTGCUINT *PCRTGCUINT;
|
---|
715 |
|
---|
716 | /** Signed integer which can contain a GC pointer. */
|
---|
717 | #if GC_ARCH_BITS == 32
|
---|
718 | typedef int32_t RTGCINTPTR;
|
---|
719 | #elif GC_ARCH_BITS == 64
|
---|
720 | typedef int64_t RTGCINTPTR;
|
---|
721 | #else
|
---|
722 | # error Unsupported GC_ARCH_BITS value.
|
---|
723 | #endif
|
---|
724 | /** Pointer to signed interger which can contain a GC pointer. */
|
---|
725 | typedef RTGCINTPTR *PRTGCINTPTR;
|
---|
726 | /** Pointer to const signed interger which can contain a GC pointer. */
|
---|
727 | typedef const RTGCINTPTR *PCRTGCINTPTR;
|
---|
728 |
|
---|
729 | /** Unsigned integer which can contain a GC pointer. */
|
---|
730 | #if GC_ARCH_BITS == 32
|
---|
731 | typedef uint32_t RTGCUINTPTR;
|
---|
732 | #elif GC_ARCH_BITS == 64
|
---|
733 | typedef uint64_t RTGCUINTPTR;
|
---|
734 | #else
|
---|
735 | # error Unsupported GC_ARCH_BITS value.
|
---|
736 | #endif
|
---|
737 | /** Pointer to unsigned interger which can contain a GC pointer. */
|
---|
738 | typedef RTGCUINTPTR *PRTGCUINTPTR;
|
---|
739 | /** Pointer to unsigned interger which can contain a GC pointer. */
|
---|
740 | typedef const RTGCUINTPTR *PCRTGCUINTPTR;
|
---|
741 |
|
---|
742 | /** Guest Physical Memory Address.*/
|
---|
743 | typedef uint64_t RTGCPHYS;
|
---|
744 | /** Pointer to Guest Physical Memory Address. */
|
---|
745 | typedef RTGCPHYS *PRTGCPHYS;
|
---|
746 | /** Pointer to const Guest Physical Memory Address. */
|
---|
747 | typedef const RTGCPHYS *PCRTGCPHYS;
|
---|
748 | /** @def NIL_RTGCPHYS
|
---|
749 | * NIL GC Physical Address.
|
---|
750 | * NIL_RTGCPHYS is used to signal an invalid physical address, similar
|
---|
751 | * to the NULL pointer. Note that this value may actually be valid in
|
---|
752 | * some contexts.
|
---|
753 | */
|
---|
754 | #define NIL_RTGCPHYS (~(RTGCPHYS)0U)
|
---|
755 |
|
---|
756 |
|
---|
757 | /** Guest Physical Memory Address; limited to 32 bits.*/
|
---|
758 | typedef uint32_t RTGCPHYS32;
|
---|
759 | /** Pointer to Guest Physical Memory Address. */
|
---|
760 | typedef RTGCPHYS32 *PRTGCPHYS32;
|
---|
761 | /** Pointer to const Guest Physical Memory Address. */
|
---|
762 | typedef const RTGCPHYS32 *PCRTGCPHYS32;
|
---|
763 | /** @def NIL_RTGCPHYS32
|
---|
764 | * NIL GC Physical Address.
|
---|
765 | * NIL_RTGCPHYS32 is used to signal an invalid physical address, similar
|
---|
766 | * to the NULL pointer. Note that this value may actually be valid in
|
---|
767 | * some contexts.
|
---|
768 | */
|
---|
769 | #define NIL_RTGCPHYS32 (~(RTGCPHYS32)0)
|
---|
770 |
|
---|
771 |
|
---|
772 | /** Guest Physical Memory Address; limited to 64 bits.*/
|
---|
773 | typedef uint64_t RTGCPHYS64;
|
---|
774 | /** Pointer to Guest Physical Memory Address. */
|
---|
775 | typedef RTGCPHYS64 *PRTGCPHYS64;
|
---|
776 | /** Pointer to const Guest Physical Memory Address. */
|
---|
777 | typedef const RTGCPHYS64 *PCRTGCPHYS64;
|
---|
778 | /** @def NIL_RTGCPHYS64
|
---|
779 | * NIL GC Physical Address.
|
---|
780 | * NIL_RTGCPHYS64 is used to signal an invalid physical address, similar
|
---|
781 | * to the NULL pointer. Note that this value may actually be valid in
|
---|
782 | * some contexts.
|
---|
783 | */
|
---|
784 | #define NIL_RTGCPHYS64 (~(RTGCPHYS64)0)
|
---|
785 |
|
---|
786 | /** Guest context pointer.
|
---|
787 | * Keep in mind that this type is an unsigned integer in
|
---|
788 | * HC and void pointer in GC.
|
---|
789 | */
|
---|
790 | #ifdef IN_GC
|
---|
791 | typedef void *RTGCPTR;
|
---|
792 | #else
|
---|
793 | typedef RTGCUINTPTR RTGCPTR;
|
---|
794 | #endif
|
---|
795 | /** Pointer to a guest context pointer. */
|
---|
796 | typedef RTGCPTR *PRTGCPTR;
|
---|
797 | /** Pointer to a const guest context pointer. */
|
---|
798 | typedef const RTGCPTR *PCRTGCPTR;
|
---|
799 | /** @def NIL_RTGCPTR
|
---|
800 | * NIL GC pointer.
|
---|
801 | */
|
---|
802 | #define NIL_RTGCPTR ((RTGCPTR)0)
|
---|
803 |
|
---|
804 |
|
---|
805 | /** Unsigned integer register in the guest context. */
|
---|
806 | #if GC_ARCH_BITS == 32
|
---|
807 | typedef uint32_t RTGCUINTREG;
|
---|
808 | #elif GC_ARCH_BITS == 64
|
---|
809 | typedef uint64_t RTGCUINTREG;
|
---|
810 | #else
|
---|
811 | # error "Unsupported GC_ARCH_BITS!"
|
---|
812 | #endif
|
---|
813 | /** Pointer to an unsigned integer register in the guest context. */
|
---|
814 | typedef RTGCUINTREG *PRTGCUINTREG;
|
---|
815 | /** Pointer to a const unsigned integer register in the guest context. */
|
---|
816 | typedef const RTGCUINTREG *PCRTGCUINTREG;
|
---|
817 |
|
---|
818 | /** @} */
|
---|
819 |
|
---|
820 |
|
---|
821 | /** @defgroup grp_rt_types_cc Current Context Basic Types
|
---|
822 | * @ingroup grp_rt_types
|
---|
823 | * @{
|
---|
824 | */
|
---|
825 |
|
---|
826 | /** Current Context Physical Memory Address.*/
|
---|
827 | #ifdef IN_GC
|
---|
828 | typedef RTGCPHYS RTCCPHYS;
|
---|
829 | #else
|
---|
830 | typedef RTHCPHYS RTCCPHYS;
|
---|
831 | #endif
|
---|
832 | /** Pointer to Current Context Physical Memory Address. */
|
---|
833 | typedef RTCCPHYS *PRTCCPHYS;
|
---|
834 | /** Pointer to const Current Context Physical Memory Address. */
|
---|
835 | typedef const RTCCPHYS *PCRTCCPHYS;
|
---|
836 | /** @def NIL_RTCCPHYS
|
---|
837 | * NIL CC Physical Address.
|
---|
838 | * NIL_RTCCPHYS is used to signal an invalid physical address, similar
|
---|
839 | * to the NULL pointer.
|
---|
840 | */
|
---|
841 | #ifdef IN_GC
|
---|
842 | # define NIL_RTCCPHYS NIL_RTGCPHYS
|
---|
843 | #else
|
---|
844 | # define NIL_RTCCPHYS NIL_RTHCPHYS
|
---|
845 | #endif
|
---|
846 |
|
---|
847 | /** Unsigned integer register in the current context. */
|
---|
848 | #if ARCH_BITS == 32
|
---|
849 | typedef uint32_t RTCCUINTREG;
|
---|
850 | #elif ARCH_BITS == 64
|
---|
851 | typedef uint64_t RTCCUINTREG;
|
---|
852 | #else
|
---|
853 | # error "Unsupported ARCH_BITS!"
|
---|
854 | #endif
|
---|
855 | /** Pointer to an unsigned integer register in the current context. */
|
---|
856 | typedef RTCCUINTREG *PRTCCUINTREG;
|
---|
857 | /** Pointer to a const unsigned integer register in the current context. */
|
---|
858 | typedef const RTCCUINTREG *PCRTCCUINTREG;
|
---|
859 |
|
---|
860 | /** @deprecated */
|
---|
861 | typedef RTCCUINTREG RTUINTREG;
|
---|
862 | /** @deprecated */
|
---|
863 | typedef RTCCUINTREG *PRTUINTREG;
|
---|
864 | /** @deprecated */
|
---|
865 | typedef const RTCCUINTREG *PCRTUINTREG;
|
---|
866 |
|
---|
867 | /** @} */
|
---|
868 |
|
---|
869 |
|
---|
870 | /** File handle. */
|
---|
871 | typedef RTUINT RTFILE;
|
---|
872 | /** Pointer to file handle. */
|
---|
873 | typedef RTFILE *PRTFILE;
|
---|
874 | /** Nil file handle. */
|
---|
875 | #define NIL_RTFILE (~(RTFILE)0)
|
---|
876 |
|
---|
877 | /** Loader module handle. */
|
---|
878 | typedef R3PTRTYPE(struct RTLDRMODINTERNAL *) RTLDRMOD;
|
---|
879 | /** Pointer to a loader module handle. */
|
---|
880 | typedef RTLDRMOD *PRTLDRMOD;
|
---|
881 | /** Nil loader module handle. */
|
---|
882 | #define NIL_RTLDRMOD 0
|
---|
883 |
|
---|
884 | /** Ring-0 memory object handle. */
|
---|
885 | typedef R0PTRTYPE(struct RTR0MEMOBJINTERNAL *) RTR0MEMOBJ;
|
---|
886 | /** Pointer to a Ring-0 memory object handle. */
|
---|
887 | typedef RTR0MEMOBJ *PRTR0MEMOBJ;
|
---|
888 | /** Nil ring-0 memory object handle. */
|
---|
889 | #define NIL_RTR0MEMOBJ 0
|
---|
890 |
|
---|
891 | /** Native thread handle. */
|
---|
892 | typedef RTHCUINTPTR RTNATIVETHREAD;
|
---|
893 | /** Pointer to an native thread handle. */
|
---|
894 | typedef RTNATIVETHREAD *PRTNATIVETHREAD;
|
---|
895 | /** Nil native thread handle. */
|
---|
896 | #define NIL_RTNATIVETHREAD (~(RTNATIVETHREAD)0)
|
---|
897 |
|
---|
898 | /** Process identifier. */
|
---|
899 | typedef uint32_t RTPROCESS;
|
---|
900 | /** Pointer to a process identifier. */
|
---|
901 | typedef RTPROCESS *PRTPROCESS;
|
---|
902 | /** Nil process identifier. */
|
---|
903 | #define NIL_RTPROCESS (~(RTPROCESS)0)
|
---|
904 |
|
---|
905 | /** Process ring-0 handle. */
|
---|
906 | typedef RTR0UINTPTR RTR0PROCESS;
|
---|
907 | /** Pointer to a ring-0 process handle. */
|
---|
908 | typedef RTR0PROCESS *PRTR0PROCESS;
|
---|
909 | /** Nil ring-0 process handle. */
|
---|
910 | #define NIL_RTR0PROCESS (~(RTR0PROCESS)0)
|
---|
911 |
|
---|
912 | /** @typedef RTSEMEVENT
|
---|
913 | * Event Semaphore handle. */
|
---|
914 | typedef R3R0PTRTYPE(struct RTSEMEVENTINTERNAL *) RTSEMEVENT;
|
---|
915 | /** Pointer to an event semaphore handle. */
|
---|
916 | typedef RTSEMEVENT *PRTSEMEVENT;
|
---|
917 | /** Nil event semaphore handle. */
|
---|
918 | #define NIL_RTSEMEVENT 0
|
---|
919 |
|
---|
920 | /** @typedef RTSEMEVENTMULTI
|
---|
921 | * Event Multiple Release Semaphore handle. */
|
---|
922 | typedef R3R0PTRTYPE(struct RTSEMEVENTMULTIINTERNAL *) RTSEMEVENTMULTI;
|
---|
923 | /** Pointer to an event multiple release semaphore handle. */
|
---|
924 | typedef RTSEMEVENTMULTI *PRTSEMEVENTMULTI;
|
---|
925 | /** Nil multiple release event semaphore handle. */
|
---|
926 | #define NIL_RTSEMEVENTMULTI 0
|
---|
927 |
|
---|
928 | /** @typedef RTSEMFASTMUTEX
|
---|
929 | * Fast mutex Semaphore handle. */
|
---|
930 | typedef R3R0PTRTYPE(struct RTSEMFASTMUTEXINTERNAL *) RTSEMFASTMUTEX;
|
---|
931 | /** Pointer to a mutex semaphore handle. */
|
---|
932 | typedef RTSEMFASTMUTEX *PRTSEMFASTMUTEX;
|
---|
933 | /** Nil fast mutex semaphore handle. */
|
---|
934 | #define NIL_RTSEMFASTMUTEX 0
|
---|
935 |
|
---|
936 | /** @typedef RTSEMMUTEX
|
---|
937 | * Mutex Semaphore handle. */
|
---|
938 | typedef R3R0PTRTYPE(struct RTSEMMUTEXINTERNAL *) RTSEMMUTEX;
|
---|
939 | /** Pointer to a mutex semaphore handle. */
|
---|
940 | typedef RTSEMMUTEX *PRTSEMMUTEX;
|
---|
941 | /** Nil mutex semaphore handle. */
|
---|
942 | #define NIL_RTSEMMUTEX 0
|
---|
943 |
|
---|
944 | /** @typedef RTSEMRW
|
---|
945 | * Read/Write Semaphore handle. */
|
---|
946 | typedef R3R0PTRTYPE(struct RTSEMRWINTERNAL *) RTSEMRW;
|
---|
947 | /** Pointer to a read/write semaphore handle. */
|
---|
948 | typedef RTSEMRW *PRTSEMRW;
|
---|
949 | /** Nil read/write semaphore handle. */
|
---|
950 | #define NIL_RTSEMRW 0
|
---|
951 |
|
---|
952 | /** Spinlock handle. */
|
---|
953 | typedef R3R0PTRTYPE(struct RTSPINLOCKINTERNAL *) RTSPINLOCK;
|
---|
954 | /** Pointer to a spinlock handle. */
|
---|
955 | typedef RTSPINLOCK *PRTSPINLOCK;
|
---|
956 | /** Nil spinlock handle. */
|
---|
957 | #define NIL_RTSPINLOCK 0
|
---|
958 |
|
---|
959 | /** Socket handle. */
|
---|
960 | typedef int RTSOCKET;
|
---|
961 | /** Pointer to socket handle. */
|
---|
962 | typedef RTSOCKET *PRTSOCKET;
|
---|
963 | /** Nil socket handle. */
|
---|
964 | #define NIL_RTSOCKET (~(RTSOCKET)0)
|
---|
965 |
|
---|
966 | /** Thread handle.*/
|
---|
967 | typedef R3R0PTRTYPE(struct RTTHREADINT *) RTTHREAD;
|
---|
968 | /** Pointer to thread handle. */
|
---|
969 | typedef RTTHREAD *PRTTHREAD;
|
---|
970 | /** Nil thread handle. */
|
---|
971 | #define NIL_RTTHREAD 0
|
---|
972 |
|
---|
973 | /** A TLS index. */
|
---|
974 | typedef int RTTLS;
|
---|
975 | /** Pointer to a TLS index. */
|
---|
976 | typedef RTTLS *PRTTLS;
|
---|
977 | /** Pointer to a const TLS index. */
|
---|
978 | typedef RTTLS const *PCRTTLS;
|
---|
979 | /** NIL TLS index value. */
|
---|
980 | #define NIL_RTTLS (-1)
|
---|
981 |
|
---|
982 | /** Handle to a simple heap. */
|
---|
983 | typedef R3R0PTRTYPE(struct RTHEAPSIMPLEINTERNAL *) RTHEAPSIMPLE;
|
---|
984 | /** Pointer to a handle to a simple heap. */
|
---|
985 | typedef RTHEAPSIMPLE *PRTHEAPSIMPLE;
|
---|
986 | /** NIL simple heap handle. */
|
---|
987 | #define NIL_RTHEAPSIMPLE ((RTHEAPSIMPLE)0)
|
---|
988 |
|
---|
989 | /** Handle to an environment block. */
|
---|
990 | typedef R3PTRTYPE(struct RTENVINTERNAL *) RTENV;
|
---|
991 | /** Pointer to a handle to an environment block. */
|
---|
992 | typedef RTENV *PRTENV;
|
---|
993 | /** NIL simple heap handle. */
|
---|
994 | #define NIL_RTENV ((RTENV)0)
|
---|
995 |
|
---|
996 | /** A CPU identifier.
|
---|
997 | * @remarks This doesn't have to correspond to the APIC ID (intel/amd). Nor
|
---|
998 | * does it have to correspond to the bits in the affinity mask, at
|
---|
999 | * least not until we've sorted out Windows NT. */
|
---|
1000 | typedef RTHCUINTPTR RTCPUID;
|
---|
1001 | /** Pointer to a CPU identifier. */
|
---|
1002 | typedef RTCPUID *PRTCPUID;
|
---|
1003 | /** Pointer to a const CPU identifier. */
|
---|
1004 | typedef RTCPUID const *PCRTCPUID;
|
---|
1005 | /** Nil CPU Id. */
|
---|
1006 | #define NIL_RTCPUID ((RTCPUID)~0)
|
---|
1007 |
|
---|
1008 | /** A CPU set.
|
---|
1009 | * Treat this as an opaque type and always use RTCpuSet* for manupulating it. */
|
---|
1010 | typedef uint64_t RTCPUSET;
|
---|
1011 | /** Pointer to a CPU set. */
|
---|
1012 | typedef RTCPUSET *PRTCPUSET;
|
---|
1013 | /** Pointer to a const CPU set. */
|
---|
1014 | typedef RTCPUSET const *PCRTCPUSET;
|
---|
1015 |
|
---|
1016 |
|
---|
1017 | /**
|
---|
1018 | * UUID data type.
|
---|
1019 | */
|
---|
1020 | typedef union RTUUID
|
---|
1021 | {
|
---|
1022 | /** 8-bit view. */
|
---|
1023 | uint8_t au8[16];
|
---|
1024 | /** 16-bit view. */
|
---|
1025 | uint16_t au16[8];
|
---|
1026 | /** 32-bit view. */
|
---|
1027 | uint32_t au32[4];
|
---|
1028 | /** 64-bit view. */
|
---|
1029 | uint64_t au64[2];
|
---|
1030 | /** The way the UUID is declared by the ext2 guys. */
|
---|
1031 | struct
|
---|
1032 | {
|
---|
1033 | uint32_t u32TimeLow;
|
---|
1034 | uint16_t u16TimeMid;
|
---|
1035 | uint16_t u16TimeHiAndVersion;
|
---|
1036 | uint16_t u16ClockSeq;
|
---|
1037 | uint8_t au8Node[6];
|
---|
1038 | } Gen;
|
---|
1039 | /** @deprecated */
|
---|
1040 | unsigned char aUuid[16];
|
---|
1041 | } RTUUID;
|
---|
1042 | /** Pointer to UUID data. */
|
---|
1043 | typedef RTUUID *PRTUUID;
|
---|
1044 | /** Pointer to readonly UUID data. */
|
---|
1045 | typedef const RTUUID *PCRTUUID;
|
---|
1046 |
|
---|
1047 | /**
|
---|
1048 | * UUID string maximum length.
|
---|
1049 | */
|
---|
1050 | #define RTUUID_STR_LENGTH 37
|
---|
1051 |
|
---|
1052 |
|
---|
1053 | /** Compression handle. */
|
---|
1054 | typedef struct RTZIPCOMP *PRTZIPCOMP;
|
---|
1055 |
|
---|
1056 | /** Decompressor handle. */
|
---|
1057 | typedef struct RTZIPDECOMP *PRTZIPDECOMP;
|
---|
1058 |
|
---|
1059 |
|
---|
1060 | /**
|
---|
1061 | * Unicode Code Point.
|
---|
1062 | */
|
---|
1063 | typedef uint32_t RTUNICP;
|
---|
1064 | /** Pointer to an Unicode Code Point. */
|
---|
1065 | typedef RTUNICP *PRTUNICP;
|
---|
1066 | /** Pointer to an Unicode Code Point. */
|
---|
1067 | typedef const RTUNICP *PCRTUNICP;
|
---|
1068 |
|
---|
1069 |
|
---|
1070 | /**
|
---|
1071 | * UTF-16 character.
|
---|
1072 | * @remark wchar_t is not usable since it's compiler defined.
|
---|
1073 | * @remark When we use the term character we're not talking about unicode code point, but
|
---|
1074 | * the basic unit of the string encoding. Thus cwc - count of wide chars - means
|
---|
1075 | * count of RTUTF16; cuc - count of unicode chars - means count of RTUNICP;
|
---|
1076 | * and cch means count of the typedef 'char', which is assumed to be an octet.
|
---|
1077 | */
|
---|
1078 | typedef uint16_t RTUTF16;
|
---|
1079 | /** Pointer to a UTF-16 character. */
|
---|
1080 | typedef RTUTF16 *PRTUTF16;
|
---|
1081 | /** Pointer to a const UTF-16 character. */
|
---|
1082 | typedef const RTUTF16 *PCRTUTF16;
|
---|
1083 |
|
---|
1084 |
|
---|
1085 | /**
|
---|
1086 | * Wait for ever if we have to.
|
---|
1087 | */
|
---|
1088 | #define RT_INDEFINITE_WAIT (~0U)
|
---|
1089 |
|
---|
1090 |
|
---|
1091 | /**
|
---|
1092 | * Generic process callback.
|
---|
1093 | *
|
---|
1094 | * @returns VBox status code. Failure will cancel the operation.
|
---|
1095 | * @param uPercentage The percentage of the operation which has been completed.
|
---|
1096 | * @param pvUser The user specified argument.
|
---|
1097 | */
|
---|
1098 | typedef DECLCALLBACK(int) FNRTPROGRESS(unsigned uPrecentage, void *pvUser);
|
---|
1099 | /** Pointer to a generic progress callback function, FNRTPROCESS(). */
|
---|
1100 | typedef FNRTPROGRESS *PFNRTPROGRESS;
|
---|
1101 |
|
---|
1102 |
|
---|
1103 | /**
|
---|
1104 | * Rectangle data type.
|
---|
1105 | */
|
---|
1106 | typedef struct RTRECT
|
---|
1107 | {
|
---|
1108 | /** left X coordinate. */
|
---|
1109 | int32_t xLeft;
|
---|
1110 | /** top Y coordinate. */
|
---|
1111 | int32_t yTop;
|
---|
1112 | /** right X coordinate. (exclusive) */
|
---|
1113 | int32_t xRight;
|
---|
1114 | /** bottom Y coordinate. (exclusive) */
|
---|
1115 | int32_t yBottom;
|
---|
1116 | } RTRECT;
|
---|
1117 | /** Pointer to a rectangle. */
|
---|
1118 | typedef RTRECT *PRTRECT;
|
---|
1119 | /** Pointer to a const rectangle. */
|
---|
1120 | typedef const RTRECT *PCRTRECT;
|
---|
1121 |
|
---|
1122 | /** @} */
|
---|
1123 |
|
---|
1124 | #endif
|
---|
1125 |
|
---|