Changeset 53642 in vbox for trunk/src/VBox/ExtPacks/VBoxDTrace/include
- Timestamp:
- Jan 2, 2015 12:16:22 PM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 97412
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ExtPacks/VBoxDTrace/include/VBoxDTraceTypes.h
r53641 r53642 37 37 RT_C_DECLS_BEGIN 38 38 39 struct modctl; 40 39 41 typedef unsigned char uchar_t; 40 42 typedef unsigned int uint_t; … … 58 60 zoneid_t cr_zone; 59 61 } cred_t; 60 #define PRIV_POLICY_ONLY(a_pCred, a_uPriv, a_fAll) (true) 61 #define crgetuid(a_pCred) ((a_pCred)->cr_uid) 62 #define crgetzoneid(a_pCred) ((a_pCred)->cr_zone) 63 64 65 typedef struct VBoxDtCyclicId *cyclic_id_t; 62 #define PRIV_POLICY_ONLY(a_pCred, a_uPriv, a_fAll) (true) 63 #define priv_isequalset(a, b) (true) 64 #define crgetuid(a_pCred) ((a_pCred)->cr_uid) 65 #define crgetzoneid(a_pCred) ((a_pCred)->cr_zone) 66 #define crhold(a_pCred) VBoxDtCredHold 67 #define crfree(a_pCred) VBoxDtCredFree 68 void VBoxDtCredHold(struct VBoxDtCred *pCred); 69 void VBoxDtCredFree(struct VBoxDtCred *pCred); 70 71 72 typedef struct RTTIMER *cyclic_id_t; 73 #define CYCLIC_NONE ((struct RTTIMER *)NULL) 74 #define cyclic_remove(a_hTimer) RTTimerDestroy(a_hTimer) 66 75 67 76 typedef struct VBoxDtThread … … 81 90 { 82 91 uint32_t p_flag; 92 RTPROCESS p_pid; 83 93 struct dtrace_helpers *p_dtrace_helpers; 84 94 } proc_t; … … 89 99 90 100 91 typedef struct VBoxDtDevInfo dev_info_t;92 101 typedef struct VBoxDtTaskQueue taskq_t; 93 typedef struct VBoxDtMemCache kmem_cache_t;94 102 95 103 typedef struct VBoxDtMutex … … 100 108 #define mutex_exit VBoxDtMutexExit 101 109 #define MUTEX_HELD(a_pMtx) VBoxDtMutexIsOwner(a_pMtx) 110 #define MUTEX_NOT_HELD(a_pMtx) (!VBoxDtMutexIsOwner(a_pMtx)) 102 111 #define mod_lock g_DummyMtx 103 112 #define cpu_lock g_DummyMtx … … 157 166 typedef RTUID uid_t; 158 167 typedef RTPROCESS pid_t; 159 typedef RTDEV dev_t;160 168 #endif 161 169 170 #define B_FALSE (0) 171 #define B_TRUE (1) 162 172 #define NANOSEC RT_NS_1SEC 163 173 #define MILLISEC RT_MS_1SEC … … 165 175 #define NCPU RTCPUSET_MAX_CPUS 166 176 #define P2ROUNDUP(uWhat, uAlign) ( ((uWhat) + (uAlign) - 1) & ~(uAlign - 1) ) 177 #define IS_P2ALIGNED(uWhat, uAlign) ( !((uWhat) & ((uAlign) - 1)) ) 167 178 #define roundup(uWhat, uUnit) ( ( (uWhat) + ((uUnit) - 1)) / (uUnit) * (uUnit) ) 179 #define MIN(a1, a2) RT_MIN(a1, a2) 168 180 169 181 #define CPU_ON_INTR(a_pCpu) (false) … … 194 206 * comparsion warnings. */ 195 207 #define VBDTTYPE(a_VBox, a_Org) a_VBox 208 /** Mark missing void in a parameter list. */ 209 #define VBDTVOID void 210 /** Mark missing static in a function definition. */ 211 #define VBDTSTATIC static 212 #define VBDTUNASS(a_Value) = a_Value 196 213 197 214 /* … … 207 224 void VBoxDtKMemFree(void *pvMem, size_t cbMem); 208 225 226 227 typedef struct VBoxDtMemCache kmem_cache_t; 228 #define kmem_cache_create VBoxDtKMemCacheCreate 229 #define kmem_cache_destroy VBoxDtKMemCacheDestroy 230 #define kmem_cache_alloc VBoxDtKMemCacheAlloc 231 #define kmem_cache_free VBoxDtKMemCacheFree 232 struct VBoxDtMemCache *VBoxDtKMemCacheCreate(const char *pszName, size_t cbBuf, size_t cbAlign, 233 PFNRT pfnCtor, PFNRT pfnDtor, PFNRT pfnReclaim, 234 void *pvUser, void *pvVM, uint32_t fFlags); 235 void VBoxDtKMemCacheDestroy(struct VBoxDtMemCache *pCache); 236 void *VBoxDtKMemCacheAlloc(struct VBoxDtMemCache *pCache, uint32_t fFlags); 237 void VBoxDtKMemCacheFree(struct VBoxDtMemCache *pCache, void *pvMem); 238 239 209 240 typedef struct VBoxDtVMem 210 241 { … … 214 245 #define VM_SLEEP RT_BIT(0) 215 246 #define VM_BESTFIT RT_BIT(1) 247 #define VMC_IDENTIFIER RT_BIT(16) 248 #define vmem_create VBoxDtVMemCreate 249 #define vmem_destroy VBoxDtVMemDestroy 216 250 #define vmem_alloc VBoxDtVMemAlloc 217 251 #define vmem_free VBoxDtVMemFree 252 struct VBoxDtVMem *VBoxDtVMemCreate(const char *pszName, void *pvBase, size_t cb, size_t cbUnit, 253 PFNRT pfnAlloc, PFNRT pfnFree, struct VBoxDtVMem *pSrc, 254 size_t cbQCacheMax, uint32_t fFlags); 255 void VBoxDtVMemDestroy(struct VBoxDtVMem *pVMemArena); 218 256 void *VBoxDtVMemAlloc(struct VBoxDtVMem *pVMemArena, size_t cbMem, uint32_t fFlags); 219 257 void VBoxDtVMemFree(struct VBoxDtVMem *pVMemArena, void *pvMem, size_t cbMem); … … 229 267 #define ENOSPC (28) 230 268 #define ENOENT (2) 269 #define EFAULT (14) 270 #define E2BIG (7) 271 #define EACCES (13) 272 #define EALREADY (114) 273 #define ENXIO (6) 274 #define EAGAIN (11) 275 #define ENOTTY (25) 276 #define ESRCH (3) 231 277 232 278 /* … … 235 281 #define bcopy(a_pSrc, a_pDst, a_cb) memmove(a_pDst, a_pSrc, a_cb) 236 282 #define bzero(a_pDst, a_cb) RT_BZERO(a_pDst, a_cb) 283 #define bcmp(a_p1, a_p2, a_cb) memcmp(a_p1, a_p2, a_cb) 284 #define snprintf RTStrPrintf 285 286 /* 287 * Copy In/Out 288 */ 289 #define copyin VBoxDtCopyIn 290 #define copyout VBoxDtCopyOut 291 int VBoxDtCopyIn(void const *pvUser, void *pvDst, size_t cb); 292 int VBoxDtCopyOut(void const *pvSrc, void *pvUser, size_t cb); 293 294 /* 295 * Device numbers. 296 */ 297 typedef uint64_t dev_t; 298 typedef uint32_t major_t; 299 typedef uint32_t minor_t; 300 #define makedevice(a_Maj, a_Min) RT_MAKE_U64(a_Min, a_Maj) 301 #define getemajor(a_Dev) RT_HIDWORD(a_Dev) 302 #define geteminor(a_Dev) RT_LODWORD(a_Dev) 303 #define getminor(a_Dev) RT_LODWORD(a_Dev) 304 305 /* 306 * DDI 307 */ 308 #define DDI_SUCCESS (0) 309 #define DDI_FAILURE (-1) 310 #define ddi_soft_state_init VBoxDtDdiSoftStateInit 311 #define ddi_soft_state_fini VBoxDtDdiSoftStateTerm 312 #define ddi_soft_state_zalloc VBoxDtDdiSoftStateAllocZ 313 #define ddi_get_soft_state VBoxDtDdiSoftStateGet 314 #define ddi_soft_state_free VBoxDtDdiSoftStateFree 315 int VBoxDtDdiSoftStateInit(void **ppvSoftStates, size_t cbSoftState, uint32_t cMaxItems); 316 int VBoxDtDdiSoftStateTerm(void **ppvSoftStates); 317 int VBoxDtDdiSoftStateAllocZ(void *pvSoftStates, RTDEV uMinor); 318 int VBoxDtDdiSoftStateFree(void *pvSoftStates, RTDEV uMinor); 319 void *VBoxDtDdiSoftStateGet(void *pvSoftStates, RTDEV uMinor); 320 321 typedef struct VBoxDtDevInfo dev_info_t; 322 typedef enum { DDI_ATT_CMD_DUMMY } ddi_attach_cmd_t; 323 typedef enum { DDI_DETACH, DDI_SUSPEND } ddi_detach_cmd_t; 324 #define ddi_driver_major VBoxDtDdiDriverMajor 325 #define ddi_report_dev VBoxDtDdiReportDev 326 major_t VBoxDtDdiDriverMajor(struct VBoxDtDevInfo *pDevInfo); 327 void VBoxDtDdiReportDev(struct VBoxDtDevInfo *pDevInfo); 328 329 /* 330 * CTF - probably needs to be ported wholesale or smth. 331 */ 332 #define CTF_MODEL_NATIVE 1 237 333 238 334 RT_C_DECLS_END
Note:
See TracChangeset
for help on using the changeset viewer.