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 2013-01-26 08:55:04 +00:00
parent f20c120ed1
commit f0d9be2036

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