FreeBSD kernel kern code
subr_module.c File Reference
#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/linker.h>
#include <sys/sbuf.h>
#include <sys/sysctl.h>
#include <machine/metadata.h>
#include <vm/vm.h>
#include <vm/vm_extern.h>
Include dependency graph for subr_module.c:

Go to the source code of this file.

Macros

#define sbuf_print_vmoffset(sb, o)   sbuf_printf(sb, "0x%08x", o);
 

Functions

 __FBSDID ("$FreeBSD$")
 
caddr_t preload_search_by_name (const char *name)
 
caddr_t preload_search_by_type (const char *type)
 
caddr_t preload_search_next_name (caddr_t base)
 
caddr_t preload_search_info (caddr_t mod, int inf)
 
void preload_delete_name (const char *name)
 
void * preload_fetch_addr (caddr_t mod)
 
size_t preload_fetch_size (caddr_t mod)
 
void preload_bootstrap_relocate (vm_offset_t offset)
 
static void preload_modinfo_type (struct sbuf *sbp, int type)
 
static void preload_modinfo_value (struct sbuf *sbp, uint32_t *bptr, int type, int len)
 
static void preload_dump_internal (struct sbuf *sbp)
 
void preload_dump (void)
 
static int sysctl_preload_dump (SYSCTL_HANDLER_ARGS)
 
 SYSCTL_PROC (_debug, OID_AUTO, dump_modinfo, CTLTYPE_STRING|CTLFLAG_RD|CTLFLAG_MPSAFE, NULL, 0, sysctl_preload_dump, "A", "pretty-print the bootloader metadata")
 

Variables

vm_offset_t preload_addr_relocate = 0
 
caddr_t preload_metadata
 

Macro Definition Documentation

◆ sbuf_print_vmoffset

#define sbuf_print_vmoffset (   sb,
 
)    sbuf_printf(sb, "0x%08x", o);

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ preload_bootstrap_relocate()

void preload_bootstrap_relocate ( vm_offset_t  offset)

Definition at line 281 of file subr_module.c.

References preload_metadata.

◆ preload_delete_name()

void preload_delete_name ( const char *  name)

Definition at line 211 of file subr_module.c.

References addr, name, and preload_metadata.

Referenced by link_elf_unload_file(), and link_elf_unload_preload().

Here is the caller graph for this function:

◆ preload_dump()

void preload_dump ( void  )

Definition at line 538 of file subr_module.c.

References buf, preload_dump_internal(), sbuf_delete(), sbuf_finish(), sbuf_new(), sbuf_printf_drain(), and sbuf_set_drain().

Here is the call graph for this function:

◆ preload_dump_internal()

static void preload_dump_internal ( struct sbuf *  sbp)
static

Definition at line 504 of file subr_module.c.

References preload_metadata, preload_modinfo_type(), preload_modinfo_value(), sbuf_cat(), sbuf_printf(), sbuf_putc(), and type.

Referenced by preload_dump(), and sysctl_preload_dump().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ preload_fetch_addr()

void * preload_fetch_addr ( caddr_t  mod)

Definition at line 258 of file subr_module.c.

References preload_addr_relocate, and preload_search_info().

Referenced by prison0_init(), and sysctl_debug_tslog().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ preload_fetch_size()

size_t preload_fetch_size ( caddr_t  mod)

Definition at line 269 of file subr_module.c.

References preload_search_info().

Referenced by prison0_init(), and sysctl_debug_tslog().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ preload_modinfo_type()

static void preload_modinfo_type ( struct sbuf *  sbp,
int  type 
)
static

Definition at line 319 of file subr_module.c.

References sbuf_cat(), and type.

Referenced by preload_dump_internal().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ preload_modinfo_value()

static void preload_modinfo_value ( struct sbuf *  sbp,
uint32_t *  bptr,
int  type,
int  len 
)
static

Definition at line 439 of file subr_module.c.

References sbuf_cat(), sbuf_print_vmoffset, sbuf_printf(), and type.

Referenced by preload_dump_internal().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ preload_search_by_name()

caddr_t preload_search_by_name ( const char *  name)

Definition at line 56 of file subr_module.c.

References name, and preload_metadata.

Referenced by link_elf_link_preload().

Here is the caller graph for this function:

◆ preload_search_by_type()

caddr_t preload_search_by_type ( const char *  type)

Definition at line 87 of file subr_module.c.

References preload_metadata, and type.

Referenced by link_elf_init(), prison0_init(), and sysctl_debug_tslog().

Here is the caller graph for this function:

◆ preload_search_info()

caddr_t preload_search_info ( caddr_t  mod,
int  inf 
)

Definition at line 164 of file subr_module.c.

References type.

Referenced by link_elf_init(), link_elf_link_preload(), link_elf_preload_parse_symbols(), linker_preload(), preload_fetch_addr(), and preload_fetch_size().

Here is the caller graph for this function:

◆ preload_search_next_name()

caddr_t preload_search_next_name ( caddr_t  base)

Definition at line 123 of file subr_module.c.

References preload_metadata.

Referenced by linker_preload().

Here is the caller graph for this function:

◆ sysctl_preload_dump()

static int sysctl_preload_dump ( SYSCTL_HANDLER_ARGS  )
static

Definition at line 556 of file subr_module.c.

References preload_dump_internal(), preload_metadata, sbuf_delete(), sbuf_finish(), and sbuf_new_for_sysctl().

Here is the call graph for this function:

◆ SYSCTL_PROC()

SYSCTL_PROC ( _debug  ,
OID_AUTO  ,
dump_modinfo  ,
CTLTYPE_STRING|CTLFLAG_RD|  CTLFLAG_MPSAFE,
NULL  ,
,
sysctl_preload_dump  ,
"A"  ,
"pretty-print the bootloader metadata"   
)

Variable Documentation

◆ preload_addr_relocate

vm_offset_t preload_addr_relocate = 0

Definition at line 49 of file subr_module.c.

Referenced by preload_fetch_addr().

◆ preload_metadata