| 1 | /* @title: DMA */ |
|---|---|
| 2 | #pragma once |
| 3 | #include <types/types.h> |
| 4 | struct device; |
| 5 | |
| 6 | struct dma_region { |
| 7 | iova_t iova; /* address the device uses */ |
| 8 | void *virt; /* address the CPU uses */ |
| 9 | size_t size; |
| 10 | }; |
| 11 | |
| 12 | struct dma_region dma_alloc(struct device *dev, size_t size); |
| 13 | void dma_free(struct device *dev, struct dma_region region); |
| 14 |