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