]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/dev/arm64/dtrace_subr_arm.c
xnu-6153.11.26.tar.gz
[apple/xnu.git] / bsd / dev / arm64 / dtrace_subr_arm.c
index 584317298d4f14f69f71d4d87e52fc55e82f01b9..c5c427d62310d71b5037831cc459e16e6271a293 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  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>
@@ -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;
-}