diff options
author | andrew <andrew@FreeBSD.org> | 2013-01-26 08:55:04 +0000 |
---|---|---|
committer | andrew <andrew@FreeBSD.org> | 2013-01-26 08:55:04 +0000 |
commit | f0d9be20369e94230a8dc7583cbb7deb06c3c37d (patch) | |
tree | f757cc197c7f9a5387b3bb8596c4a0ea01dbdcc9 | |
parent | f20c120ed1307b652267aa8015ec6e7486d72297 (diff) | |
download | FreeBSD-src-f0d9be20369e94230a8dc7583cbb7deb06c3c37d.zip FreeBSD-src-f0d9be20369e94230a8dc7583cbb7deb06c3c37d.tar.gz |
Align td_frame as it will be placed into the sp register which must be
8 byte aligned on ARM EABI.
-rw-r--r-- | sys/arm/arm/vm_machdep.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/arm/arm/vm_machdep.c b/sys/arm/arm/vm_machdep.c index cc87bbe..22a209b 100644 --- a/sys/arm/arm/vm_machdep.c +++ b/sys/arm/arm/vm_machdep.c @@ -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); |