Changeset 53645 in vbox for trunk/src/VBox/ExtPacks/VBoxDTrace/onnv
- Timestamp:
- Jan 2, 2015 12:17:02 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/uts/common/dtrace/dtrace.c
r53644 r53645 104 104 # include <limits.h> 105 105 106 /* 107 * Use asm.h to implemente some of the simple stuff in dtrace_asm.s. 108 */ 109 # include <iprt/asm.h> 110 # include <iprt/asm-amd64-x86.h> 111 # define dtrace_casptr(a_ppvDst, a_pvOld, a_pvNew) \ 112 VBoxDtCompareAndSwapPtr(a_ppvDst, a_pvOld, a_pvNew) 113 DECLINLINE(void *) VBoxDtCompareAndSwapPtr(void * volatile *ppvDst, void *pvOld, void *pvNew) 114 { 115 void *pvRet; 116 ASMAtomicCmpXchgExPtrVoid(ppvDst, pvNew, pvOld, &pvRet); 117 return pvRet; 118 } 119 120 # define dtrace_cas32(a_pu32Dst, a_pu32Old, a_pu32New) \ 121 VBoxDtCompareAndSwapU32(a_pu32Dst, a_pu32Old, a_pu32New) 122 DECLINLINE(uint32_t) VBoxDtCompareAndSwapU32(uint32_t volatile *pu32Dst, uint32_t u32Old, uint32_t u32New) 123 { 124 uint32_t u32Ret; 125 ASMAtomicCmpXchgExU32(pu32Dst, u32New, u32Old, &u32Ret); 126 return u32Ret; 127 } 128 129 #define dtrace_membar_consumer() ASMReadFence() 130 #define dtrace_membar_producer() ASMWriteFence() 131 #define dtrace_interrupt_disable() ASMIntDisableFlags() 132 #define dtrace_interrupt_enable(a_EFL) ASMSetFlags(a_EFL) 133 134 /* 135 * NULL must be set to 0 or we'll end up with a billion warnings(=errors). 136 */ 106 137 # undef NULL 107 138 # define NULL (0) … … 1850 1881 } 1851 1882 1883 #ifndef VBOX 1852 1884 ASSERT(0); 1885 #else 1886 AssertFatalFailed(); 1887 #endif 1853 1888 } 1854 1889 … … 2706 2741 return (val); 2707 2742 2743 #ifndef VBOX 2708 2744 ASSERT(0); 2745 #else 2746 AssertFatalFailed(); 2747 #endif 2709 2748 } 2710 2749 … … 2748 2787 2749 2788 case DIF_VAR_VTIMESTAMP: 2789 #ifndef VBOX 2750 2790 ASSERT(dtrace_vtime_references != 0); 2751 2791 return (curthread->t_dtrace_vtime); 2792 #else 2793 cpu_core[VBDT_GET_CPUID()].cpuc_dtrace_flags |= CPU_DTRACE_ILLOP; 2794 return (0); 2795 #endif 2752 2796 2753 2797 case DIF_VAR_WALLTIMESTAMP: … … 5700 5744 } 5701 5745 5746 #ifdef VBOX 5747 extern void dtrace_probe6(dtrace_id_t, uintptr_t arg0, uintptr_t arg1, 5748 uintptr_t arg2, uintptr_t arg3, uintptr_t arg4, uintptr_t arg5); 5749 # define dtrace_probe_error(a1, a2, a3, a4, a5, a6) \ 5750 dtrace_probe6(dtrace_probeid_error, (uintptr_t)a1, a2, a3, a4, a5, a6) 5751 #endif 5752 5702 5753 /* 5703 5754 * If you're looking for the epicenter of DTrace, you just found it. This … … 6219 6270 6220 6271 default: 6272 #ifndef VBOX 6221 6273 ASSERT(0); 6274 #else 6275 AssertFatalMsgFailed(("%d\n", act->dta_kind)); 6276 #endif 6222 6277 } 6223 6278 … … 6283 6338 * reference, not by value. 6284 6339 */ 6340 #ifndef VBOX 6285 6341 ASSERT(0); 6342 #else 6343 AssertFatalMsgFailed(("%zu\n", size)); 6344 #endif 6286 6345 break; 6287 6346 } … … 8685 8744 dtrace_difo_hold(dtrace_difo_t *dp) 8686 8745 { 8746 #ifndef VBOX 8687 8747 VBDTTYPE(uint_t,int) i; 8748 #endif 8688 8749 8689 8750 ASSERT(MUTEX_HELD(&dtrace_lock)); … … 8692 8753 ASSERT(dp->dtdo_refcnt != 0); 8693 8754 8755 #ifndef VBOX 8694 8756 /* 8695 8757 * We need to check this DIF object for references to the variable … … 8705 8767 dtrace_vtime_enable(); 8706 8768 } 8769 #endif 8707 8770 } 8708 8771 … … 8924 8987 8925 8988 default: 8989 #ifndef VBOX 8926 8990 ASSERT(0); 8991 #else 8992 AssertFatalMsgFailed(("%d\n", scope)); 8993 #endif 8927 8994 } 8928 8995 … … 9040 9107 9041 9108 default: 9109 #ifndef VBOX 9042 9110 ASSERT(0); 9043 # ifdef VBOX9044 continue;9111 #else 9112 AssertFatalMsgFailed(("%d\n", scope)); 9045 9113 #endif 9046 9114 } … … 9080 9148 dtrace_difo_release(dtrace_difo_t *dp, dtrace_vstate_t *vstate) 9081 9149 { 9150 #ifndef VBOX 9082 9151 VBDTTYPE(uint_t,int) i; 9152 #endif 9083 9153 9084 9154 ASSERT(MUTEX_HELD(&dtrace_lock)); 9085 9155 ASSERT(dp->dtdo_refcnt != 0); 9086 9156 9157 #ifndef VBOX 9087 9158 for (i = 0; i < dp->dtdo_varlen; i++) { 9088 9159 dtrace_difv_t *v = &dp->dtdo_vartab[i]; … … 9095 9166 dtrace_vtime_disable(); 9096 9167 } 9168 #endif 9097 9169 9098 9170 if (--dp->dtdo_refcnt == 0)
Note:
See TracChangeset
for help on using the changeset viewer.