Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 26 Jan 2013 08:55:04 +0000 (UTC)
From:      Andrew Turner <andrew@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r245942 - head/sys/arm/arm
Message-ID:  <201301260855.r0Q8t4Ik031333@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201301260855.r0Q8t4Ik031333>