1
2
3
4
5 #ifndef TEE_PRIVATE_H
6 #define TEE_PRIVATE_H
7
8 #include <linux/cdev.h>
9 #include <linux/completion.h>
10 #include <linux/device.h>
11 #include <linux/kref.h>
12 #include <linux/mutex.h>
13 #include <linux/types.h>
14
15
16
17
18
19
20
21 struct tee_shm_pool {
22 struct tee_shm_pool_mgr *private_mgr;
23 struct tee_shm_pool_mgr *dma_buf_mgr;
24 };
25
26 #define TEE_DEVICE_FLAG_REGISTERED 0x1
27 #define TEE_MAX_DEV_NAME_LEN 32
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43 struct tee_device {
44 char name[TEE_MAX_DEV_NAME_LEN];
45 const struct tee_desc *desc;
46 int id;
47 unsigned int flags;
48
49 struct device dev;
50 struct cdev cdev;
51
52 size_t num_users;
53 struct completion c_no_users;
54 struct mutex mutex;
55
56 struct idr idr;
57 struct tee_shm_pool *pool;
58 };
59
60 int tee_shm_init(void);
61
62 int tee_shm_get_fd(struct tee_shm *shm);
63
64 bool tee_device_get(struct tee_device *teedev);
65 void tee_device_put(struct tee_device *teedev);
66
67 void teedev_ctx_get(struct tee_context *ctx);
68 void teedev_ctx_put(struct tee_context *ctx);
69
70 #endif