1// SPDX-License-Identifier: GPL-3.0-or-later
2
3#pragma once
4
5#include <mos/types.h>
6
7/**
8 * @brief Allocate DMA pages
9 *
10 * @param n_pages Number of pages to allocate
11 * @param pages Pointer to store the virtual address of the pages
12 * @return physical frame number of the starting page
13 */
14pfn_t dmabuf_allocate(size_t n_pages, ptr_t *pages);
15
16bool dmabuf_free(ptr_t vaddr, ptr_t paddr);
17
18pfn_t dmabuf_share(void *buffer, size_t size);
19
20bool dmabuf_unshare(ptr_t phys, size_t size, void *virt);
21