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

(cherry picked from commit 0177102173)
This commit is contained in:
John Baldwin 2021-10-01 11:53:12 -07:00
parent 05504819e3
commit c8c2d908dd
2 changed files with 2 additions and 2 deletions

View File

@ -45,7 +45,7 @@
#include <machine/frame.h>
#include <machine/armreg.h>
#define TRAPF_PC(tfp) ((tfp)->tf_lr)
#define TRAPF_PC(tfp) ((tfp)->tf_elr)
#define TRAPF_USERMODE(tfp) (((tfp)->tf_spsr & PSR_M_MASK) == PSR_M_EL0t)
#define cpu_getstack(td) ((td)->td_frame->tf_sp)

View File

@ -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)