blob: 7d320d76ed26d2cf76c04eb1ef465af9c98b3799 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
/*
* (C) COPYRIGHT ARM Limited. All rights reserved.
*
* This program is free software and is provided to you under the terms of the
* GNU General Public License version 2 as published by the Free Software
* Foundation, and any use by you of this program is subject to the terms
* of such GNU licence.
*
* A copy of the licence is included with the program, and can also be obtained
* from Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*
*/
#ifndef MVE_RSRC_MEM_DMA_UNCACHED_H
#define MVE_RSRC_MEM_DMA_UNCACHED_H
#include "mve_rsrc_mem_dma.h"
/**
* Allocate uncached memory.
* @param size Number of bytes to allocate
* @return Handle to the allocated memory
*/
struct mve_rsrc_dma_mem_t *mve_rsrc_dma_mem_alloc_uncached(uint32_t size);
/**
* Free uncached memory.
* @param mem Handle to the memory to free
*/
void mve_rsrc_dma_mem_free_uncached(struct mve_rsrc_dma_mem_t *mem);
/**
* Clean the CPU cache for the memory region pointed out by the supplied handle.
* @param mem Handle to the memory
*/
void mve_rsrc_dma_mem_clean_cache_uncached(struct mve_rsrc_dma_mem_t *mem);
/**
* Invalidate the CPU cache for the memory region pointed out by the supplied handle.
* @param mem Handle to the memory
*/
void mve_rsrc_dma_mem_invalidate_cache_uncached(struct mve_rsrc_dma_mem_t *mem);
/**
* Map a uncached memory region into CPU address space.
* @param mem Handle to the memory to map
* @return Virtual CPU address
*/
void *mve_rsrc_dma_mem_map_uncached(struct mve_rsrc_dma_mem_t *mem);
/**
* Unmap a uncached memory region from the CPU address space.
* @param mem Handle to the memory
*/
void mve_rsrc_dma_mem_unmap_unchached(struct mve_rsrc_dma_mem_t *mem);
/**
* Get the address of the physical pages comprising the memory region pointed out by the supplied
* handle.
* @param mem Handle to the memory
* @return Array of physical addresses. Do not free this array!
*/
phys_addr_t *mve_rsrc_dma_mem_get_pages_uncached(struct mve_rsrc_dma_mem_t *mem);
#endif /* MVE_RSRC_MEM_DMA_UNCACHED_H */
|