Align td_frame as it will be placed into the sp register which must be

8 byte aligned on ARM EABI.
This commit is contained in:
Andrew Turner 2013-01-26 08:55:04 +00:00
parent d92ed49c94
commit 494459b56b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=245942

View File

@ -398,6 +398,12 @@ cpu_thread_alloc(struct thread *td)
PAGE_SIZE) - 1;
td->td_frame = (struct trapframe *)
((u_int)td->td_kstack + USPACE_SVC_STACK_TOP - sizeof(struct pcb)) - 1;
/*
* Ensure td_frame is aligned to an 8 byte boundary as it will be
* placed into the stack pointer which must be 8 byte aligned in
* the ARM EABI.
*/
td->td_frame = (struct trapframe *)((u_int)td->td_frame & ~7);
#ifdef __XSCALE__
#ifndef CPU_XSCALE_CORE3
pmap_use_minicache(td->td_kstack, td->td_kstack_pages * PAGE_SIZE);