summaryrefslogtreecommitdiffstats
path: root/sys/arm
diff options
context:
space:
mode:
authorcognet <cognet@FreeBSD.org>2004-07-12 21:19:43 +0000
committercognet <cognet@FreeBSD.org>2004-07-12 21:19:43 +0000
commit5c9c269caa1e8c33d650c9dbd4cd7bdd43603320 (patch)
treefa99e454be4a847af95d93314647ea6a6a36362f /sys/arm
parent017c5d391cdb5f2d78bad29ae472414b12fc4806 (diff)
downloadFreeBSD-src-5c9c269caa1e8c33d650c9dbd4cd7bdd43603320.zip
FreeBSD-src-5c9c269caa1e8c33d650c9dbd4cd7bdd43603320.tar.gz
Implement makectx().
Diffstat (limited to 'sys/arm')
-rw-r--r--sys/arm/arm/machdep.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/sys/arm/arm/machdep.c b/sys/arm/arm/machdep.c
index 73000f7..0f8d88c 100644
--- a/sys/arm/arm/machdep.c
+++ b/sys/arm/arm/machdep.c
@@ -407,3 +407,22 @@ sigreturn(td, uap)
}
+/*
+ * Construct a PCB from a trapframe. This is called from kdb_trap() where
+ * we want to start a backtrace from the function that caused us to enter
+ * the debugger. We have the context in the trapframe, but base the trace
+ * on the PCB. The PCB doesn't have to be perfect, as long as it contains
+ * enough for a backtrace.
+ */
+void
+makectx(struct trapframe *tf, struct pcb *pcb)
+{
+ pcb->un_32.pcb32_r8 = tf->tf_r8;
+ pcb->un_32.pcb32_r9 = tf->tf_r9;
+ pcb->un_32.pcb32_r10 = tf->tf_r10;
+ pcb->un_32.pcb32_r11 = tf->tf_r11;
+ pcb->un_32.pcb32_r12 = tf->tf_r12;
+ pcb->un_32.pcb32_pc = tf->tf_pc;
+ pcb->un_32.pcb32_lr = tf->tf_usr_lr;
+ pcb->un_32.pcb32_sp = tf->tf_usr_sp;
+}
OpenPOWER on IntegriCloud