- DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT);
- /* dtrace_probe arguments arg0 ... arg4 are 64bits wide */
- val = (uint64_t)(*(((uintptr_t *)stack) + arg));
- DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT);
+ if (dtrace_canload((uint64_t)(stack + arg), sizeof(uint64_t),
+ mstate, vstate)) {
+ /* dtrace_probe arguments arg0 ... arg4 are 64bits wide */
+ val = dtrace_load64((uint64_t)(stack + arg));
+ }