FreeBSD kernel kern code
subr_pcpu.c File Reference
#include <sys/cdefs.h>
#include "opt_ddb.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/sysctl.h>
#include <sys/lock.h>
#include <sys/malloc.h>
#include <sys/pcpu.h>
#include <sys/proc.h>
#include <sys/smp.h>
#include <sys/sx.h>
#include <ddb/ddb.h>
Include dependency graph for subr_pcpu.c:

Go to the source code of this file.

Data Structures

struct  dpcpu_free
 

Functions

 __FBSDID ("$BSDSUniX$")
 
static MALLOC_DEFINE (M_PCPU,"Per-cpu","Per-cpu resource accouting.")
 
static DPCPU_DEFINE (char, modspace[DPCPU_MODMIN])
 
static TAILQ_HEAD (dpcpu_free)
 
void dpcpu_init (void *dpcpu, int cpuid)
 
static void dpcpu_startup (void *dummy __unused)
 
 SYSINIT (dpcpu, SI_SUB_KLD, SI_ORDER_FIRST, dpcpu_startup, 0)
 
void * dpcpu_alloc (int size)
 
void dpcpu_free (void *s, int size)
 
void dpcpu_copy (void *s, int size)
 
void pcpu_destroy (struct pcpu *pcpu)
 
struct pcpu * pcpu_find (u_int cpuid)
 
int sysctl_dpcpu_quad (SYSCTL_HANDLER_ARGS)
 
int sysctl_dpcpu_long (SYSCTL_HANDLER_ARGS)
 
int sysctl_dpcpu_int (SYSCTL_HANDLER_ARGS)
 

Function Documentation

__FBSDID ( "$BSDSUniX$"  )
void* dpcpu_alloc ( int  size)

Definition at line 135 of file subr_pcpu.c.

References dpcpu_free::df_len, dpcpu_free::df_start, and free().

Referenced by link_elf_link_preload(), link_elf_load_file(), and parse_dpcpu().

Here is the call graph for this function:

Here is the caller graph for this function:

void dpcpu_copy ( void *  s,
int  size 
)

Definition at line 220 of file subr_pcpu.c.

References mp_ncpus.

Referenced by link_elf_link_preload(), link_elf_load_file(), and parse_dpcpu().

Here is the caller graph for this function:

static DPCPU_DEFINE ( char  ,
modspace  [DPCPU_MODMIN] 
)
static
void dpcpu_free ( void *  s,
int  size 
)

Definition at line 166 of file subr_pcpu.c.

References dpcpu_free::df_len, dpcpu_free::df_start, free(), malloc(), and start.

Referenced by link_elf_unload_file().

Here is the call graph for this function:

Here is the caller graph for this function:

void dpcpu_init ( void *  dpcpu,
int  cpuid 
)

Definition at line 98 of file subr_pcpu.c.

References pcpu_find().

Here is the call graph for this function:

static void dpcpu_startup ( void *dummy  __unused)
static

Definition at line 117 of file subr_pcpu.c.

References dpcpu_free::df_len, dpcpu_free::df_start, and malloc().

Here is the call graph for this function:

static MALLOC_DEFINE ( M_PCPU  ,
"Per-cpu"  ,
"Per-cpu resource accouting."   
)
static
void pcpu_destroy ( struct pcpu *  pcpu)

Definition at line 241 of file subr_pcpu.c.

struct pcpu* pcpu_find ( u_int  cpuid)

Definition at line 253 of file subr_pcpu.c.

Referenced by _rm_rlock_hard(), dpcpu_init(), read_cpu_time(), rm_cleanIPI(), sysctl_kern_cp_times(), tdq_setlowpri(), and witness_display_spinlock().

Here is the caller graph for this function:

int sysctl_dpcpu_int ( SYSCTL_HANDLER_ARGS  )

Definition at line 294 of file subr_pcpu.c.

References count, and mp_ncpus.

int sysctl_dpcpu_long ( SYSCTL_HANDLER_ARGS  )

Definition at line 277 of file subr_pcpu.c.

References count, and mp_ncpus.

int sysctl_dpcpu_quad ( SYSCTL_HANDLER_ARGS  )

Definition at line 260 of file subr_pcpu.c.

References count, and mp_ncpus.

SYSINIT ( dpcpu  ,
SI_SUB_KLD  ,
SI_ORDER_FIRST  ,
dpcpu_startup  ,
 
)
static TAILQ_HEAD ( dpcpu_free  )
static

Definition at line 73 of file subr_pcpu.c.