Commit | Line | Data |
---|---|---|
cab3c961 AS |
1 | #ifndef _LTT_WRAPPER_KALLSYMS_H |
2 | #define _LTT_WRAPPER_KALLSYMS_H | |
3 | ||
4 | /* | |
5 | * Copyright (C) 2011 Avik Sil (avik.sil@linaro.org) | |
6 | * | |
7 | * wrapper around kallsyms_lookup_name. Implements arch-dependent code for | |
8 | * arches where the address of the start of the function body is different | |
9 | * from the pointer which can be used to call the function, e.g. ARM THUMB2. | |
10 | * | |
11 | * Dual LGPL v2.1/GPL v2 license. | |
12 | */ | |
13 | ||
14 | static inline | |
15 | unsigned long kallsyms_lookup_funcptr(const char *name) | |
16 | { | |
17 | unsigned long addr; | |
18 | ||
19 | addr = kallsyms_lookup_name(name); | |
20 | #ifdef CONFIG_ARM | |
21 | #ifdef CONFIG_THUMB2_KERNEL | |
22 | if (addr) | |
23 | addr |= 1; /* set bit 0 in address for thumb mode */ | |
24 | #endif | |
25 | #endif | |
26 | return addr; | |
27 | } | |
28 | #endif /* _LTT_WRAPPER_KALLSYMS_H */ |