Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 4 Oct 2015 09:39:40 +0000 (UTC)
From:      Robert Watson <rwatson@FreeBSD.org>
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
Message-ID:  <201510040939.t949deA3032048@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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
 
 /*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201510040939.t949deA3032048>