From: Avik Sil Date: Mon, 19 Sep 2011 16:38:52 +0000 (-0400) Subject: ARM: Set bit 0 for thumb mode in kallsyms_lookup_name returned address (missing file) X-Git-Tag: v2.0-pre9~28 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=cab3c961c62a7b21cd2968aef37f24b4165bf800;p=lttng-modules.git ARM: Set bit 0 for thumb mode in kallsyms_lookup_name returned address (missing file) Adding missing file in commit c539a324b020171c10d0fcb100892ac93c17e9e7 Signed-off-by: Mathieu Desnoyers --- diff --git a/wrapper/kallsyms.h b/wrapper/kallsyms.h new file mode 100644 index 00000000..bb45f38a --- /dev/null +++ b/wrapper/kallsyms.h @@ -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 */