From owner-svn-src-projects@FreeBSD.ORG Fri Dec 20 15:57:16 2013 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9EF68E17; Fri, 20 Dec 2013 15:57:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8B249102E; Fri, 20 Dec 2013 15:57:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBKFvGdP020581; Fri, 20 Dec 2013 15:57:16 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBKFvG9d020578; Fri, 20 Dec 2013 15:57:16 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201312201557.rBKFvG9d020578@svn.freebsd.org> From: Andrew Turner Date: Fri, 20 Dec 2013 15:57:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r259653 - in projects/specific_leg/sys/arm: arm include X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Dec 2013 15:57:16 -0000 Author: andrew Date: Fri Dec 20 15:57:15 2013 New Revision: 259653 URL: http://svnweb.freebsd.org/changeset/base/259653 Log: Correctly allocate enough space on the stack for the boot params. As this bug can be hidden by the stack alignment use the stack pointer before we align the stack to help catch this if it happens again. Modified: projects/specific_leg/sys/arm/arm/locore.S projects/specific_leg/sys/arm/include/cpu.h Modified: projects/specific_leg/sys/arm/arm/locore.S ============================================================================== --- projects/specific_leg/sys/arm/arm/locore.S Fri Dec 20 15:46:24 2013 (r259652) +++ projects/specific_leg/sys/arm/arm/locore.S Fri Dec 20 15:57:15 2013 (r259653) @@ -211,10 +211,10 @@ mmu_done: ldr pc, .Lvirt_done virt_done: - mov r1, #20 /* loader info size is 20 bytes also second arg */ + mov r1, #28 /* loader info size is 28 bytes also second arg */ subs sp, sp, r1 /* allocate arm_boot_params struct on stack */ - bic sp, sp, #7 /* align stack to 8 bytes */ mov r0, sp /* loader info pointer is first arg */ + bic sp, sp, #7 /* align stack to 8 bytes */ str r1, [r0] /* Store length of loader info */ str r9, [r0, #4] /* Store r0 from boot loader */ str r8, [r0, #8] /* Store r1 from boot loader */ Modified: projects/specific_leg/sys/arm/include/cpu.h ============================================================================== --- projects/specific_leg/sys/arm/include/cpu.h Fri Dec 20 15:46:24 2013 (r259652) +++ projects/specific_leg/sys/arm/include/cpu.h Fri Dec 20 15:57:15 2013 (r259653) @@ -35,6 +35,11 @@ get_cyclecount(void) extern vm_offset_t vector_page; +/* + * Params passed into initarm. If you change the size of this you will + * need to update locore.S to allocate more memory on the stack before + * it calls initarm. + */ struct arm_boot_params { register_t abp_size; /* Size of this structure */ register_t abp_r0; /* r0 from the boot loader */