2 * drivers/staging/android/uapi/ion.h
4 * Copyright (C) 2011 Google, Inc.
6 * This software is licensed under the terms of the GNU General Public
7 * License version 2, as published by the Free Software Foundation, and
8 * may be copied, distributed, and modified under those terms.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
17 #ifndef _UAPI_LINUX_ION_TEST_H
18 #define _UAPI_LINUX_ION_TEST_H
20 #include <linux/ioctl.h>
21 #include <linux/types.h>
24 * struct ion_test_rw_data - metadata passed to the kernel to read handle
25 * @ptr: a pointer to an area at least as large as size
26 * @offset: offset into the ion buffer to start reading
27 * @size: size to read or write
28 * @write: 1 to write, 0 to read
30 struct ion_test_rw_data {
38 #define ION_IOC_MAGIC 'I'
41 * DOC: ION_IOC_TEST_SET_DMA_BUF - attach a dma buf to the test driver
43 * Attaches a dma buf fd to the test driver. Passing a second fd or -1 will
44 * release the first fd.
46 #define ION_IOC_TEST_SET_FD \
47 _IO(ION_IOC_MAGIC, 0xf0)
50 * DOC: ION_IOC_TEST_DMA_MAPPING - read or write memory from a handle as DMA
52 * Reads or writes the memory from a handle using an uncached mapping. Can be
53 * used by unit tests to emulate a DMA engine as close as possible. Only
54 * expected to be used for debugging and testing, may not always be available.
56 #define ION_IOC_TEST_DMA_MAPPING \
57 _IOW(ION_IOC_MAGIC, 0xf1, struct ion_test_rw_data)
60 * DOC: ION_IOC_TEST_KERNEL_MAPPING - read or write memory from a handle
62 * Reads or writes the memory from a handle using a kernel mapping. Can be
63 * used by unit tests to test heap map_kernel functions. Only expected to be
64 * used for debugging and testing, may not always be available.
66 #define ION_IOC_TEST_KERNEL_MAPPING \
67 _IOW(ION_IOC_MAGIC, 0xf2, struct ion_test_rw_data)
70 #endif /* _UAPI_LINUX_ION_H */