/*
- * Copyright (c) 2007 Apple Inc. All rights reserved.
+ * Copyright (c) 2007-2018 Apple Inc. All rights reserved.
*/
/*
* CDDL HEADER START
* Use is subject to license terms.
*/
-/*
- * #pragma ident "@(#)dtrace_subr.c 1.12 05/06/08 SMI"
- */
-
#include <sys/dtrace.h>
#include <sys/dtrace_glue.h>
#include <sys/dtrace_impl.h>
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;
*
* 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;
-}