1 /*
2  * Copyright (C) 2018 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef _UAPI_LINUX_ION_TEST_H
18 #define _UAPI_LINUX_ION_TEST_H
19 
20 #include <linux/ioctl.h>
21 #include <linux/types.h>
22 
23 struct ion_test_rw_data {
24     __u64 ptr;
25     __u64 offset;
26     __u64 size;
27     int   write;
28     int   __padding;
29 };
30 
31 enum {
32     PHYS_CHUNK_IS_IDENTICAL_SIZE = 0,
33     PHYS_IS_ORDERED_IN_ADDRESS   = 1,
34     PHYS_IS_RESERVED             = 2,
35     PHYS_IS_CMA                  = 3,
36     PHYS_IS_ALIGNED              = 4,
37 };
38 
39 struct ion_test_phys_data {
40     __u32 cmd;
41     __u32 arg;
42     __u32 result;
43 };
44 
45 #define ION_IOC_MAGIC		        'I'
46 #define ION_IOC_TEST_SET_FD         _IO(ION_IOC_MAGIC,   0xf0)
47 #define ION_IOC_TEST_DMA_MAPPING    _IOW(ION_IOC_MAGIC,  0xf1, struct ion_test_rw_data)
48 #define ION_IOC_TEST_KERNEL_MAPPING _IOW(ION_IOC_MAGIC,  0xf2, struct ion_test_rw_data)
49 #define ION_IOC_TEST_PHYS           _IOWR(ION_IOC_MAGIC, 0xf3, struct ion_test_phys_data)
50 
51 #endif //_UAPI_LINUX_ION_TEST_H
52