paul@202 | 1 | /* |
paul@202 | 2 | * DMA-related memory allocation utility functions. |
paul@202 | 3 | * |
paul@264 | 4 | * Copyright (C) 2023, 2024 Paul Boddie <paul@boddie.org.uk> |
paul@202 | 5 | * |
paul@202 | 6 | * This program is free software; you can redistribute it and/or |
paul@202 | 7 | * modify it under the terms of the GNU General Public License as |
paul@202 | 8 | * published by the Free Software Foundation; either version 2 of |
paul@202 | 9 | * the License, or (at your option) any later version. |
paul@202 | 10 | * |
paul@202 | 11 | * This program is distributed in the hope that it will be useful, |
paul@202 | 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
paul@202 | 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
paul@202 | 14 | * GNU General Public License for more details. |
paul@202 | 15 | * |
paul@202 | 16 | * You should have received a copy of the GNU General Public License |
paul@202 | 17 | * along with this program; if not, write to the Free Software |
paul@202 | 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, |
paul@202 | 19 | * Boston, MA 02110-1301, USA |
paul@202 | 20 | */ |
paul@202 | 21 | |
paul@202 | 22 | #pragma once |
paul@202 | 23 | |
paul@202 | 24 | #include <l4/re/c/dma_space.h> |
paul@202 | 25 | #include <l4/sys/types.h> |
paul@202 | 26 | |
paul@264 | 27 | struct dma_region |
paul@264 | 28 | { |
paul@264 | 29 | unsigned int size; |
paul@264 | 30 | unsigned int align; |
paul@264 | 31 | l4_addr_t vaddr; |
paul@264 | 32 | l4re_dma_space_dma_addr_t paddr; |
paul@264 | 33 | l4_cap_idx_t mem; |
paul@264 | 34 | }; |
paul@264 | 35 | |
paul@202 | 36 | EXTERN_C_BEGIN |
paul@202 | 37 | |
paul@264 | 38 | long get_dma_region(unsigned long size, int align, struct dma_region *region); |
paul@202 | 39 | |
paul@202 | 40 | EXTERN_C_END |