FreeBSD kernel kern code
kern_dump.c File Reference
#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/conf.h>
#include <sys/cons.h>
#include <sys/kdb.h>
#include <sys/kernel.h>
#include <sys/kerneldump.h>
#include <sys/malloc.h>
#include <sys/msgbuf.h>
#include <sys/proc.h>
#include <sys/watchdog.h>
#include <vm/vm.h>
#include <vm/vm_param.h>
#include <vm/vm_page.h>
#include <vm/vm_phys.h>
#include <vm/vm_dumpset.h>
#include <vm/pmap.h>
#include <machine/dump.h>
#include <machine/elf.h>
#include <machine/md_var.h>
#include <machine/pcb.h>
Include dependency graph for kern_dump.c:

Go to the source code of this file.

Macros

#define MD_ALIGN(x)   roundup2((off_t)(x), PAGE_SIZE)
 
#define PG2MB(pgs)   ((pgs + (1 << (20 - PAGE_SHIFT)) - 1) >> (20 - PAGE_SHIFT))
 

Functions

 __FBSDID ("$FreeBSD$")
 
 CTASSERT (sizeof(struct kerneldumpheader)==512)
 
void dumpsys_gen_pa_init (void)
 
struct dump_pa * dumpsys_gen_pa_next (struct dump_pa *mdp)
 
void dumpsys_gen_wbinv_all (void)
 
void dumpsys_gen_unmap_chunk (vm_paddr_t pa __unused, size_t chunk __unused, void *va __unused)
 
int dumpsys_gen_write_aux_headers (struct dumperinfo *di)
 
int dumpsys_buf_seek (struct dumperinfo *di, size_t sz)
 
int dumpsys_buf_write (struct dumperinfo *di, char *ptr, size_t sz)
 
int dumpsys_buf_flush (struct dumperinfo *di)
 
 CTASSERT (PAGE_SHIFT< 20)
 
int dumpsys_cb_dumpdata (struct dump_pa *mdp, int seqnr, void *arg)
 
int dumpsys_foreach_chunk (dumpsys_callback_t cb, void *arg)
 
static int cb_dumphdr (struct dump_pa *mdp, int seqnr, void *arg)
 
static int cb_size (struct dump_pa *mdp, int seqnr, void *arg)
 
int dumpsys_generic (struct dumperinfo *di)
 

Variables

static size_t fragsz
 
struct dump_pa dump_map [DUMPSYS_MD_PA_NPAIRS]
 
static off_t fileofs
 

Macro Definition Documentation

◆ MD_ALIGN

#define MD_ALIGN (   x)    roundup2((off_t)(x), PAGE_SIZE)

Definition at line 56 of file kern_dump.c.

◆ PG2MB

#define PG2MB (   pgs)    ((pgs + (1 << (20 - PAGE_SHIFT)) - 1) >> (20 - PAGE_SHIFT))

Definition at line 172 of file kern_dump.c.

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ cb_dumphdr()

static int cb_dumphdr ( struct dump_pa *  mdp,
int  seqnr,
void *  arg 
)
static

Definition at line 250 of file kern_dump.c.

References dumpsys_buf_write(), and fileofs.

Referenced by dumpsys_generic().

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

◆ cb_size()

static int cb_size ( struct dump_pa *  mdp,
int  seqnr,
void *  arg 
)
static

Definition at line 279 of file kern_dump.c.

Referenced by dumpsys_generic().

Here is the caller graph for this function:

◆ CTASSERT() [1/2]

CTASSERT ( )

◆ CTASSERT() [2/2]

CTASSERT ( sizeof(struct kerneldumpheader)  = =512)

◆ dumpsys_buf_flush()

int dumpsys_buf_flush ( struct dumperinfo *  di)

Definition at line 159 of file kern_dump.c.

References dump_append(), and fragsz.

Referenced by dumpsys_generic().

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

◆ dumpsys_buf_seek()

int dumpsys_buf_seek ( struct dumperinfo *  di,
size_t  sz 
)

Definition at line 114 of file kern_dump.c.

References buf, dump_append(), and nbytes.

Referenced by dumpsys_generic().

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

◆ dumpsys_buf_write()

int dumpsys_buf_write ( struct dumperinfo *  di,
char *  ptr,
size_t  sz 
)

Definition at line 135 of file kern_dump.c.

References dump_append(), and fragsz.

Referenced by cb_dumphdr(), and dumpsys_generic().

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

◆ dumpsys_cb_dumpdata()

int dumpsys_cb_dumpdata ( struct dump_pa *  mdp,
int  seqnr,
void *  arg 
)

Definition at line 175 of file kern_dump.c.

References cncheckc(), dump_append(), PG2MB, and printf().

Referenced by dumpsys_generic().

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

◆ dumpsys_foreach_chunk()

int dumpsys_foreach_chunk ( dumpsys_callback_t  cb,
void *  arg 
)

Definition at line 231 of file kern_dump.c.

Referenced by dumpsys_generic().

Here is the caller graph for this function:

◆ dumpsys_gen_pa_init()

void dumpsys_gen_pa_init ( void  )

Definition at line 65 of file kern_dump.c.

References dump_map.

◆ dumpsys_gen_pa_next()

struct dump_pa * dumpsys_gen_pa_next ( struct dump_pa *  mdp)

Definition at line 81 of file kern_dump.c.

References dump_map.

◆ dumpsys_gen_unmap_chunk()

void dumpsys_gen_unmap_chunk ( vm_paddr_t pa  __unused,
size_t chunk  __unused,
void *va  __unused 
)

Definition at line 100 of file kern_dump.c.

◆ dumpsys_gen_wbinv_all()

void dumpsys_gen_wbinv_all ( void  )

Definition at line 94 of file kern_dump.c.

◆ dumpsys_gen_write_aux_headers()

int dumpsys_gen_write_aux_headers ( struct dumperinfo *  di)

Definition at line 107 of file kern_dump.c.

◆ dumpsys_generic()

int dumpsys_generic ( struct dumperinfo *  di)

Variable Documentation

◆ dump_map

struct dump_pa dump_map[DUMPSYS_MD_PA_NPAIRS]

Definition at line 61 of file kern_dump.c.

Referenced by dumpsys_gen_pa_init(), and dumpsys_gen_pa_next().

◆ fileofs

off_t fileofs
static

Definition at line 247 of file kern_dump.c.

Referenced by cb_dumphdr(), and dumpsys_generic().

◆ fragsz

size_t fragsz
static

Definition at line 59 of file kern_dump.c.

Referenced by dumpsys_buf_flush(), and dumpsys_buf_write().