svn commit: r250810 - head/sys/arm/arm

Andrew Turner andrew at FreeBSD.org
Sun May 19 16:25:10 UTC 2013


Author: andrew
Date: Sun May 19 16:25:09 2013
New Revision: 250810
URL: http://svnweb.freebsd.org/changeset/base/250810

Log:
  Add a comment explaining why stack_capture is empty for EABI and clang.
  
  While here add a comment pointing out that, while r11 is not the frame
  pointer on EABI as there is no frame pointer, it's value is unused so is
  safe.

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

Modified: head/sys/arm/arm/stack_machdep.c
==============================================================================
--- head/sys/arm/arm/stack_machdep.c	Sun May 19 16:06:43 2013	(r250809)
+++ head/sys/arm/arm/stack_machdep.c	Sun May 19 16:25:09 2013	(r250810)
@@ -36,6 +36,13 @@ __FBSDID("$FreeBSD$");
 #include <machine/pcb.h>
 #include <machine/stack.h>
 
+/*
+ * This code makes assumptions about the stack layout. These are correct
+ * when using APCS (the old ABI), but are no longer true with AAPCS and the
+ * ARM EABI. There is also an issue with clang and llvm when building for
+ * APCS where it lays out the stack incorrectly. Because of this we disable
+ * this when building for ARM EABI or when building with clang.
+ */
 static void
 stack_capture(struct stack *st, u_int32_t *frame)
 {
@@ -61,6 +68,11 @@ stack_save_td(struct stack *st, struct t
 	if (TD_IS_RUNNING(td))
 		panic("stack_save_td: running");
 
+	/*
+	 * This register, the frame pointer, is incorrect for the ARM EABI
+	 * as it doesn't have a frame pointer, however it's value is not used
+	 * when building for EABI.
+	 */
 	frame = (u_int32_t *)td->td_pcb->un_32.pcb32_r11;
 	stack_zero(st);
 	stack_capture(st, frame);


More information about the svn-src-head mailing list