Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
kallsyms.c File Reference
#include <linux/kallsyms.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/seq_file.h>
#include <linux/fs.h>
#include <linux/kdb.h>
#include <linux/err.h>
#include <linux/proc_fs.h>
#include <linux/sched.h>
#include <linux/mm.h>
#include <linux/ctype.h>
#include <linux/slab.h>
#include <asm/sections.h>

Go to the source code of this file.

Data Structures

struct  kallsym_iter
 

Macros

#define all_var   0
 

Functions

const unsigned long
kallsyms_addresses[] 
__attribute__ ((weak))
 
const unsigned long
kallsyms_num_syms 
__attribute__ ((weak, section(".rodata")))
 
unsigned long kallsyms_lookup_name (const char *name)
 
 EXPORT_SYMBOL_GPL (kallsyms_lookup_name)
 
int kallsyms_on_each_symbol (int(*fn)(void *, const char *, struct module *, unsigned long), void *data)
 
 EXPORT_SYMBOL_GPL (kallsyms_on_each_symbol)
 
int kallsyms_lookup_size_offset (unsigned long addr, unsigned long *symbolsize, unsigned long *offset)
 
const charkallsyms_lookup (unsigned long addr, unsigned long *symbolsize, unsigned long *offset, char **modname, char *namebuf)
 
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)
 
int sprint_symbol (char *buffer, unsigned long address)
 
 EXPORT_SYMBOL_GPL (sprint_symbol)
 
int sprint_symbol_no_offset (char *buffer, unsigned long address)
 
 EXPORT_SYMBOL_GPL (sprint_symbol_no_offset)
 
int sprint_backtrace (char *buffer, unsigned long address)
 
void __print_symbol (const char *fmt, unsigned long address)
 
 EXPORT_SYMBOL (__print_symbol)
 
 device_initcall (kallsyms_init)
 

Macro Definition Documentation

#define all_var   0

Definition at line 32 of file kallsyms.c.

Function Documentation

const unsigned long kallsyms_addresses [] __attribute__ ( (weak)  )
read

read_persistent_clock - Return time from the persistent clock.

Weak dummy function for arches that do not yet support it. Reads the time from the battery backed persistent clock. Returns a timespec with tv_sec=0 and tv_nsec=0 if unsupported.

XXX - Do be sure to remove it once all arches implement it.

read_boot_clock - Return time of the system start.

Weak dummy function for arches that do not yet support it. Function to read the exact time the system has been started. Returns a timespec with tv_sec=0 and tv_nsec=0 if unsupported.

XXX - Do be sure to remove it once all arches implement it.

__iowrite32_copy - copy data to MMIO space, in 32-bit units : destination, in MMIO space (must be 32-bit aligned) : source (must be 32-bit aligned) : number of 32-bit quantities to copy

Copy data from kernel space to MMIO space, in units of 32 bits at a time. Order of access is not guaranteed, nor is a memory barrier performed afterwards.

__iowrite64_copy - copy data to MMIO space, in 64-bit or 32-bit units : destination, in MMIO space (must be 64-bit aligned) : source (must be 64-bit aligned) : number of 64-bit quantities to copy

Copy data from kernel space to MMIO space, in units of 32 or 64 bits at a time. Order of access is not guaranteed, nor is a memory barrier performed afterwards.

read_persistent_clock - Return time from the persistent clock.

Weak dummy function for arches that do not yet support it. Reads the time from the battery backed persistent clock. Returns a timespec with tv_sec=0 and tv_nsec=0 if unsupported.

XXX - Do be sure to remove it once all arches implement it.

read_boot_clock - Return time of the system start.

Weak dummy function for arches that do not yet support it. Function to read the exact time the system has been started. Returns a timespec with tv_sec=0 and tv_nsec=0 if unsupported.

XXX - Do be sure to remove it once all arches implement it.

__iowrite32_copy - copy data to MMIO space, in 32-bit units : destination, in MMIO space (must be 32-bit aligned) : source (must be 32-bit aligned) : number of 32-bit quantities to copy

Copy data from kernel space to MMIO space, in units of 32 bits at a time. Order of access is not guaranteed, nor is a memory barrier performed afterwards.

__iowrite64_copy - copy data to MMIO space, in 64-bit or 32-bit units : destination, in MMIO space (must be 64-bit aligned) : source (must be 64-bit aligned) : number of 64-bit quantities to copy

Copy data from kernel space to MMIO space, in units of 32 or 64 bits at a time. Order of access is not guaranteed, nor is a memory barrier performed afterwards.

get_user_pages_fast() - pin user pages in memory : starting user address : number of pages from start to pin : whether pages will be written to : array that receives pointers to the pages pinned. Should be at least nr_pages long.

Returns number of pages pinned. This may be fewer than the number requested. If nr_pages is 0 or negative, returns 0. If no pages were pinned, returns -errno.

get_user_pages_fast provides equivalent functionality to get_user_pages, operating on current and current->mm, with force=0 and vma=NULL. However unlike get_user_pages, it must be called without mmap_sem held.

get_user_pages_fast may take mmap_sem and page table locks, so no assumptions can be made about lack of locking. get_user_pages_fast is to be implemented in a way that is advantageous (vs get_user_pages()) when the user memory area is already faulted in and present in ptes. However if the pages have to be faulted in, it may turn out to be slightly slower so callers need to carefully consider what to use. On many architectures, get_user_pages_fast simply falls back to get_user_pages.

read_persistent_clock - Return time from the persistent clock.

Weak dummy function for arches that do not yet support it. Reads the time from the battery backed persistent clock. Returns a timespec with tv_sec=0 and tv_nsec=0 if unsupported.

XXX - Do be sure to remove it once all arches implement it.

read_boot_clock - Return time of the system start.

Weak dummy function for arches that do not yet support it. Function to read the exact time the system has been started. Returns a timespec with tv_sec=0 and tv_nsec=0 if unsupported.

XXX - Do be sure to remove it once all arches implement it.

__iowrite32_copy - copy data to MMIO space, in 32-bit units : destination, in MMIO space (must be 32-bit aligned) : source (must be 32-bit aligned) : number of 32-bit quantities to copy

Copy data from kernel space to MMIO space, in units of 32 bits at a time. Order of access is not guaranteed, nor is a memory barrier performed afterwards.

__iowrite64_copy - copy data to MMIO space, in 64-bit or 32-bit units : destination, in MMIO space (must be 64-bit aligned) : source (must be 64-bit aligned) : number of 64-bit quantities to copy

Copy data from kernel space to MMIO space, in units of 32 or 64 bits at a time. Order of access is not guaranteed, nor is a memory barrier performed afterwards.

get_user_pages_fast() - pin user pages in memory : starting user address : number of pages from start to pin : whether pages will be written to : array that receives pointers to the pages pinned. Should be at least nr_pages long.

Returns number of pages pinned. This may be fewer than the number requested. If nr_pages is 0 or negative, returns 0. If no pages were pinned, returns -errno.

get_user_pages_fast provides equivalent functionality to get_user_pages, operating on current and current->mm, with force=0 and vma=NULL. However unlike get_user_pages, it must be called without mmap_sem held.

get_user_pages_fast may take mmap_sem and page table locks, so no assumptions can be made about lack of locking. get_user_pages_fast is to be implemented in a way that is advantageous (vs get_user_pages()) when the user memory area is already faulted in and present in ptes. However if the pages have to be faulted in, it may turn out to be slightly slower so callers need to carefully consider what to use. On many architectures, get_user_pages_fast simply falls back to get_user_pages.

Definition at line 199 of file gumstix.c.

const unsigned long kallsyms_num_syms __attribute__ ( (weak, section(".rodata"))  )
void __print_symbol ( const char fmt,
unsigned long  address 
)

Definition at line 426 of file kallsyms.c.

device_initcall ( kallsyms_init  )
EXPORT_SYMBOL ( __print_symbol  )
EXPORT_SYMBOL_GPL ( kallsyms_lookup_name  )
EXPORT_SYMBOL_GPL ( kallsyms_on_each_symbol  )
EXPORT_SYMBOL_GPL ( sprint_symbol  )
EXPORT_SYMBOL_GPL ( sprint_symbol_no_offset  )
const char* kallsyms_lookup ( unsigned long  addr,
unsigned long symbolsize,
unsigned long offset,
char **  modname,
char namebuf 
)

Definition at line 284 of file kallsyms.c.

unsigned long kallsyms_lookup_name ( const char name)

Definition at line 172 of file kallsyms.c.

int kallsyms_lookup_size_offset ( unsigned long  addr,
unsigned long symbolsize,
unsigned long offset 
)

Definition at line 267 of file kallsyms.c.

int kallsyms_on_each_symbol ( int(*)(void *, const char *, struct module *, unsigned long fn,
void data 
)

Definition at line 188 of file kallsyms.c.

int lookup_symbol_attrs ( unsigned long  addr,
unsigned long size,
unsigned long offset,
char modname,
char name 
)

Definition at line 325 of file kallsyms.c.

int lookup_symbol_name ( unsigned long  addr,
char symname 
)

Definition at line 308 of file kallsyms.c.

int sprint_backtrace ( char buffer,
unsigned long  address 
)

sprint_backtrace - Look up a backtrace symbol and return it in a text buffer : buffer to be stored : address to lookup

This function is for stack backtrace and does the same thing as sprint_symbol() but with modified/decreased . If there is a tail-call to the function marked "noreturn", gcc optimized out code after the call so that the stack-saved return address could point outside of the caller. This function ensures that kallsyms will find the original caller by decreasing .

This function returns the number of bytes stored in .

Definition at line 420 of file kallsyms.c.

int sprint_symbol ( char buffer,
unsigned long  address 
)

sprint_symbol - Look up a kernel symbol and return it in a text buffer : buffer to be stored : address to lookup

This function looks up a kernel symbol with and stores its name, offset, size and module name to if possible. If no symbol was found, just saves its as is.

This function returns the number of bytes stored in .

Definition at line 383 of file kallsyms.c.

int sprint_symbol_no_offset ( char buffer,
unsigned long  address 
)

sprint_symbol_no_offset - Look up a kernel symbol and return it in a text buffer : buffer to be stored : address to lookup

This function looks up a kernel symbol with and stores its name and module name to if possible. If no symbol was found, just saves its as is.

This function returns the number of bytes stored in .

Definition at line 400 of file kallsyms.c.