OLD | NEW |
1 /* third_party/ashmem/ashmem.h | 1 /* third_party/ashmem/ashmem.h |
2 ** | 2 ** |
3 ** Copyright 2008 The Android Open Source Project | 3 ** Copyright 2008 The Android Open Source Project |
4 ** | 4 ** |
5 ** This file is dual licensed. It may be redistributed and/or modified | 5 ** This file is dual licensed. It may be redistributed and/or modified |
6 ** under the terms of the Apache 2.0 License OR version 2 of the GNU | 6 ** under the terms of the Apache 2.0 License OR version 2 of the GNU |
7 ** General Public License. | 7 ** General Public License. |
8 */ | 8 */ |
9 | 9 |
10 #ifndef _THIRD_PARTY_ASHMEM_H | 10 #ifndef _THIRD_PARTY_ASHMEM_H |
11 #define _THIRD_PARTY_ASHMEM_H | 11 #define _THIRD_PARTY_ASHMEM_H |
12 | 12 |
13 #include <stddef.h> | 13 #include <stddef.h> |
14 | 14 |
15 #ifdef __cplusplus | 15 #ifdef __cplusplus |
16 extern "C" { | 16 extern "C" { |
17 #endif | 17 #endif |
18 | 18 |
19 int ashmem_create_region(const char *name, size_t size); | 19 int ashmem_create_region(const char *name, size_t size); |
20 int ashmem_set_prot_region(int fd, int prot); | 20 int ashmem_set_prot_region(int fd, int prot); |
21 int ashmem_pin_region(int fd, size_t offset, size_t len); | 21 int ashmem_pin_region(int fd, size_t offset, size_t len); |
22 int ashmem_unpin_region(int fd, size_t offset, size_t len); | 22 int ashmem_unpin_region(int fd, size_t offset, size_t len); |
23 int ashmem_get_size_region(int fd); | 23 int ashmem_get_size_region(int fd); |
| 24 int ashmem_purge_all(void); |
24 | 25 |
25 #ifdef __cplusplus | 26 #ifdef __cplusplus |
26 } | 27 } |
27 #endif | 28 #endif |
28 | 29 |
29 #ifndef __ASHMEMIOC /* in case someone included <linux/ashmem.h> too */ | 30 #ifndef __ASHMEMIOC /* in case someone included <linux/ashmem.h> too */ |
30 | 31 |
31 #define ASHMEM_NAME_LEN 256 | 32 #define ASHMEM_NAME_LEN 256 |
32 | 33 |
33 #define ASHMEM_NAME_DEF "dev/ashmem" | 34 #define ASHMEM_NAME_DEF "dev/ashmem" |
34 | 35 |
35 /* Return values from ASHMEM_PIN: Was the mapping purged while unpinned? */ | 36 /* Return values from ASHMEM_PIN: Was the mapping purged while unpinned? */ |
36 #define ASHMEM_NOT_PURGED 0 | 37 #define ASHMEM_NOT_PURGED 0 |
37 #define ASHMEM_WAS_PURGED 1 | 38 #define ASHMEM_WAS_PURGED 1 |
38 | 39 |
39 /* Return values from ASHMEM_UNPIN: Is the mapping now pinned or unpinned? */ | 40 /* Return values from ASHMEM_UNPIN: Is the mapping now pinned or unpinned? */ |
40 #define ASHMEM_IS_UNPINNED 0 | 41 #define ASHMEM_IS_UNPINNED 0 |
41 #define ASHMEM_IS_PINNED 1 | 42 #define ASHMEM_IS_PINNED 1 |
42 | 43 |
43 #endif /* ! __ASHMEMIOC */ | 44 #endif /* ! __ASHMEMIOC */ |
44 | 45 |
45 #endif /* _THIRD_PARTY_ASHMEM_H */ | 46 #endif /* _THIRD_PARTY_ASHMEM_H */ |
OLD | NEW |