Author: andrew
Date: Sat Jan 26 08:55:04 2013
New Revision: 245942
URL: http://svnweb.freebsd.org/changeset/base/245942

Log:
  Align td_frame as it will be placed into the sp register which must be
  8 byte aligned on ARM EABI.

Modified:
  head/sys/arm/arm/vm_machdep.c

Modified: head/sys/arm/arm/vm_machdep.c
==============================================================================
--- head/sys/arm/arm/vm_machdep.c       Sat Jan 26 05:27:00 2013        
(r245941)
+++ head/sys/arm/arm/vm_machdep.c       Sat Jan 26 08:55:04 2013        
(r245942)
@@ -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);
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to