MOS Source Code
Loading...
Searching...
No Matches
dma.c File Reference
#include "mos/mm/dma.h"
#include "mos/mm/mm.h"
#include "mos/mm/paging/paging.h"
#include "mos/mm/physical/pmm.h"
#include "mos/platform/platform.h"
#include "mos/syslog/printk.h"
#include <mos_string.h>
+ Include dependency graph for dma.c:

Go to the source code of this file.

Macros

#define pr_fmt(fmt)
 

Functions

static pfn_t dmabuf_do_allocate (size_t n_pages, bool do_ref)
 
pfn_t dmabuf_allocate (size_t n_pages, ptr_t *vaddr)
 Allocate DMA pages.
 
bool dmabuf_free (ptr_t vaddr, ptr_t paddr)
 
pfn_t dmabuf_share (void *buf, size_t size)
 
bool dmabuf_unshare (ptr_t phys, size_t size, void *buffer)
 

Macro Definition Documentation

◆ pr_fmt

#define pr_fmt ( fmt)
Value:
"dma: " fmt
u32 const char * fmt
Definition assert.h:36

Definition at line 3 of file dma.c.

Function Documentation

◆ dmabuf_do_allocate()

static pfn_t dmabuf_do_allocate ( size_t n_pages,
bool do_ref )
static

Definition at line 15 of file dma.c.

Referenced by dmabuf_allocate(), and dmabuf_share().

+ Here is the call graph for this function:

◆ dmabuf_allocate()

pfn_t dmabuf_allocate ( size_t n_pages,
ptr_t * pages )

Allocate DMA pages.

Parameters
n_pagesNumber of pages to allocate
pagesPointer to store the virtual address of the pages
Returns
physical frame number of the starting page

Definition at line 24 of file dma.c.

Referenced by dmabuf_alloc().

+ Here is the call graph for this function:

◆ dmabuf_free()

bool dmabuf_free ( ptr_t vaddr,
ptr_t paddr )

Definition at line 33 of file dma.c.

+ Here is the call graph for this function:

◆ dmabuf_share()

pfn_t dmabuf_share ( void * buf,
size_t size )

Definition at line 53 of file dma.c.

+ Here is the call graph for this function:

◆ dmabuf_unshare()

bool dmabuf_unshare ( ptr_t phys,
size_t size,
void * buffer )

Definition at line 63 of file dma.c.

+ Here is the call graph for this function: