mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 05:50:53 +07:00
d2279c9d7f
No more print_symbol()/__print_symbol() users left, remove these symbols. It was a very old API that encouraged people use continuous lines. It had been obsoleted by %pS format specifier in a normal printk() call. Link: http://lkml.kernel.org/r/20180105102538.GC471@jagdpanzerIV Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Russell King <linux@armlinux.org.uk> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Mark Salter <msalter@redhat.com> Cc: Tony Luck <tony.luck@intel.com> Cc: David Howells <dhowells@redhat.com> Cc: Yoshinori Sato <ysato@users.sourceforge.jp> Cc: Guan Xuetao <gxt@mprc.pku.edu.cn> Cc: Borislav Petkov <bp@alien8.de> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Vineet Gupta <vgupta@synopsys.com> Cc: Fengguang Wu <fengguang.wu@intel.com> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: LKML <linux-kernel@vger.kernel.org> Cc: linux-arm-kernel@lists.infradead.org Cc: linux-c6x-dev@linux-c6x.org Cc: linux-ia64@vger.kernel.org Cc: linux-am33-list@redhat.com Cc: linux-sh@vger.kernel.org Cc: linux-edac@vger.kernel.org Cc: x86@kernel.org Cc: linux-snps-arc@lists.infradead.org Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> Suggested-by: Joe Perches <joe@perches.com> [pmladek@suse.com: updated commit message] Signed-off-by: Petr Mladek <pmladek@suse.com>
126 lines
3.1 KiB
C
126 lines
3.1 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/* Rewritten and vastly simplified by Rusty Russell for in-kernel
|
|
* module loader:
|
|
* Copyright 2002 Rusty Russell <rusty@rustcorp.com.au> IBM Corporation
|
|
*/
|
|
#ifndef _LINUX_KALLSYMS_H
|
|
#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)
|
|
|
|
#ifndef CONFIG_64BIT
|
|
# define KALLSYM_FMT "%08lx"
|
|
#else
|
|
# define KALLSYM_FMT "%016lx"
|
|
#endif
|
|
|
|
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);
|
|
|
|
/* Lookup an address. modname is set to NULL if it's in the kernel. */
|
|
const char *kallsyms_lookup(unsigned long addr,
|
|
unsigned long *symbolsize,
|
|
unsigned long *offset,
|
|
char **modname, char *namebuf);
|
|
|
|
/* Look up a kernel symbol and return it in a text buffer. */
|
|
extern int sprint_symbol(char *buffer, unsigned long address);
|
|
extern int sprint_symbol_no_offset(char *buffer, unsigned long address);
|
|
extern int sprint_backtrace(char *buffer, unsigned long address);
|
|
|
|
int lookup_symbol_name(unsigned long addr, char *symname);
|
|
int lookup_symbol_attrs(unsigned long addr, unsigned long *size, unsigned long *offset, char *modname, char *name);
|
|
|
|
/* How and when do we show kallsyms values? */
|
|
extern int kallsyms_show_value(void);
|
|
|
|
#else /* !CONFIG_KALLSYMS */
|
|
|
|
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)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline const char *kallsyms_lookup(unsigned long addr,
|
|
unsigned long *symbolsize,
|
|
unsigned long *offset,
|
|
char **modname, char *namebuf)
|
|
{
|
|
return NULL;
|
|
}
|
|
|
|
static inline int sprint_symbol(char *buffer, unsigned long addr)
|
|
{
|
|
*buffer = '\0';
|
|
return 0;
|
|
}
|
|
|
|
static inline int sprint_symbol_no_offset(char *buffer, unsigned long addr)
|
|
{
|
|
*buffer = '\0';
|
|
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;
|
|
}
|
|
|
|
static inline int lookup_symbol_attrs(unsigned long addr, unsigned long *size, unsigned long *offset, char *modname, char *name)
|
|
{
|
|
return -ERANGE;
|
|
}
|
|
|
|
static inline int kallsyms_show_value(void)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
#endif /*CONFIG_KALLSYMS*/
|
|
|
|
static inline void print_ip_sym(unsigned long ip)
|
|
{
|
|
printk("[<%p>] %pS\n", (void *) ip, (void *) ip);
|
|
}
|
|
|
|
#endif /*_LINUX_KALLSYMS_H*/
|