OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2008 The Android Open Source Project | 2 * Copyright 2008 The Android Open Source Project |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef _CUTILS_ASHMEM_H | 8 #ifndef _CUTILS_ASHMEM_H |
9 #define _CUTILS_ASHMEM_H | 9 #define _CUTILS_ASHMEM_H |
10 | 10 |
11 #include <stddef.h> | 11 #include <stddef.h> |
12 | 12 |
13 #ifdef __cplusplus | 13 #ifdef __cplusplus |
14 extern "C" { | 14 extern "C" { |
15 #endif | 15 #endif |
16 | 16 |
17 int ashmem_create_region(const char *name, size_t size); | 17 int ashmem_create_region(const char *name, size_t size); |
18 int ashmem_set_prot_region(int fd, int prot); | 18 int ashmem_set_prot_region(int fd, int prot); |
19 int ashmem_pin_region(int fd, size_t offset, size_t len); | 19 int ashmem_pin_region(int fd, size_t offset, size_t len); |
20 int ashmem_unpin_region(int fd, size_t offset, size_t len); | 20 int ashmem_unpin_region(int fd, size_t offset, size_t len); |
21 int ashmem_get_size_region(int fd); | 21 int ashmem_get_size_region(int fd); |
| 22 int ashmem_purge_all_caches(int fd); |
22 | 23 |
23 #ifdef __cplusplus | 24 #ifdef __cplusplus |
24 } | 25 } |
25 #endif | 26 #endif |
26 | 27 |
27 #ifndef __ASHMEMIOC /* in case someone included <linux/ashmem.h> too */ | 28 #ifndef __ASHMEMIOC /* in case someone included <linux/ashmem.h> too */ |
28 | 29 |
29 #define ASHMEM_NAME_LEN 256 | 30 #define ASHMEM_NAME_LEN 256 |
30 | 31 |
31 #define ASHMEM_NAME_DEF "dev/ashmem" | 32 #define ASHMEM_NAME_DEF "dev/ashmem" |
32 | 33 |
33 /* Return values from ASHMEM_PIN: Was the mapping purged while unpinned? */ | 34 /* Return values from ASHMEM_PIN: Was the mapping purged while unpinned? */ |
34 #define ASHMEM_NOT_PURGED 0 | 35 #define ASHMEM_NOT_PURGED 0 |
35 #define ASHMEM_WAS_PURGED 1 | 36 #define ASHMEM_WAS_PURGED 1 |
36 | 37 |
37 /* Return values from ASHMEM_UNPIN: Is the mapping now pinned or unpinned? */ | 38 /* Return values from ASHMEM_UNPIN: Is the mapping now pinned or unpinned? */ |
38 #define ASHMEM_IS_UNPINNED 0 | 39 #define ASHMEM_IS_UNPINNED 0 |
39 #define ASHMEM_IS_PINNED 1 | 40 #define ASHMEM_IS_PINNED 1 |
40 | 41 |
41 #endif /* ! __ASHMEMIOC */ | 42 #endif /* ! __ASHMEMIOC */ |
42 | 43 |
43 #endif /* _CUTILS_ASHMEM_H */ | 44 #endif /* _CUTILS_ASHMEM_H */ |
OLD | NEW |