| Samsung Internal API reference 2.0

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

tbt.h
1 /*
2 * Copyright (C) 2012-2018, Samsung Electronics Co., Ltd.
3 *
4 * Transparent buffers translation
5 */
6
7 #pragma once
8
9 #include <stdint.h>
10
11 #define DRIVER_IOCTL_MAX_ARGS 32 /* NB: Increase if you have a structure
12 * with a number of fields > 32.
13 */
14 #define MMAP_SHARE_ITEMS (DRIVER_IOCTL_MAX_ARGS)
15
16 #define DESC_ATOM_IS_ARR_ITEM(atom) ((atom)->type >= DESC_ATOM_ARR_ITEM_0 \
17 && (atom)->type <= DESC_ATOM_ARR_ITEM_MAX)
18 #define DESC_ATOM_IS_ARR_CNT(atom) ((atom)->type >= DESC_ATOM_ARR_CNT_0 \
19 && (atom)->type <= DESC_ATOM_ARR_CNT_MAX)
20 #define DESC_ATOM_IS_REF(atom) ((atom)->type >= DESC_ATOM_REF_WR \
21 && (atom)->type <= DESC_ATOM_REF_DYN_MAX)
22 #define DESC_ATOM_ARR_ITEM_IDX(type) (type - DESC_ATOM_ARR_ITEM_0)
23 #define DESC_ATOM_ARR_CNT_IDX(type) (type - DESC_ATOM_ARR_CNT_0)
24 #define DESC_ATOM_ARR_ITEM_ARR_CNT (DESC_ATOM_ARR_ITEM_MAX - DESC_ATOM_ARR_ITEM_0 + 1)
25 #define DESC_ATOM_ARR_CNT_CNT (DESC_ATOM_ARR_CNT_MAX - DESC_ATOM_ARR_CNT_0 + 1)
26 #define DESC_ATOM_DYN_CNT_CNT (DESC_ATOM_DYN_CNT_MAX - DESC_ATOM_DYN_CNT_0 + 1)
27 #define DESC_MAX_SIZE (PAGE_SIZE)
28
29 enum {
30 IOCTL_DESC_STRUCT,
31 IOCTL_DESC_REF,
32 IOCTL_DESC_MAX,
33 };
34
35 enum {
36 DESC_ATOM_VAL,
37 DESC_ATOM_REF_WR,
38 DESC_ATOM_REF_RW,
39 DESC_ATOM_REF_RO,
40 DESC_ATOM_REF_MAX = DESC_ATOM_REF_RO,
41 DESC_ATOM_REF_DYN_0,
42 DESC_ATOM_REF_DYN_1,
43 DESC_ATOM_REF_DYN_MAX = DESC_ATOM_REF_DYN_1,
44 DESC_ATOM_DYN_CNT_0,
45 DESC_ATOM_DYN_CNT_1,
46 DESC_ATOM_DYN_CNT_MAX = DESC_ATOM_DYN_CNT_1,
47 DESC_ATOM_ARR_CNT_0,
48 DESC_ATOM_ARR_CNT_1,
49 DESC_ATOM_ARR_CNT_2,
50 DESC_ATOM_ARR_CNT_3,
51 DESC_ATOM_ARR_CNT_MAX = DESC_ATOM_ARR_CNT_3,
52 DESC_ATOM_ARR_ITEM_0,
53 DESC_ATOM_ARR_ITEM_1,
54 DESC_ATOM_ARR_ITEM_2,
55 DESC_ATOM_ARR_ITEM_3,
56 DESC_ATOM_ARR_ITEM_MAX = DESC_ATOM_ARR_ITEM_3,
57 DESC_ATOM_MAX,
58 };
59
60 _Static_assert(DESC_ATOM_ARR_CNT_MAX != DESC_ATOM_ARR_ITEM_MAX,
61 "Count of array items descriptors does not match to count of counters")
62 ;
63
67 struct desc_atom {
68 uint32_t type;
69 uint32_t len;
70 };
71
75 struct ioctl_desc {
76 uint32_t cnt;
77 uint32_t type;
78 struct desc_atom tpl[DRIVER_IOCTL_MAX_ARGS];
79 };
80
ioctl_desc::cnt
uint32_t cnt
Definition: tbt.h:76
ioctl_desc::type
uint32_t type
Definition: tbt.h:77
desc_atom
Structure that contains description of single data item.
Definition: tbt.h:67
desc_atom::len
uint32_t len
Definition: tbt.h:69
ioctl_desc
Structure that template for ioctl() parameters parsing.
Definition: tbt.h:75
desc_atom::type
uint32_t type
Definition: tbt.h:68