* Use is subject to license terms.
*/
-/*
- * #pragma ident "@(#)fasttrap_isa.c 1.19 05/09/14 SMI"
- */
-
-#ifdef KERNEL
-#ifndef _KERNEL
-#define _KERNEL /* Solaris vs. Darwin */
-#endif
-#endif
-
#include <sys/fasttrap_isa.h>
#include <sys/fasttrap_impl.h>
#include <sys/dtrace.h>
}
if (probe->ftp_prov->ftp_provider_type == DTFTP_PROVIDER_ONESHOT) {
- uint8_t already_triggered = atomic_or_8(&probe->ftp_triggered, 1);
- if (already_triggered) {
+ if (os_atomic_xchg(&probe->ftp_triggered, 1, relaxed)) {
+ /* already triggered */
continue;
}
}
else {
retire_tp = 0;
}
-#ifndef CONFIG_EMBEDDED
+#if defined(XNU_TARGET_OS_OSX)
if (ISSET(current_proc()->p_lflag, P_LNOATTACH)) {
dtrace_probe(dtrace_probeid_error, 0 /* state */, id->fti_probe->ftp_id,
1 /* ndx */, -1 /* offset */, DTRACEFLT_UPRIV);
#else
if (FALSE) {
-#endif
+#endif /* defined(XNU_TARGET_OS_OSX) */
} else {
dtrace_probe(id->fti_probe->ftp_id,
pc - id->fti_probe->ftp_faddr,
lck_mtx_unlock(pid_mtx);
}
+#if DEBUG
+__dead2
+#endif
static void
fasttrap_sigsegv(proc_t *p, uthread_t t, user_addr_t addr, arm_saved_state_t *regs)
{
for (id = tp->ftt_ids; id != NULL; id = id->fti_next) {
fasttrap_probe_t *probe = id->fti_probe;
-#ifndef CONFIG_EMBEDDED
+#if defined(XNU_TARGET_OS_OSX)
if (ISSET(current_proc()->p_lflag, P_LNOATTACH)) {
dtrace_probe(dtrace_probeid_error, 0 /* state */, probe->ftp_id,
1 /* ndx */, -1 /* offset */, DTRACEFLT_UPRIV);
#else
if (FALSE) {
-#endif
+#endif /* defined(XNU_TARGET_OS_OSX) */
} else {
if (probe->ftp_prov->ftp_provider_type == DTFTP_PROVIDER_ONESHOT) {
- uint8_t already_triggered = atomic_or_8(&probe->ftp_triggered, 1);
- if (already_triggered) {
+ if (os_atomic_xchg(&probe->ftp_triggered, 1, relaxed)) {
+ /* already triggered */
continue;
}
}