Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 29 Aug 2010 02:42:03 +0000 (UTC)
From:      Andrew Turner <andrew@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r211954 - projects/arm_eabi/sys/arm/arm
Message-ID:  <201008290242.o7T2g3U0050411@svn.freebsd.org>

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



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