Changeset 53652 in vbox for trunk/src/VBox/ExtPacks/VBoxDTrace/include
- Timestamp:
- Jan 2, 2015 12:19:17 PM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 97422
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ExtPacks/VBoxDTrace/include/VBoxDTraceTypes.h
r53648 r53652 34 34 #include <iprt/types.h> 35 35 #include <iprt/stdarg.h> 36 #include <iprt/param.h> 37 #ifdef IN_RING3 38 # include <sys/types.h> 39 #endif 36 40 37 41 RT_C_DECLS_BEGIN … … 40 44 41 45 typedef unsigned char uchar_t; 46 typedef unsigned short ushort_t; 42 47 typedef unsigned int uint_t; 43 48 typedef uintptr_t ulong_t; 49 typedef uint64_t hrtime_t; 50 typedef RTCCUINTREG greg_t; 44 51 typedef uintptr_t pc_t; 52 typedef uintptr_t id_t; 45 53 typedef unsigned int model_t; 46 54 typedef uint32_t zoneid_t; … … 54 62 #define NANOSEC RT_NS_1SEC 55 63 #define MILLISEC RT_MS_1SEC 64 #define MAXPATHLEN RTPATH_MAX 65 #define PATH_MAX RTPATH_MAX 66 #define NBBY 8 67 #define NCPU RTCPUSET_MAX_CPUS 56 68 57 69 #if defined(RT_ARCH_X86) 58 70 # ifndef __i386 59 # define __i386 1 71 # define __i386 1 72 # endif 73 # ifndef __x86 74 # define __x86 1 60 75 # endif 61 76 62 77 #elif defined(RT_ARCH_AMD64) 63 78 # ifndef __x86_64 64 # define __x86_64 1 79 # define __x86_64 1 80 # endif 81 # ifndef __x86 82 # define __x86 1 65 83 # endif 66 84 … … 94 112 95 113 /* 96 * CTF - probably needs to be ported wholesale or smth. 97 */ 98 #define CTF_MODEL_NATIVE 1 99 typedef struct VBoxDtCtfFile ctf_file_t; 100 typedef intptr_t ctf_id_t; 101 102 114 * Errno defines compatible with the CRT of the given host... 115 */ 103 116 #ifdef IN_RING0 117 # define EINVAL (22) 118 # define EBUSY (16) 119 # define EFBIG (27) 120 # define ENOMEM (12) 121 # define ENOSPC (28) 122 # define ENOENT (2) 123 # define EFAULT (14) 124 # define E2BIG (7) 125 # define EACCES (13) 126 # define ENXIO (6) 127 # define EAGAIN (11) 128 # define ENOTTY (25) 129 # define ESRCH (3) 130 #endif 131 #if defined(_MSC_VER) || defined(IN_RING0) 132 # define EALREADY (114) 133 #endif 134 135 136 #ifdef IN_RING0 104 137 105 138 /* 106 139 * Kernel stuff... 107 140 */ 108 typedef uint64_t hrtime_t;109 typedef RTCCUINTREG greg_t;110 111 141 #define P2ROUNDUP(uWhat, uAlign) ( ((uWhat) + (uAlign) - 1) & ~(uAlign - 1) ) 112 142 #define IS_P2ALIGNED(uWhat, uAlign) ( !((uWhat) & ((uAlign) - 1)) ) … … 114 144 #define MIN(a1, a2) RT_MIN(a1, a2) 115 145 116 #define NBBY 8117 #define NCPU RTCPUSET_MAX_CPUS118 146 #define B_FALSE (0) 119 147 #define B_TRUE (1) … … 235 263 void VBoxDtUPrintfV(const char *pszFormat, va_list va); 236 264 237 238 /*239 * Errno defines compatible with the CRT of the given host...240 */241 #define EINVAL (22)242 #define EBUSY (16)243 #define EFBIG (27)244 #define ENOMEM (12)245 #define ENOSPC (28)246 #define ENOENT (2)247 #define EFAULT (14)248 #define E2BIG (7)249 #define EACCES (13)250 #define EALREADY (114)251 #define ENXIO (6)252 #define EAGAIN (11)253 #define ENOTTY (25)254 #define ESRCH (3)255 256 265 /* 257 266 * Memory allocation wrappers. … … 344 353 #endif /* IN_RING0 */ 345 354 355 356 #ifdef IN_RING3 357 /* 358 * Make life a little easier in ring-3. 359 */ 360 # include <iprt/alloca.h> 361 # include <iprt/mem.h> 362 # include <iprt/string.h> 363 # include <iprt/time.h> 364 # define gethrtime() RTTimeNanoTS() 365 366 /* This isn't necessarily making things easier at first, but allows EF and 367 such later on when things doesn't work right. */ 368 # include <stdlib.h> 369 # include <string.h> 370 # define malloc(a_cbMem) RTMemAlloc(a_cbMem) 371 # define realloc(a_pvOld, a_cbMem) RTMemRealloc(a_pvOld, a_cbMem) 372 # define calloc(a_cbItem, a_cItems) RTMemAllocZ((size_t)(a_cbItem) * (a_cItems)) 373 # define free(a_pvMem) RTMemFree(a_pvMem) 374 # define strdup(a_psz) RTStrDup(a_psz) 375 376 #endif 377 346 378 RT_C_DECLS_END 347 379 #endif
Note:
See TracChangeset
for help on using the changeset viewer.