3#define pr_fmt(fmt) "dma: " fmt
#define MOS_ADDR_USER_MMAP
pfn_t dmabuf_share(void *buf, size_t size)
bool dmabuf_free(ptr_t vaddr, ptr_t paddr)
static pfn_t dmabuf_do_allocate(size_t n_pages, bool do_ref)
bool dmabuf_unshare(ptr_t phys, size_t size, void *buffer)
pfn_t dmabuf_allocate(size_t n_pages, ptr_t *vaddr)
Allocate DMA pages.
#define phyframe_va(frame)
vmap_t * vmap_obtain(mm_context_t *mmctx, ptr_t vaddr, size_t *out_offset)
Get the vmap object for a virtual address.
void vmap_destroy(vmap_t *vmap)
Destroy a vmap object, and unmmap the region.
vmap_t * mm_map_user_pages(mm_context_t *mmctx, ptr_t vaddr, pfn_t pfn, size_t npages, vm_flags flags, valloc_flags vaflags, vmap_type_t type, vmap_content_t content)
@ VALLOC_DEFAULT
Default allocation flags.
#define pfn_phyframe(pfn)
#define pmm_ref(thing, npages)
#define phyframe_pfn(frame)
void pmm_free_frames(phyframe_t *start_frame, size_t n_pages)
phyframe_t * pmm_allocate_frames(size_t n_frames, pmm_allocation_flags_t flags)
Allocate n_frames of contiguous physical memory.
@ PMM_ALLOC_NORMAL
allocate normal pages
#define ALIGN_UP_TO_PAGE(addr)
static void * memcpy(void *s1, const void *s2, size_t n)
static void * memset(void *s, int c, size_t n)
#define pr_dinfo2(feat, fmt,...)
#define spinlock_acquire(lock)
#define spinlock_release(lock)