Module Name:    src
Committed By:   matt
Date:           Wed Aug  7 17:09:50 UTC 2013

Modified Files:
        src/sys/arch/arm/include: asm.h

Log Message:
Add KMODTRAMPOLINE(name)
There are 3 variations:
one for armv7 using movw ip,#:lower16:func; movt ip,#:upper16:func; bx ip
one for armv4t+ using ldr ip, pc; bx ip; .word func
one for everything else using ldr pc, [pc, #-4]; .word func


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/arm/include/asm.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/include/asm.h
diff -u src/sys/arch/arm/include/asm.h:1.17 src/sys/arch/arm/include/asm.h:1.18
--- src/sys/arch/arm/include/asm.h:1.17	Mon Jan 28 23:47:38 2013
+++ src/sys/arch/arm/include/asm.h	Wed Aug  7 17:09:50 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: asm.h,v 1.17 2013/01/28 23:47:38 matt Exp $	*/
+/*	$NetBSD: asm.h,v 1.18 2013/08/07 17:09:50 matt Exp $	*/
 
 /*
  * Copyright (c) 1990 The Regents of the University of California.
@@ -178,4 +178,23 @@
 # define RETc(c)	__CONCAT(mov,c)	pc, lr
 #endif
 
+#ifdef _ARM_ARCH_7
+#define KMODTRAMPOLINE(n)			\
+_ENTRY(__wrap_ ## n)				\
+	movw	ip, #:lower16:n;	\
+	movt	ip, #:upper16:n;	\
+	bx	ip
+#elif defined(_ARM_ARCH_4T)
+#define KMODTRAMPOLINE(n)	\
+_ENTRY(__wrap_ ## n)		\
+	ldr	ip, [pc];	\
+	bx	ip;		\
+	.word	n
+#else
+#define KMODTRAMPOLINE(n)	\
+_ENTRY(__wrap_ ## n)		\
+	ldr	pc, [pc, #-4];	\
+	.word	n
+#endif
+
 #endif /* !_ARM_ASM_H_ */

Reply via email to