aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorFranck Bui-Huu <vagabon.xyz@gmail.com>2006-10-03 04:13:48 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-03 11:03:41 -0400
commitffc5089196446c08d9a005cf0dd7cab18d119606 (patch)
treee15925251553152f6859c354e34afe3adfcd1c64 /include
parent339b0c0813a257893fa84be999b9b85a50846dd8 (diff)
[PATCH] Create kallsyms_lookup_size_offset()
Some uses of kallsyms_lookup() do not need to find out the name of a symbol and its module's name it belongs. This is specially true in arch specific code, which needs to unwind the stack to show the back trace during oops (mips is an example). In this specific case, we just need to retreive the function's size and the offset of the active intruction inside it. Adds a new entry "kallsyms_lookup_size_offset()" This new entry does exactly the same as kallsyms_lookup() but does not require any buffers to store any names. It returns 0 if it fails otherwise 1. Signed-off-by: Franck Bui-Huu <vagabon.xyz@gmail.com> Cc: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/kallsyms.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h
index 849043ce4ed6..1cebcbc28b47 100644
--- a/include/linux/kallsyms.h
+++ b/include/linux/kallsyms.h
@@ -12,6 +12,10 @@
12/* Lookup the address for a symbol. Returns 0 if not found. */ 12/* Lookup the address for a symbol. Returns 0 if not found. */
13unsigned long kallsyms_lookup_name(const char *name); 13unsigned long kallsyms_lookup_name(const char *name);
14 14
15extern int kallsyms_lookup_size_offset(unsigned long addr,
16 unsigned long *symbolsize,
17 unsigned long *offset);
18
15/* Lookup an address. modname is set to NULL if it's in the kernel. */ 19/* Lookup an address. modname is set to NULL if it's in the kernel. */
16const char *kallsyms_lookup(unsigned long addr, 20const char *kallsyms_lookup(unsigned long addr,
17 unsigned long *symbolsize, 21 unsigned long *symbolsize,
@@ -28,6 +32,13 @@ static inline unsigned long kallsyms_lookup_name(const char *name)
28 return 0; 32 return 0;
29} 33}
30 34
35static inline int kallsyms_lookup_size_offset(unsigned long addr,
36 unsigned long *symbolsize,
37 unsigned long *offset)
38{
39 return 0;
40}
41
31static inline const char *kallsyms_lookup(unsigned long addr, 42static inline const char *kallsyms_lookup(unsigned long addr,
32 unsigned long *symbolsize, 43 unsigned long *symbolsize,
33 unsigned long *offset, 44 unsigned long *offset,