1/* 2 * Copyright (c) 2014 ETH Zurich. 3 * All rights reserved. 4 * 5 * This file is distributed under the terms in the attached LICENSE file. 6 * If you do not find this file, copies can be found by writing to: 7 * ETH Zurich D-INFK, Universitaetsstrasse 6, CH-8092 Zurich. Attn: Systems Group. 8 */ 9 10#ifndef LIB_DMA_MEM_UTILS_H 11#define LIB_DMA_MEM_UTILS_H 12 13/* forward declaration */ 14struct dma_mem; 15 16/** 17 * \brief allocates and maps a memory region to be used for DMA purposes 18 * 19 * \param bytes minimum size of the memory region in bytes 20 * \param flags VREGION flags how the region gets mapped 21 * \param mem returns the mapping information 22 * 23 * \returns SYS_ERR_OK on success 24 * errval on error 25 */ 26errval_t dma_mem_alloc(size_t bytes, 27 vregion_flags_t flags, 28 struct dma_mem *mem); 29 30/** 31 * \brief tries to free the allocated memory region 32 * 33 * \returns SYS_ERR_OK on success 34 * errval on error 35 */ 36errval_t dma_mem_free(struct dma_mem *mem); 37 38#endif /* LIB_DMA_MEM_UTILS_H */ 39