aboutsummaryrefslogtreecommitdiff
path: root/sys/riscv/include
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2021-10-01 18:53:12 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2021-10-01 18:53:12 +0000
commit0177102173f39e17366a32eb22653aeb5248c355 (patch)
tree7ad2b83e92832f9c07f83b209bda009a82a583a3 /sys/riscv/include
parentc76da1f01064b2b9a1903b30d4b4c444b85f8724 (diff)
downloadsrc-0177102173f39e17366a32eb22653aeb5248c355.tar.gz
src-0177102173f39e17366a32eb22653aeb5248c355.zip
arm64, riscv: Fix TRAF_PC() to return the PC, not the return address.
Reviewed by: mhorne Obtained from: CheriBSD Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D31969
Diffstat (limited to 'sys/riscv/include')
-rw-r--r--sys/riscv/include/cpu.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/riscv/include/cpu.h b/sys/riscv/include/cpu.h
index 79c6f730f2a6..453a6af1a0f8 100644
--- a/sys/riscv/include/cpu.h
+++ b/sys/riscv/include/cpu.h
@@ -41,7 +41,7 @@
#include <machine/cpufunc.h>
#include <machine/frame.h>
-#define TRAPF_PC(tfp) ((tfp)->tf_ra)
+#define TRAPF_PC(tfp) ((tfp)->tf_sepc)
#define TRAPF_USERMODE(tfp) (((tfp)->tf_sstatus & SSTATUS_SPP) == 0)
#define cpu_getstack(td) ((td)->td_frame->tf_sp)