Changeset 53669 in vbox for trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/uts
- Timestamp:
- Jan 2, 2015 12:33:32 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/uts/common/dtrace/dtrace.c
r53668 r53669 97 97 # include <iprt/assert.h> 98 98 # include <iprt/cpuset.h> 99 # include <iprt/mem.h> 99 100 # include <iprt/mp.h> 100 101 # include <iprt/string.h> … … 138 139 # define NULL (0) 139 140 #endif /* VBOX */ 141 142 /** Check if the given address is a valid kernel address. 143 * The value can be uintptr_t or uint64_t. */ 144 #ifndef VBOX 145 # define VBDT_IS_VALID_KRNL_ADDR(a_uAddr) ((a_uAddr) >= KERNELBASE) 146 #else 147 # define VBDT_IS_VALID_KRNL_ADDR(a_uAddr) \ 148 ( (sizeof(a_uAddr) == sizeof(uintptr_t) || (uintptr_t)(a_uAddr) == (a_uAddr)) \ 149 && RTR0MemKernelIsValidAddr((void *)(uintptr_t)(a_uAddr)) ) 150 #endif 151 140 152 141 153 /* … … 232 244 static kmem_cache_t *dtrace_state_cache; /* cache for dynamic state */ 233 245 static uint64_t dtrace_vtime_references; /* number of vtimestamp refs */ 246 #ifndef VBOX 234 247 static kthread_t *dtrace_panicked; /* panicking thread */ 248 #endif 235 249 static dtrace_ecb_t *dtrace_ecb_create_cache; /* cached created ECB */ 236 250 static dtrace_genid_t dtrace_probegen; /* current probe generation */ … … 9367 9381 9368 9382 ASSERT(!DTRACEACT_ISPRINTFLIKE(kind) || (arg != NULL && 9369 arg >= KERNELBASE) || (arg == NULL && kind == DTRACEACT_PRINTA));9383 VBDT_IS_VALID_KRNL_ADDR(arg)) || (arg == NULL && kind == DTRACEACT_PRINTA)); 9370 9384 9371 9385 act = kmem_zalloc(sizeof (dtrace_actdesc_t), KM_SLEEP); … … 9403 9417 char *str = (char *)(uintptr_t)act->dtad_arg; 9404 9418 9405 ASSERT((str != NULL && (uintptr_t)str >= KERNELBASE) ||9419 ASSERT((str != NULL && VBDT_IS_VALID_KRNL_ADDR((uintptr_t)str)) || 9406 9420 (str == NULL && act->dtad_kind == DTRACEACT_PRINTA)); 9407 9421 … … 9878 9892 } else { 9879 9893 ASSERT(arg != NULL); 9880 ASSERT( arg > KERNELBASE);9894 ASSERT(VBDT_IS_VALID_KRNL_ADDR(arg)); 9881 9895 format = dtrace_format_add(state, 9882 9896 (char *)(uintptr_t)arg);
Note:
See TracChangeset
for help on using the changeset viewer.