1/* 2 * Copyright 2017, Data61 3 * Commonwealth Scientific and Industrial Research Organisation (CSIRO) 4 * ABN 41 687 119 230. 5 * 6 * This software may be distributed and modified according to the terms of 7 * the GNU General Public License version 2. Note that NO WARRANTY is provided. 8 * See "LICENSE_GPLv2.txt" for details. 9 * 10 * @TAG(DATA61_GPL) 11 */ 12 13#pragma once 14 15#include <stdint.h> 16#include <platsupport/io.h> 17 18typedef struct dma_addr { 19 void *virt; 20 uintptr_t phys; 21}dma_addr_t; 22 23/* Small wrapper that does ps_dma_alloc and then ps_dma_pin */ 24dma_addr_t dma_alloc_pin(ps_dma_man_t *dma_man, size_t size, int cached, int alignment); 25 26/* Small wrapper than does ps_dma_unpin and then ps_dma_free */ 27void dma_unpin_free(ps_dma_man_t *dma_man, void *virt, size_t size); 28 29