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