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 | */ |
14 | pfn_t dmabuf_allocate(size_t n_pages, ptr_t *pages); |
15 | |
16 | bool dmabuf_free(ptr_t vaddr, ptr_t paddr); |
17 | |
18 | pfn_t dmabuf_share(void *buffer, size_t size); |
19 | |
20 | bool dmabuf_unshare(ptr_t phys, size_t size, void *virt); |
21 | |