Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/arm/include Add KMODTRAMPOLINE(name)
details: https://anonhg.NetBSD.org/src/rev/4de282a992d5
branches: trunk
changeset: 789120:4de282a992d5
user: matt <matt%NetBSD.org@localhost>
date: Wed Aug 07 17:09:50 2013 +0000
description:
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
diffstat:
sys/arch/arm/include/asm.h | 21 ++++++++++++++++++++-
1 files changed, 20 insertions(+), 1 deletions(-)
diffs (33 lines):
diff -r 9ed36259b204 -r 4de282a992d5 sys/arch/arm/include/asm.h
--- a/sys/arch/arm/include/asm.h Wed Aug 07 17:06:22 2013 +0000
+++ b/sys/arch/arm/include/asm.h Wed Aug 07 17:09:50 2013 +0000
@@ -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_ */
Home |
Main Index |
Thread Index |
Old Index