From owner-svn-src-head@freebsd.org Sun Oct 4 09:39:41 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A24E0A0F833; Sun, 4 Oct 2015 09:39:41 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 744471306; Sun, 4 Oct 2015 09:39:41 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t949dfQd032051; Sun, 4 Oct 2015 09:39:41 GMT (envelope-from rwatson@FreeBSD.org) Received: (from rwatson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t949deA3032048; Sun, 4 Oct 2015 09:39:40 GMT (envelope-from rwatson@FreeBSD.org) Message-Id: <201510040939.t949deA3032048@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rwatson set sender to rwatson@FreeBSD.org using -f From: Robert Watson Date: Sun, 4 Oct 2015 09:39:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r288662 - in head/sys/arm: arm include 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.20 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, 04 Oct 2015 09:39:41 -0000 Author: rwatson Date: Sun Oct 4 09:39:40 2015 New Revision: 288662 URL: https://svnweb.freebsd.org/changeset/base/288662 Log: Add missing stack unwind information to several assembly functions on ARMv6/7: - Define _SAVE() macro to allow unwind data to be conditionally defined for ARM assembly code in the kernel. - Use _SAVE() to provide unwind information for bcopy_page(), and two (of many) instances of copyin() and copyout(). Reviewed by: andrew, imp MFC after: 3 days Sponsored by: University of Cambridge Modified: head/sys/arm/arm/bcopy_page.S head/sys/arm/arm/bcopyinout.S head/sys/arm/include/asm.h Modified: head/sys/arm/arm/bcopy_page.S ============================================================================== --- head/sys/arm/arm/bcopy_page.S Sun Oct 4 09:25:57 2015 (r288661) +++ head/sys/arm/arm/bcopy_page.S Sun Oct 4 09:39:40 2015 (r288662) @@ -75,7 +75,7 @@ __FBSDID("$FreeBSD$"); #endif /* ! COPY_CHUNK */ #ifndef SAVE_REGS -#define SAVE_REGS stmfd sp!, {r4-r8, lr} +#define SAVE_REGS stmfd sp!, {r4-r8, lr}; _SAVE({r4-r8, lr}) #define RESTORE_REGS ldmfd sp!, {r4-r8, pc} #endif @@ -134,6 +134,7 @@ END(bcopy_page) ENTRY(bzero_page) stmfd sp!, {r4-r8, lr} + _SAVE({r4-r8, lr}) #ifdef BIG_LOOPS mov r2, #(PAGE_SIZE >> 9) #else @@ -189,6 +190,7 @@ END(bzero_page) ENTRY(bcopy_page) pld [r0] stmfd sp!, {r4, r5} + _SAVE({r4, r5}) mov ip, #32 ldr r2, [r0], #0x04 /* 0x00 */ ldr r3, [r0], #0x04 /* 0x04 */ Modified: head/sys/arm/arm/bcopyinout.S ============================================================================== --- head/sys/arm/arm/bcopyinout.S Sun Oct 4 09:25:57 2015 (r288661) +++ head/sys/arm/arm/bcopyinout.S Sun Oct 4 09:39:40 2015 (r288662) @@ -68,7 +68,7 @@ __FBSDID("$FreeBSD$"); #endif -#define SAVE_REGS stmfd sp!, {r4-r11} +#define SAVE_REGS stmfd sp!, {r4-r11}; _SAVE({r4-r11}) #define RESTORE_REGS ldmfd sp!, {r4-r11} #if defined(_ARM_ARCH_5E) @@ -341,6 +341,7 @@ ENTRY(copyout) cmp r2, r3 blt .Lnormale stmfd sp!, {r0-r2, r4, lr} + _SAVE({r0-r2, r4, lr}) mov r3, r0 mov r0, r1 mov r1, r3 Modified: head/sys/arm/include/asm.h ============================================================================== --- head/sys/arm/include/asm.h Sun Oct 4 09:25:57 2015 (r288661) +++ head/sys/arm/include/asm.h Sun Oct 4 09:39:40 2015 (r288662) @@ -53,10 +53,12 @@ #define STOP_UNWINDING .cantunwind #define _FNSTART .fnstart #define _FNEND .fnend +#define _SAVE(...) .save __VA_ARGS__ #else #define STOP_UNWINDING #define _FNSTART #define _FNEND +#define _SAVE(...) #endif /*