Rebecca Schultz Zavin | afd9123 | 2012-02-22 16:36:55 -0800 | [diff] [blame] | 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 | |
Dima Zavin | 830e197 | 2012-02-27 16:33:03 -0800 | [diff] [blame] | 21 | #ifndef __SYS_CORE_ION_H |
| 22 | #define __SYS_CORE_ION_H |
| 23 | |
Colin Cross | 51b6e42 | 2013-12-18 15:17:06 -0800 | [diff] [blame^] | 24 | #include <sys/types.h> |
Rebecca Schultz Zavin | afd9123 | 2012-02-22 16:36:55 -0800 | [diff] [blame] | 25 | #include <linux/ion.h> |
| 26 | |
Dima Zavin | 830e197 | 2012-02-27 16:33:03 -0800 | [diff] [blame] | 27 | __BEGIN_DECLS |
| 28 | |
Elliott Hughes | f98e4bf | 2013-11-21 22:09:46 -0800 | [diff] [blame] | 29 | struct ion_handle; |
| 30 | |
Rebecca Schultz Zavin | afd9123 | 2012-02-22 16:36:55 -0800 | [diff] [blame] | 31 | int ion_open(); |
| 32 | int ion_close(int fd); |
Rebecca Schultz Zavin | a50fd55 | 2012-06-11 15:12:37 -0700 | [diff] [blame] | 33 | int ion_alloc(int fd, size_t len, size_t align, unsigned int heap_mask, |
Colin Cross | 92d7ca6 | 2013-11-08 19:04:18 -0800 | [diff] [blame] | 34 | unsigned int flags, ion_user_handle_t *handle); |
Rebecca Schultz Zavin | a50fd55 | 2012-06-11 15:12:37 -0700 | [diff] [blame] | 35 | int ion_alloc_fd(int fd, size_t len, size_t align, unsigned int heap_mask, |
Colin Cross | 92d7ca6 | 2013-11-08 19:04:18 -0800 | [diff] [blame] | 36 | unsigned int flags, int *handle_fd); |
Rebecca Schultz Zavin | 3cfcc30 | 2012-09-20 09:46:19 -0700 | [diff] [blame] | 37 | int ion_sync_fd(int fd, int handle_fd); |
Rom Lemarchand | 969eac8 | 2013-10-21 15:19:56 -0700 | [diff] [blame] | 38 | int ion_free(int fd, ion_user_handle_t handle); |
| 39 | int ion_map(int fd, ion_user_handle_t handle, size_t length, int prot, |
Rebecca Schultz Zavin | afd9123 | 2012-02-22 16:36:55 -0800 | [diff] [blame] | 40 | int flags, off_t offset, unsigned char **ptr, int *map_fd); |
Rom Lemarchand | 969eac8 | 2013-10-21 15:19:56 -0700 | [diff] [blame] | 41 | int ion_share(int fd, ion_user_handle_t handle, int *share_fd); |
| 42 | int ion_import(int fd, int share_fd, ion_user_handle_t *handle); |
Rebecca Schultz Zavin | afd9123 | 2012-02-22 16:36:55 -0800 | [diff] [blame] | 43 | |
Dima Zavin | 830e197 | 2012-02-27 16:33:03 -0800 | [diff] [blame] | 44 | __END_DECLS |
| 45 | |
| 46 | #endif /* __SYS_CORE_ION_H */ |