From cab3c961c62a7b21cd2968aef37f24b4165bf800 Mon Sep 17 00:00:00 2001 From: Avik Sil Date: Mon, 19 Sep 2011 12:38:52 -0400 Subject: [PATCH] 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 --- wrapper/kallsyms.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 wrapper/kallsyms.h 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 */ -- 2.34.1