VirtualBox

Ignore:
Timestamp:
Jan 2, 2015 12:33:32 PM (10 years ago)
Author:
vboxsync
Message:

VBoxDTrace: Implemented all the fake solaris stuff. (r46)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/uts/common/dtrace/dtrace.c

    r53668 r53669  
    9797# include <iprt/assert.h>
    9898# include <iprt/cpuset.h>
     99# include <iprt/mem.h>
    99100# include <iprt/mp.h>
    100101# include <iprt/string.h>
     
    138139# define NULL (0)
    139140#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
    140152
    141153/*
     
    232244static kmem_cache_t     *dtrace_state_cache;    /* cache for dynamic state */
    233245static uint64_t         dtrace_vtime_references; /* number of vtimestamp refs */
     246#ifndef VBOX
    234247static kthread_t        *dtrace_panicked;       /* panicking thread */
     248#endif
    235249static dtrace_ecb_t     *dtrace_ecb_create_cache; /* cached created ECB */
    236250static dtrace_genid_t   dtrace_probegen;        /* current probe generation */
     
    93679381
    93689382        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));
    93709384
    93719385        act = kmem_zalloc(sizeof (dtrace_actdesc_t), KM_SLEEP);
     
    94039417                char *str = (char *)(uintptr_t)act->dtad_arg;
    94049418
    9405                 ASSERT((str != NULL && (uintptr_t)str >= KERNELBASE) ||
     9419                ASSERT((str != NULL && VBDT_IS_VALID_KRNL_ADDR((uintptr_t)str)) ||
    94069420                    (str == NULL && act->dtad_kind == DTRACEACT_PRINTA));
    94079421
     
    98789892                        } else {
    98799893                                ASSERT(arg != NULL);
    9880                                 ASSERT(arg > KERNELBASE);
     9894                                ASSERT(VBDT_IS_VALID_KRNL_ADDR(arg));
    98819895                                format = dtrace_format_add(state,
    98829896                                    (char *)(uintptr_t)arg);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette