1 #ifndef _LTTNG_WRAPPER_KALLSYMS_H
2 #define _LTTNG_WRAPPER_KALLSYMS_H
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.
11 * Copyright (C) 2011 Avik Sil (avik.sil@linaro.org)
12 * Copyright (C) 2011-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
14 * This library is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU Lesser General Public
16 * License as published by the Free Software Foundation; only
17 * version 2.1 of the License.
19 * This library is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 * Lesser General Public License for more details.
24 * You should have received a copy of the GNU Lesser General Public
25 * License along with this library; if not, write to the Free Software
26 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
29 #include <linux/kallsyms.h>
32 * PowerPC ABIv1 needs KALLSYMS_ALL to get the function descriptor,
33 * which is needed to perform the function call.
35 #if defined(CONFIG_PPC64) && (!defined(_CALL_ELF) || _CALL_ELF < 2)
36 # ifndef CONFIG_KALLSYMS_ALL
37 # error "LTTng-modules requires CONFIG_KALLSYMS_ALL on PowerPC ABIv1"
42 unsigned long kallsyms_lookup_funcptr(const char *name
)
46 addr
= kallsyms_lookup_name(name
);
48 #ifdef CONFIG_THUMB2_KERNEL
50 addr
|= 1; /* set bit 0 in address for thumb mode */
57 unsigned long kallsyms_lookup_dataptr(const char *name
)
59 return kallsyms_lookup_name(name
);
61 #endif /* _LTTNG_WRAPPER_KALLSYMS_H */
This page took 0.033037 seconds and 5 git commands to generate.