Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/aarch64/aarch64 Add KDTRACE_HOOKS support.
details: https://anonhg.NetBSD.org/src/rev/0a4bc0c9b6f5
branches: trunk
changeset: 1005301:0a4bc0c9b6f5
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Tue Dec 03 22:02:43 2019 +0000
description:
Add KDTRACE_HOOKS support.
diffstat:
sys/arch/aarch64/aarch64/trap.c | 29 ++++++++++++++++++++++++++---
1 files changed, 26 insertions(+), 3 deletions(-)
diffs (74 lines):
diff -r 82622ef4353d -r 0a4bc0c9b6f5 sys/arch/aarch64/aarch64/trap.c
--- a/sys/arch/aarch64/aarch64/trap.c Tue Dec 03 16:45:21 2019 +0000
+++ b/sys/arch/aarch64/aarch64/trap.c Tue Dec 03 22:02:43 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.21 2019/11/24 04:08:36 rin Exp $ */
+/* $NetBSD: trap.c,v 1.22 2019/12/03 22:02:43 jmcneill Exp $ */
/*-
* Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -31,10 +31,11 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.21 2019/11/24 04:08:36 rin Exp $");
+__KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.22 2019/12/03 22:02:43 jmcneill Exp $");
#include "opt_arm_intr_impl.h"
#include "opt_compat_netbsd32.h"
+#include "opt_dtrace.h"
#include <sys/param.h>
#include <sys/kauth.h>
@@ -73,11 +74,20 @@
#include <ddb/db_output.h>
#include <machine/db_machdep.h>
#endif
+#ifdef KDTRACE_HOOKS
+#include <sys/dtrace_bsd.h>
+#endif
#ifdef DDB
int sigill_debug = 0;
#endif
+#ifdef KDTRACE_HOOKS
+dtrace_doubletrap_func_t dtrace_doubletrap_func = NULL;
+dtrace_trap_func_t dtrace_trap_func = NULL;
+int (*dtrace_invop_jump_addr)(struct trapframe *);
+#endif
+
const char * const trap_names[] = {
[ESR_EC_UNKNOWN] = "Unknown Reason (Illegal Instruction)",
[ESR_EC_SERROR] = "SError Interrupt",
@@ -182,16 +192,29 @@
else
daif_enable(DAIF_D|DAIF_A);
+#ifdef KDTRACE_HOOKS
+ if (dtrace_trap_func != NULL && (*dtrace_trap_func)(tf, eclass))
+ return;
+#endif
+
switch (eclass) {
case ESR_EC_INSN_ABT_EL1:
case ESR_EC_DATA_ABT_EL1:
data_abort_handler(tf, eclass);
break;
+ case ESR_EC_BKPT_INSN_A64:
+#ifdef KDTRACE_HOOKS
+ if (__SHIFTOUT(esr, ESR_ISS) == 0x40d &&
+ dtrace_invop_jump_addr != 0) {
+ (*dtrace_invop_jump_addr)(tf);
+ break;
+ }
+ /* FALLTHROUGH */
+#endif
case ESR_EC_BRKPNT_EL1:
case ESR_EC_SW_STEP_EL1:
case ESR_EC_WTCHPNT_EL1:
- case ESR_EC_BKPT_INSN_A64:
#ifdef DDB
if (eclass == ESR_EC_BRKPNT_EL1)
kdb_trap(DB_TRAP_BREAKPOINT, tf);
Home |
Main Index |
Thread Index |
Old Index