Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/modules/arch/arm awk support scripts to generate trampol...



details:   https://anonhg.NetBSD.org/src/rev/9ed36259b204
branches:  trunk
changeset: 789119:9ed36259b204
user:      matt <matt%NetBSD.org@localhost>
date:      Wed Aug 07 17:06:22 2013 +0000

description:
awk support scripts to generate trampolines in modules.
(adapted from previous LKM method).
<machine/asm.h> now has a KMODTRAMPOLINE macro to generate the trampoline

diffstat:

 sys/modules/arch/arm/kmodhide.awk  |   5 +++++
 sys/modules/arch/arm/kmodtramp.awk |  18 ++++++++++++++++++
 sys/modules/arch/arm/kmodwrap.awk  |  10 ++++++++++
 3 files changed, 33 insertions(+), 0 deletions(-)

diffs (45 lines):

diff -r a7fc7806860d -r 9ed36259b204 sys/modules/arch/arm/kmodhide.awk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/modules/arch/arm/kmodhide.awk Wed Aug 07 17:06:22 2013 +0000
@@ -0,0 +1,5 @@
+#      $NetBSD: kmodhide.awk,v 1.1 2013/08/07 17:06:22 matt Exp $
+
+substr($NF, 1, 7) == "__wrap_" {
+       print " --localize-symbol "$NF;
+}
diff -r a7fc7806860d -r 9ed36259b204 sys/modules/arch/arm/kmodtramp.awk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/modules/arch/arm/kmodtramp.awk        Wed Aug 07 17:06:22 2013 +0000
@@ -0,0 +1,18 @@
+#      $NetBSD: kmodtramp.awk,v 1.1 2013/08/07 17:06:22 matt Exp $
+#
+BEGIN {
+       print "#include <machine/asm.h>"
+}
+
+$2 == "R_ARM_PC24" || $2 == "R_ARM_CALL" || $2 == "R_ARM_JUMP24" {
+       if (x[$3] != "")
+               next;
+       if (index($3, ".text") > 0)
+               next;
+       fn=$3
+       sub("__wrap_", "", fn)
+       if (fn == $3)
+               next;
+       print "KMODTRAMPOLINE("fn")"
+       x[$3]=".";
+}
diff -r a7fc7806860d -r 9ed36259b204 sys/modules/arch/arm/kmodwrap.awk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/modules/arch/arm/kmodwrap.awk Wed Aug 07 17:06:22 2013 +0000
@@ -0,0 +1,10 @@
+#      $NetBSD: kmodwrap.awk,v 1.1 2013/08/07 17:06:22 matt Exp $
+
+$2 == "R_ARM_PC24" || $2 == "R_ARM_CALL" || $2 == "R_ARM_JUMP24" {
+       if (x[$3] != "")
+               next;
+       if (index($3, ".text") > 0)
+               next
+       printf " --wrap="$3;
+       x[$3]=".";
+}



Home | Main Index | Thread Index | Old Index