X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/0a7de7458d150b5d4dffc935ba399be265ef0a1a..cb3231590a3c94ab4375e2228bd5e86b0cf1ad7e:/bsd/dev/arm64/dtrace_subr_arm.c diff --git a/bsd/dev/arm64/dtrace_subr_arm.c b/bsd/dev/arm64/dtrace_subr_arm.c index 584317298..c5c427d62 100644 --- a/bsd/dev/arm64/dtrace_subr_arm.c +++ b/bsd/dev/arm64/dtrace_subr_arm.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007 Apple Inc. All rights reserved. + * Copyright (c) 2007-2018 Apple Inc. All rights reserved. */ /* * CDDL HEADER START @@ -27,10 +27,6 @@ * Use is subject to license terms. */ -/* - * #pragma ident "@(#)dtrace_subr.c 1.12 05/06/08 SMI" - */ - #include #include #include @@ -65,27 +61,11 @@ dtrace_user_probe(arm_saved_state_t *regs) kauth_cred_uthread_update(uthread, p); - if (is_saved_state32(regs)) { - if (saved_state32(regs)->cpsr & PSR_TF) { - uint16_t pc; - if (copyin((user_addr_t)saved_state32(regs)->pc, &pc, sizeof(uint16_t))) { - return KERN_FAILURE; - } - is_fasttrap = (pc == FASTTRAP_THUMB32_RET_INSTR); - } else { - uint32_t pc; - if (copyin((user_addr_t)saved_state32(regs)->pc, &pc, sizeof(uint32_t))) { - return KERN_FAILURE; - } - is_fasttrap = (pc == FASTTRAP_ARM32_RET_INSTR); - } - } else { - uint32_t pc; - if (copyin((user_addr_t)saved_state64(regs)->pc, &pc, sizeof(uint32_t))) { - return KERN_FAILURE; - } - is_fasttrap = (pc == FASTTRAP_ARM64_RET_INSTR); + uint32_t pc; + if (copyin((user_addr_t)saved_state64(regs)->pc, &pc, sizeof(uint32_t))) { + return KERN_FAILURE; } + is_fasttrap = (pc == FASTTRAP_ARM64_RET_INSTR); if (is_fasttrap) { uint8_t step = uthread->t_dtrace_step; @@ -183,38 +163,11 @@ dtrace_user_probe(arm_saved_state_t *regs) * * Note that the PC points to the instruction that caused the fault. */ - if (is_saved_state32(regs)) { - if (saved_state32(regs)->cpsr & PSR_TF) { - uint16_t instr; - if (fuword16(saved_state32(regs)->pc, &instr) == 0 && instr != FASTTRAP_THUMB32_INSTR) { - return KERN_SUCCESS; - } - } else { - uint32_t instr; - if (fuword32(saved_state32(regs)->pc, &instr) == 0 && instr != FASTTRAP_ARM32_INSTR) { - return KERN_SUCCESS; - } - } - } else { - uint32_t instr; - if (fuword32(saved_state64(regs)->pc, &instr) == 0 && instr != FASTTRAP_ARM64_INSTR) { - return KERN_SUCCESS; - } + uint32_t instr; + if (fuword32(saved_state64(regs)->pc, &instr) == 0 && instr != FASTTRAP_ARM64_INSTR) { + return KERN_SUCCESS; } } return KERN_FAILURE; } - -void -dtrace_safe_synchronous_signal(void) -{ - /* Not implemented */ -} - -int -dtrace_safe_defer_signal(void) -{ - /* Not implemented */ - return 0; -}