FreeBSD kernel kern code
subr_busdma_bounce.c File Reference

Go to the source code of this file.

Data Structures

struct  bounce_page
 
struct  bounce_zone
 

Functions

static STAILQ_HEAD (bounce_zone)
 
static void init_bounce_pages (void *dummy __unused)
 
 SYSINIT (bpages, SI_SUB_LOCK, SI_ORDER_ANY, init_bounce_pages, NULL)
 
static struct sysctl_ctx_list * busdma_sysctl_tree (struct bounce_zone *bz)
 
static struct sysctl_oid * busdma_sysctl_tree_top (struct bounce_zone *bz)
 
static int alloc_bounce_zone (bus_dma_tag_t dmat)
 
static int alloc_bounce_pages (bus_dma_tag_t dmat, u_int numpages)
 
static int reserve_bounce_pages (bus_dma_tag_t dmat, bus_dmamap_t map, int commit)
 
static bus_addr_t add_bounce_page (bus_dma_tag_t dmat, bus_dmamap_t map, vm_offset_t vaddr, bus_addr_t addr, bus_size_t size)
 
static void free_bounce_page (bus_dma_tag_t dmat, struct bounce_page *bpage)
 
static void busdma_swi (void *dummy __unused)
 
static void start_busdma_swi (void *dummy __unused)
 
 SYSINIT (start_busdma_swi, SI_SUB_SOFTINTR, SI_ORDER_ANY, start_busdma_swi, NULL)
 

Variables

static struct mtx bounce_lock
 
static int total_bpages
 
static int busdma_zonecount
 

Function Documentation

◆ add_bounce_page()

static bus_addr_t add_bounce_page ( bus_dma_tag_t  dmat,
bus_dmamap_t  map,
vm_offset_t  vaddr,
bus_addr_t  addr,
bus_size_t  size 
)
static

◆ alloc_bounce_pages()

static int alloc_bounce_pages ( bus_dma_tag_t  dmat,
u_int  numpages 
)
static

Definition at line 239 of file subr_busdma_bounce.c.

References bounce_lock, bounce_page::busaddr, contigmalloc(), contigmalloc_domainset(), count, free(), malloc(), malloc_domainset(), total_bpages, and bounce_page::vaddr.

Here is the call graph for this function:

◆ alloc_bounce_zone()

static int alloc_bounce_zone ( bus_dma_tag_t  dmat)
static

Definition at line 152 of file subr_busdma_bounce.c.

References busdma_sysctl_tree(), busdma_sysctl_tree_top(), busdma_zonecount, malloc(), snprintf(), sysctl_ctx_free(), and sysctl_ctx_init().

Here is the call graph for this function:

◆ busdma_swi()

static void busdma_swi ( void *dummy  __unused)
static

Definition at line 411 of file subr_busdma_bounce.c.

References bounce_lock, and bus_dmamap_load_mem().

Referenced by start_busdma_swi().

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

◆ busdma_sysctl_tree()

static struct sysctl_ctx_list * busdma_sysctl_tree ( struct bounce_zone bz)
static

Definition at line 138 of file subr_busdma_bounce.c.

Referenced by alloc_bounce_zone().

Here is the caller graph for this function:

◆ busdma_sysctl_tree_top()

static struct sysctl_oid * busdma_sysctl_tree_top ( struct bounce_zone bz)
static

Definition at line 145 of file subr_busdma_bounce.c.

Referenced by alloc_bounce_zone().

Here is the caller graph for this function:

◆ free_bounce_page()

static void free_bounce_page ( bus_dma_tag_t  dmat,
struct bounce_page bpage 
)
static

Definition at line 372 of file subr_busdma_bounce.c.

References bounce_lock, bounce_page::busaddr, bounce_page::datacount, bounce_page::datavaddr, reserve_bounce_pages(), swi_sched(), and bounce_page::vaddr.

Here is the call graph for this function:

◆ init_bounce_pages()

static void init_bounce_pages ( void *dummy  __unused)
static

Definition at line 126 of file subr_busdma_bounce.c.

References bounce_lock, and total_bpages.

◆ reserve_bounce_pages()

static int reserve_bounce_pages ( bus_dma_tag_t  dmat,
bus_dmamap_t  map,
int  commit 
)
static

Definition at line 284 of file subr_busdma_bounce.c.

References bounce_lock.

Referenced by free_bounce_page().

Here is the caller graph for this function:

◆ STAILQ_HEAD()

static STAILQ_HEAD ( bounce_zone  )
static

Definition at line 87 of file subr_busdma_bounce.c.

◆ start_busdma_swi()

static void start_busdma_swi ( void *dummy  __unused)
static

Definition at line 431 of file subr_busdma_bounce.c.

References busdma_swi(), panic(), and swi_add().

Here is the call graph for this function:

◆ SYSINIT() [1/2]

SYSINIT ( bpages  ,
SI_SUB_LOCK  ,
SI_ORDER_ANY  ,
init_bounce_pages  ,
NULL   
)

◆ SYSINIT() [2/2]

SYSINIT ( start_busdma_swi  ,
SI_SUB_SOFTINTR  ,
SI_ORDER_ANY  ,
start_busdma_swi  ,
NULL   
)

Variable Documentation

◆ bounce_lock

◆ busdma_zonecount

int busdma_zonecount
static

Definition at line 85 of file subr_busdma_bounce.c.

Referenced by alloc_bounce_zone().

◆ total_bpages

int total_bpages
static

Definition at line 84 of file subr_busdma_bounce.c.

Referenced by alloc_bounce_pages(), and init_bounce_pages().