6 #define SOCKET_NAME "ion_socket"
7 #define ION_DEVICE "/dev/ion"
9 #define ION_BUFFER_LEN 4096
10 #define MAX_HEAP_COUNT ION_HEAP_TYPE_CUSTOM
18 struct ion_buffer_info
{
21 unsigned int heap_type
;
22 unsigned int flag_type
;
23 unsigned long heap_size
;
25 unsigned char *buffer
;
29 /* This is used to fill the data into the mapped buffer */
30 void write_buffer(void *buffer
, unsigned long len
);
32 /* This is used to read the data from the exported buffer */
33 void read_buffer(void *buffer
, unsigned long len
);
35 /* This is used to create an ION buffer FD for the kernel buffer
36 * So you can export this same buffer to others in the form of FD
38 int ion_export_buffer_fd(struct ion_buffer_info
*ion_info
);
40 /* This is used to import or map an exported FD.
41 * So we point to same buffer without making a copy. Hence zero-copy.
43 int ion_import_buffer_fd(struct ion_buffer_info
*ion_info
);
45 /* This is used to close all references for the ION client */
46 void ion_close_buffer_fd(struct ion_buffer_info
*ion_info
);
48 /* This is used to send FD to another process using socket IPC */
49 int socket_send_fd(struct socket_info
*skinfo
);
51 /* This is used to receive FD from another process using socket IPC */
52 int socket_receive_fd(struct socket_info
*skinfo
);