blob: fbd34e2a99bad6268ab3a932cc5a8b183b5ee372 [file] [log] [blame]
Rebecca Schultz Zavinafd91232012-02-22 16:36:55 -08001/*
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 Zavin830e1972012-02-27 16:33:03 -080021#ifndef __SYS_CORE_ION_H
22#define __SYS_CORE_ION_H
23
Rebecca Schultz Zavinafd91232012-02-22 16:36:55 -080024#include <linux/ion.h>
25
Dima Zavin830e1972012-02-27 16:33:03 -080026__BEGIN_DECLS
27
Elliott Hughesf98e4bf2013-11-21 22:09:46 -080028struct ion_handle;
29
Rebecca Schultz Zavinafd91232012-02-22 16:36:55 -080030int ion_open();
31int ion_close(int fd);
Rebecca Schultz Zavina50fd552012-06-11 15:12:37 -070032int ion_alloc(int fd, size_t len, size_t align, unsigned int heap_mask,
33 unsigned int flags, struct ion_handle **handle);
34int ion_alloc_fd(int fd, size_t len, size_t align, unsigned int heap_mask,
35 unsigned int flags, int *handle_fd);
Rebecca Schultz Zavin3cfcc302012-09-20 09:46:19 -070036int ion_sync_fd(int fd, int handle_fd);
Rebecca Schultz Zavinafd91232012-02-22 16:36:55 -080037int ion_free(int fd, struct ion_handle *handle);
38int ion_map(int fd, struct ion_handle *handle, size_t length, int prot,
39 int flags, off_t offset, unsigned char **ptr, int *map_fd);
40int ion_share(int fd, struct ion_handle *handle, int *share_fd);
41int ion_import(int fd, int share_fd, struct ion_handle **handle);
42
Dima Zavin830e1972012-02-27 16:33:03 -080043__END_DECLS
44
45#endif /* __SYS_CORE_ION_H */