aboutsummaryrefslogtreecommitdiff
path: root/sys/amd64/amd64/exception.S
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2007-11-15 22:00:57 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2007-11-15 22:00:57 +0000
commit185250da234f785cbe23f683ba0cb75dad426813 (patch)
treeede94b8163bb9be49c9615431eac45cfed8c0e91 /sys/amd64/amd64/exception.S
parentcd808cec50ea89eb8662446bc221a296b022e9c3 (diff)
downloadsrc-185250da234f785cbe23f683ba0cb75dad426813.tar.gz
src-185250da234f785cbe23f683ba0cb75dad426813.zip
Add support for cross double fault frames in stack traces:
- Populate the register values for the trapframe put on the stack by the double fault handler. - Teach DDB's trace routine to treat a double fault like other trap frames. MFC after: 3 days
Notes
Notes: svn path=/head/; revision=173659
Diffstat (limited to 'sys/amd64/amd64/exception.S')
-rw-r--r--sys/amd64/amd64/exception.S20
1 files changed, 19 insertions, 1 deletions
diff --git a/sys/amd64/amd64/exception.S b/sys/amd64/amd64/exception.S
index 20e8c3df7cff..da4918a4131a 100644
--- a/sys/amd64/amd64/exception.S
+++ b/sys/amd64/amd64/exception.S
@@ -187,10 +187,28 @@ alltraps_noen:
IDTVEC(dblfault)
subq $TF_ERR,%rsp
movq $T_DOUBLEFLT,TF_TRAPNO(%rsp)
+ movq $0,TF_ADDR(%rsp)
+ movq $0,TF_ERR(%rsp)
+ movq %rdi,TF_RDI(%rsp)
+ movq %rsi,TF_RSI(%rsp)
+ movq %rdx,TF_RDX(%rsp)
+ movq %rcx,TF_RCX(%rsp)
+ movq %r8,TF_R8(%rsp)
+ movq %r9,TF_R9(%rsp)
+ movq %rax,TF_RAX(%rsp)
+ movq %rbx,TF_RBX(%rsp)
+ movq %rbp,TF_RBP(%rsp)
+ movq %r10,TF_R10(%rsp)
+ movq %r11,TF_R11(%rsp)
+ movq %r12,TF_R12(%rsp)
+ movq %r13,TF_R13(%rsp)
+ movq %r14,TF_R14(%rsp)
+ movq %r15,TF_R15(%rsp)
testb $SEL_RPL_MASK,TF_CS(%rsp) /* Did we come from kernel? */
jz 1f /* already running with kernel GS.base */
swapgs
-1: call dblfault_handler
+1: movq %rsp, %rdi
+ call dblfault_handler
2: hlt
jmp 2b