Rev 422 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
422 | giacomo | 1 | /* Rewritten and vastly simplified by Rusty Russell for in-kernel |
2 | * module loader: |
||
3 | * Copyright 2002 Rusty Russell <rusty@rustcorp.com.au> IBM Corporation |
||
4 | */ |
||
5 | #ifndef _LINUX_KALLSYMS_H |
||
6 | #define _LINUX_KALLSYMS_H |
||
7 | |||
8 | #include <linux/config.h> |
||
9 | |||
10 | #ifdef CONFIG_KALLSYMS |
||
11 | /* Lookup an address. modname is set to NULL if it's in the kernel. */ |
||
12 | const char *kallsyms_lookup(unsigned long addr, |
||
13 | unsigned long *symbolsize, |
||
14 | unsigned long *offset, |
||
15 | char **modname, char *namebuf); |
||
16 | |||
17 | /* Replace "%s" in format with address, if found */ |
||
18 | extern void __print_symbol(const char *fmt, unsigned long address); |
||
19 | |||
20 | #else /* !CONFIG_KALLSYMS */ |
||
21 | |||
22 | static inline const char *kallsyms_lookup(unsigned long addr, |
||
23 | unsigned long *symbolsize, |
||
24 | unsigned long *offset, |
||
25 | char **modname, char *namebuf) |
||
26 | { |
||
27 | return NULL; |
||
28 | } |
||
29 | |||
30 | /* Stupid that this does nothing, but I didn't create this mess. */ |
||
31 | #define __print_symbol(fmt, addr) |
||
32 | #endif /*CONFIG_KALLSYMS*/ |
||
33 | |||
34 | /* This macro allows us to keep printk typechecking */ |
||
35 | static void __check_printsym_format(const char *fmt, ...) |
||
36 | __attribute__((format(printf,1,2))); |
||
37 | static inline void __check_printsym_format(const char *fmt, ...) |
||
38 | { |
||
39 | } |
||
40 | |||
41 | #define print_symbol(fmt, addr) \ |
||
42 | do { \ |
||
43 | __check_printsym_format(fmt, ""); \ |
||
44 | __print_symbol(fmt, addr); \ |
||
45 | } while(0) |
||
46 | |||
47 | #endif /*_LINUX_KALLSYMS_H*/ |