]> nv-tegra.nvidia Code Review - linux-2.6.git/blobdiff - include/linux/kallsyms.h
regulator: Add support for RICOH PMIC RC5T583 regulator
[linux-2.6.git] / include / linux / kallsyms.h
index 82de2fb62cb71677cfbd876e34189b2b7b002779..0df513b7a9f8670674a491338852d9a5570f5186 100644 (file)
@@ -6,16 +6,24 @@
 #define _LINUX_KALLSYMS_H
 
 #include <linux/errno.h>
+#include <linux/kernel.h>
 #include <linux/stddef.h>
 
 #define KSYM_NAME_LEN 128
 #define KSYM_SYMBOL_LEN (sizeof("%s+%#lx/%#lx [%s]") + (KSYM_NAME_LEN - 1) + \
                         2*(BITS_PER_LONG*3/10) + (MODULE_NAME_LEN - 1) + 1)
 
+struct module;
+
 #ifdef CONFIG_KALLSYMS
 /* Lookup the address for a symbol. Returns 0 if not found. */
 unsigned long kallsyms_lookup_name(const char *name);
 
+/* Call a function on each kallsyms symbol in the core kernel */
+int kallsyms_on_each_symbol(int (*fn)(void *, const char *, struct module *,
+                                     unsigned long),
+                           void *data);
+
 extern int kallsyms_lookup_size_offset(unsigned long addr,
                                  unsigned long *symbolsize,
                                  unsigned long *offset);
@@ -28,6 +36,7 @@ const char *kallsyms_lookup(unsigned long addr,
 
 /* Look up a kernel symbol and return it in a text buffer. */
 extern int sprint_symbol(char *buffer, unsigned long address);
+extern int sprint_backtrace(char *buffer, unsigned long address);
 
 /* Look up a kernel symbol and print it to the kernel messages. */
 extern void __print_symbol(const char *fmt, unsigned long address);
@@ -42,6 +51,14 @@ static inline unsigned long kallsyms_lookup_name(const char *name)
        return 0;
 }
 
+static inline int kallsyms_on_each_symbol(int (*fn)(void *, const char *,
+                                                   struct module *,
+                                                   unsigned long),
+                                         void *data)
+{
+       return 0;
+}
+
 static inline int kallsyms_lookup_size_offset(unsigned long addr,
                                              unsigned long *symbolsize,
                                              unsigned long *offset)
@@ -63,6 +80,12 @@ static inline int sprint_symbol(char *buffer, unsigned long addr)
        return 0;
 }
 
+static inline int sprint_backtrace(char *buffer, unsigned long addr)
+{
+       *buffer = '\0';
+       return 0;
+}
+
 static inline int lookup_symbol_name(unsigned long addr, char *symname)
 {
        return -ERANGE;
@@ -83,16 +106,6 @@ __attribute__((format(printf,1,2)));
 static inline void __check_printsym_format(const char *fmt, ...)
 {
 }
-/* ia64 and ppc64 use function descriptors, which contain the real address */
-#if defined(CONFIG_IA64) || defined(CONFIG_PPC64)
-#define print_fn_descriptor_symbol(fmt, addr)          \
-do {                                           \
-       unsigned long *__faddr = (unsigned long*) addr;         \
-       print_symbol(fmt, __faddr[0]);          \
-} while (0)
-#else
-#define print_fn_descriptor_symbol(fmt, addr) print_symbol(fmt, addr)
-#endif
 
 static inline void print_symbol(const char *fmt, unsigned long addr)
 {
@@ -101,18 +114,9 @@ static inline void print_symbol(const char *fmt, unsigned long addr)
                       __builtin_extract_return_addr((void *)addr));
 }
 
-#ifndef CONFIG_64BIT
-#define print_ip_sym(ip)               \
-do {                                   \
-       printk("[<%08lx>]", ip);        \
-       print_symbol(" %s\n", ip);      \
-} while(0)
-#else
-#define print_ip_sym(ip)               \
-do {                                   \
-       printk("[<%016lx>]", ip);       \
-       print_symbol(" %s\n", ip);      \
-} while(0)
-#endif
+static inline void print_ip_sym(unsigned long ip)
+{
+       printk("[<%p>] %pS\n", (void *) ip, (void *) ip);
+}
 
 #endif /*_LINUX_KALLSYMS_H*/