diff options
author | Ruslan Bukin <br@FreeBSD.org> | 2019-12-30 14:38:06 +0000 |
---|---|---|
committer | Ruslan Bukin <br@FreeBSD.org> | 2019-12-30 14:38:06 +0000 |
commit | f60da2efef260613915810432715651a6598dd7e (patch) | |
tree | 8a71da95fd3aa5914136516d4dc4b11c04a8857b | |
parent | d8f2b75559b5c1bc55e3d30393eb4d91b386aa64 (diff) | |
download | src-f60da2efef260613915810432715651a6598dd7e.tar.gz src-f60da2efef260613915810432715651a6598dd7e.zip |
Don't hard-code size of struct riscv_bootparams.
Submitted by: James Clarke <jrtc27@jrtc27.com>
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D22968
Notes
Notes:
svn path=/head/; revision=356203
-rw-r--r-- | sys/riscv/riscv/genassym.c | 3 | ||||
-rw-r--r-- | sys/riscv/riscv/locore.S | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/sys/riscv/riscv/genassym.c b/sys/riscv/riscv/genassym.c index f69a3b86470f..319b7b67aa37 100644 --- a/sys/riscv/riscv/genassym.c +++ b/sys/riscv/riscv/genassym.c @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include <machine/cpufunc.h> #include <machine/pte.h> #include <machine/intr.h> +#include <machine/machdep.h> ASSYM(KERNBASE, KERNBASE); ASSYM(VM_MAXUSER_ADDRESS, VM_MAXUSER_ADDRESS); @@ -98,3 +99,5 @@ ASSYM(TF_SEPC, offsetof(struct trapframe, tf_sepc)); ASSYM(TF_STVAL, offsetof(struct trapframe, tf_stval)); ASSYM(TF_SCAUSE, offsetof(struct trapframe, tf_scause)); ASSYM(TF_SSTATUS, offsetof(struct trapframe, tf_sstatus)); + +ASSYM(RISCV_BOOTPARAMS_SIZE, sizeof(struct riscv_bootparams)); diff --git a/sys/riscv/riscv/locore.S b/sys/riscv/riscv/locore.S index 5f08d23b2a2d..a1ec86243adf 100644 --- a/sys/riscv/riscv/locore.S +++ b/sys/riscv/riscv/locore.S @@ -188,7 +188,7 @@ va: mv sp, s3 /* Allocate space for thread0 PCB and riscv_bootparams */ - addi sp, sp, -(PCB_SIZE + 40) & ~STACKALIGNBYTES + addi sp, sp, -(PCB_SIZE + RISCV_BOOTPARAMS_SIZE) & ~STACKALIGNBYTES /* Clear BSS */ la s0, _C_LABEL(__bss_start) |