• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  *  ion.c
3  *
4  * Memory Allocator functions for ion
5  *
6  *   Copyright 2011 Google, Inc
7  *
8  *  Licensed under the Apache License, Version 2.0 (the "License");
9  *  you may not use this file except in compliance with the License.
10  *  You may obtain a copy of the License at
11  *
12  *      http://www.apache.org/licenses/LICENSE-2.0
13  *
14  *  Unless required by applicable law or agreed to in writing, software
15  *  distributed under the License is distributed on an "AS IS" BASIS,
16  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  *  See the License for the specific language governing permissions and
18  *  limitations under the License.
19  */
20 
21 #ifndef __SYS_CORE_ION_H
22 #define __SYS_CORE_ION_H
23 
24 #include <linux/ion.h>
25 #include <linux/omap_ion.h>
26 
27 __BEGIN_DECLS
28 
29 int ion_open();
30 int ion_close(int fd);
31 int ion_alloc(int fd, size_t len, size_t align, unsigned int flags,
32               struct ion_handle **handle);
33 int ion_alloc_tiler(int fd, size_t w, size_t h, int fmt, unsigned int flags,
34                     struct ion_handle **handle, size_t *stride);
35 int ion_sync_fd(int fd, int handle_fd);
36 int ion_free(int fd, struct ion_handle *handle);
37 int ion_map(int fd, struct ion_handle *handle, size_t length, int prot,
38             int flags, off_t offset, unsigned char **ptr, int *map_fd);
39 int ion_share(int fd, struct ion_handle *handle, int *share_fd);
40 int ion_import(int fd, int share_fd, struct ion_handle **handle);
41 int ion_map_cacheable(int fd, struct ion_handle *handle, size_t length,
42                       int prot, int flags, off_t offset, unsigned char **ptr, int *map_fd);
43 int ion_flush_cached(int fd, struct ion_handle *handle, size_t length,
44                      unsigned char *ptr);
45 int ion_inval_cached(int fd, struct ion_handle *handle, size_t length,
46                      unsigned char *ptr);
47 
48 __END_DECLS
49 
50 #endif /* __SYS_CORE_ION_H */
51