* Invoke a userspace DTrace hook. The hook pointer is cleared when no * userspace probes are enabled, so we must synchronize with DTrace to ensure * that a trapping thread is able to call the hook before it is cleared. */
| 967 | * that a trapping thread is able to call the hook before it is cleared. |
| 968 | */ |
| 969 | static bool |
| 970 | trap_user_dtrace(struct trapframe *frame, int (**hookp)(struct trapframe *)) |
| 971 | { |
| 972 | int (*hook)(struct trapframe *); |
| 973 | |
| 974 | hook = atomic_load_ptr(hookp); |
| 975 | enable_intr(); |
| 976 | if (hook != NULL) |
| 977 | return ((hook)(frame) == 0); |
| 978 | return (false); |
| 979 | } |
| 980 | #endif |
| 981 | |
| 982 | /* |