svn commit: r211954 - projects/arm_eabi/sys/arm/arm

Andrew Turner andrew at FreeBSD.org
Sun Aug 29 02:42:03 UTC 2010


Author: andrew
Date: Sun Aug 29 02:42:03 2010
New Revision: 211954
URL: http://svn.freebsd.org/changeset/base/211954

Log:
  Align the stack to an 8 byte boundary as required by the AAPCS

Modified:
  projects/arm_eabi/sys/arm/arm/exception.S
  projects/arm_eabi/sys/arm/arm/vm_machdep.c

Modified: projects/arm_eabi/sys/arm/arm/exception.S
==============================================================================
--- projects/arm_eabi/sys/arm/arm/exception.S	Sat Aug 28 23:50:09 2010	(r211953)
+++ projects/arm_eabi/sys/arm/arm/exception.S	Sun Aug 29 02:42:03 2010	(r211954)
@@ -80,7 +80,9 @@ ASENTRY_NP(swi_entry)
 	PUSHFRAME
 
 	mov	r0, sp			/* Pass the frame to any function */
+	sub	sp, sp, #4
 	bl	_C_LABEL(swi_handler)	/* It's a SWI ! */
+	add	sp, sp, #4
 
 	DO_AST
 	PULLFRAME

Modified: projects/arm_eabi/sys/arm/arm/vm_machdep.c
==============================================================================
--- projects/arm_eabi/sys/arm/arm/vm_machdep.c	Sat Aug 28 23:50:09 2010	(r211953)
+++ projects/arm_eabi/sys/arm/arm/vm_machdep.c	Sun Aug 29 02:42:03 2010	(r211954)
@@ -391,6 +391,8 @@ 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 the frame is aligned to an 8 byte boundary */
+	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);


More information about the svn-src-projects mailing list