Commit | Line | Data |
---|---|---|
c11e391d DV |
1 | /* |
2 | * Framework for buffer objects that can be shared across devices/subsystems. | |
3 | * | |
4 | * Copyright(C) 2015 Intel Ltd | |
5 | * | |
6 | * This program is free software; you can redistribute it and/or modify it | |
7 | * under the terms of the GNU General Public License version 2 as published by | |
8 | * the Free Software Foundation. | |
9 | * | |
10 | * This program is distributed in the hope that it will be useful, but WITHOUT | |
11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | |
13 | * more details. | |
14 | * | |
15 | * You should have received a copy of the GNU General Public License along with | |
16 | * this program. If not, see <http://www.gnu.org/licenses/>. | |
17 | */ | |
18 | ||
19 | #ifndef _DMA_BUF_UAPI_H_ | |
20 | #define _DMA_BUF_UAPI_H_ | |
21 | ||
22 | #include <linux/types.h> | |
23 | ||
24 | /* begin/end dma-buf functions used for userspace mmap. */ | |
25 | struct dma_buf_sync { | |
26 | __u64 flags; | |
27 | }; | |
28 | ||
29 | #define DMA_BUF_SYNC_READ (1 << 0) | |
30 | #define DMA_BUF_SYNC_WRITE (2 << 0) | |
31 | #define DMA_BUF_SYNC_RW (DMA_BUF_SYNC_READ | DMA_BUF_SYNC_WRITE) | |
32 | #define DMA_BUF_SYNC_START (0 << 2) | |
33 | #define DMA_BUF_SYNC_END (1 << 2) | |
34 | #define DMA_BUF_SYNC_VALID_FLAGS_MASK \ | |
35 | (DMA_BUF_SYNC_RW | DMA_BUF_SYNC_END) | |
36 | ||
37 | #define DMA_BUF_BASE 'b' | |
38 | #define DMA_BUF_IOCTL_SYNC _IOW(DMA_BUF_BASE, 0, struct dma_buf_sync) | |
39 | ||
40 | #endif |