Date: Sun, 19 May 2013 16:25:10 +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: r250810 - head/sys/arm/arm Message-ID: <201305191625.r4JGPA0o038924@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201305191625.r4JGPA0o038924>