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