diff options
author | michaelbai@google.com <michaelbai@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-21 16:14:47 +0000 |
---|---|---|
committer | michaelbai@google.com <michaelbai@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-21 16:14:47 +0000 |
commit | 2a5b1a3e84402e80660d3511b5ffe343f98fe663 (patch) | |
tree | 200730e506221e7c2b411c592b2a37683ffe3773 /third_party/ashmem/ashmem.h | |
parent | 3aa90ad5278b3e021dd4477bd0199dce6b2272ea (diff) | |
download | chromium_src-2a5b1a3e84402e80660d3511b5ffe343f98fe663.zip chromium_src-2a5b1a3e84402e80660d3511b5ffe343f98fe663.tar.gz chromium_src-2a5b1a3e84402e80660d3511b5ffe343f98fe663.tar.bz2 |
Added the ashmem library from Android
BUG=
TEST=
Review URL: http://codereview.chromium.org/7200011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@89833 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party/ashmem/ashmem.h')
-rw-r--r-- | third_party/ashmem/ashmem.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/third_party/ashmem/ashmem.h b/third_party/ashmem/ashmem.h new file mode 100644 index 0000000..708dd45 --- /dev/null +++ b/third_party/ashmem/ashmem.h @@ -0,0 +1,45 @@ +/* third_party/ashmem/ashmem.h + ** + ** Copyright 2008 The Android Open Source Project + ** + ** This file is dual licensed. It may be redistributed and/or modified + ** under the terms of the Apache 2.0 License OR version 2 of the GNU + ** General Public License. + */ + +#ifndef _THIRD_PARTY_ASHMEM_H +#define _THIRD_PARTY_ASHMEM_H + +#include <stddef.h> + +#ifdef __cplusplus +extern "C" { +#endif + +int ashmem_create_region(const char *name, size_t size); +int ashmem_set_prot_region(int fd, int prot); +int ashmem_pin_region(int fd, size_t offset, size_t len); +int ashmem_unpin_region(int fd, size_t offset, size_t len); +int ashmem_get_size_region(int fd); + +#ifdef __cplusplus +} +#endif + +#ifndef __ASHMEMIOC /* in case someone included <linux/ashmem.h> too */ + +#define ASHMEM_NAME_LEN 256 + +#define ASHMEM_NAME_DEF "dev/ashmem" + +/* Return values from ASHMEM_PIN: Was the mapping purged while unpinned? */ +#define ASHMEM_NOT_PURGED 0 +#define ASHMEM_WAS_PURGED 1 + +/* Return values from ASHMEM_UNPIN: Is the mapping now pinned or unpinned? */ +#define ASHMEM_IS_UNPINNED 0 +#define ASHMEM_IS_PINNED 1 + +#endif /* ! __ASHMEMIOC */ + +#endif /* _THIRD_PARTY_ASHMEM_H */ |