From owner-svn-src-head@FreeBSD.ORG Sun May 19 16:25:10 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4707E95A; Sun, 19 May 2013 16:25:10 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 39514F7A; Sun, 19 May 2013 16:25:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4JGPAmd038925; Sun, 19 May 2013 16:25:10 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4JGPA0o038924; Sun, 19 May 2013 16:25:10 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201305191625.r4JGPA0o038924@svn.freebsd.org> From: Andrew Turner Date: Sun, 19 May 2013 16:25:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250810 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 May 2013 16:25:10 -0000 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 #include +/* + * 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);