aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrooks Davis <brooks@FreeBSD.org>2020-09-04 21:55:22 +0000
committerBrooks Davis <brooks@FreeBSD.org>2020-09-04 21:55:22 +0000
commit46b974a9dbc08c432385b68092b7e34b683c38e1 (patch)
tree032c024b973f6e02cd8cdb278f0c73941c26b049
parent29e1fceb733d3c7986b4286bf99f44b8d0b0821e (diff)
downloadsrc-46b974a9dbc08c432385b68092b7e34b683c38e1.tar.gz
src-46b974a9dbc08c432385b68092b7e34b683c38e1.zip
Round TF_SIZE up to the stack alignment (16-bytes).
The kernel adjusts the stack by TF_SIZE and the RISC-V ABI requires that it remain 16-byte aligned. Reported by: CHERI, jrtc27 Reviewed by: mhorne Obtained from: CheriBSD Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D26328
Notes
Notes: svn path=/head/; revision=365344
-rw-r--r--sys/riscv/riscv/genassym.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/riscv/riscv/genassym.c b/sys/riscv/riscv/genassym.c
index 5750cba3397e..ff5e8fa01ddf 100644
--- a/sys/riscv/riscv/genassym.c
+++ b/sys/riscv/riscv/genassym.c
@@ -87,7 +87,7 @@ ASSYM(TD_FRAME, offsetof(struct thread, td_frame));
ASSYM(TD_MD, offsetof(struct thread, td_md));
ASSYM(TD_LOCK, offsetof(struct thread, td_lock));
-ASSYM(TF_SIZE, sizeof(struct trapframe));
+ASSYM(TF_SIZE, roundup2(sizeof(struct trapframe), STACKALIGNBYTES + 1));
ASSYM(TF_RA, offsetof(struct trapframe, tf_ra));
ASSYM(TF_SP, offsetof(struct trapframe, tf_sp));
ASSYM(TF_GP, offsetof(struct trapframe, tf_gp));