ARM: Set bit 0 for thumb mode in kallsyms_lookup_name returned address (missing file)
authorAvik Sil <avik.sil@linaro.org>
Mon, 19 Sep 2011 16:38:52 +0000 (12:38 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 19 Sep 2011 16:38:52 +0000 (12:38 -0400)
Adding missing file in commit c539a324b020171c10d0fcb100892ac93c17e9e7

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
wrapper/kallsyms.h [new file with mode: 0644]

diff --git a/wrapper/kallsyms.h b/wrapper/kallsyms.h
new file mode 100644 (file)
index 0000000..bb45f38
--- /dev/null
@@ -0,0 +1,28 @@
+#ifndef _LTT_WRAPPER_KALLSYMS_H
+#define _LTT_WRAPPER_KALLSYMS_H
+
+/*
+ * Copyright (C) 2011 Avik Sil (avik.sil@linaro.org)
+ *
+ * wrapper around kallsyms_lookup_name. Implements arch-dependent code for
+ * arches where the address of the start of the function body is different
+ * from the pointer which can be used to call the function, e.g. ARM THUMB2.
+ *
+ * Dual LGPL v2.1/GPL v2 license.
+ */
+
+static inline
+unsigned long kallsyms_lookup_funcptr(const char *name)
+{
+       unsigned long addr;
+
+       addr = kallsyms_lookup_name(name);
+#ifdef CONFIG_ARM
+#ifdef CONFIG_THUMB2_KERNEL
+       if (addr)
+               addr |= 1; /* set bit 0 in address for thumb mode */
+#endif
+#endif
+       return addr;
+}
+#endif /* _LTT_WRAPPER_KALLSYMS_H */
This page took 0.026481 seconds and 4 git commands to generate.