Generate the offsets for struct arm64_bootparams and use it in locore.S
This removes one place with hard coded offsets in locore.S Sponsored by: Innovate UK
This commit is contained in:
parent
465454ebad
commit
15f8f7200f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=358545
@ -34,8 +34,18 @@ __FBSDID("$FreeBSD$");
|
||||
#include <sys/proc.h>
|
||||
|
||||
#include <machine/frame.h>
|
||||
#include <machine/machdep.h>
|
||||
#include <machine/pcb.h>
|
||||
|
||||
/* Sizeof arm64_bootparams, rounded to keep stack alignment */
|
||||
ASSYM(BOOTPARAMS_SIZE, roundup2(sizeof(struct arm64_bootparams),
|
||||
STACKALIGNBYTES + 1));
|
||||
ASSYM(BP_MODULEP, offsetof(struct arm64_bootparams, modulep));
|
||||
ASSYM(BP_KERN_L1PT, offsetof(struct arm64_bootparams, kern_l1pt));
|
||||
ASSYM(BP_KERN_DELTA, offsetof(struct arm64_bootparams, kern_delta));
|
||||
ASSYM(BP_KERN_STACK, offsetof(struct arm64_bootparams, kern_stack));
|
||||
ASSYM(BP_KERN_L0PT, offsetof(struct arm64_bootparams,kern_l0pt));
|
||||
|
||||
ASSYM(TDF_ASTPENDING, TDF_ASTPENDING);
|
||||
ASSYM(TDF_NEEDRESCHED, TDF_NEEDRESCHED);
|
||||
|
||||
|
@ -153,18 +153,18 @@ virtdone:
|
||||
sub x26, x26, x29
|
||||
sub x24, x24, x29
|
||||
|
||||
sub sp, sp, #(64 * 4)
|
||||
sub sp, sp, #BOOTPARAMS_SIZE
|
||||
mov x0, sp
|
||||
|
||||
/* Degate the delda so it is VA -> PA */
|
||||
neg x29, x29
|
||||
|
||||
str x1, [x0] /* modulep */
|
||||
str x26, [x0, 8] /* kern_l1pt */
|
||||
str x29, [x0, 16] /* kern_delta */
|
||||
str x1, [x0, #BP_MODULEP]
|
||||
str x26, [x0, #BP_KERN_L1PT]
|
||||
str x29, [x0, #BP_KERN_DELTA]
|
||||
adr x25, initstack
|
||||
str x25, [x0, 24] /* kern_stack */
|
||||
str x24, [x0, 32] /* kern_l0pt */
|
||||
str x25, [x0, #BP_KERN_STACK]
|
||||
str x24, [x0, #BP_KERN_L0PT]
|
||||
|
||||
/* trace back starts here */
|
||||
mov fp, #0
|
||||
|
Loading…
Reference in New Issue
Block a user