From 17dc82e99feb7c8a74c2f537636839ab86f57dd3 Mon Sep 17 00:00:00 2001 From: br Date: Tue, 24 May 2016 13:59:13 +0000 Subject: [PATCH] Store the original value of stack pointer to the exception frame (the value we had before supervisor exception occurred). This helps consumers (e.g. DTrace) to not proceed additional calculations. Sponsored by: DARPA, AFRL Sponsored by: HEIF5 --- sys/riscv/riscv/exception.S | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/riscv/riscv/exception.S b/sys/riscv/riscv/exception.S index 54f4c76aadc..c00094c3e91 100644 --- a/sys/riscv/riscv/exception.S +++ b/sys/riscv/riscv/exception.S @@ -93,7 +93,9 @@ __FBSDID("$FreeBSD$"); .if \el == 1 /* Store kernel sp */ - sd sp, (TF_SP)(sp) + li t1, TF_SIZE + add t0, sp, t1 + sd t0, (TF_SP)(sp) .else /* Store user sp */ csrr t0, sscratch -- 2.11.4.GIT