diff options
author | angelsl <hidingfromhidden@gmail.com> | 2013-02-18 18:48:53 +0800 |
---|---|---|
committer | angelsl <hidingfromhidden@gmail.com> | 2013-02-24 14:29:28 +0800 |
commit | ee21f4bdd1e8b4d4302938c12a64f2efe6d9f49b (patch) | |
tree | 3108cd288ff0a7540b48c27dfa49ac27812a10cd /exynos4/hal/include | |
parent | de4b10b242175fbeb89f80718ee4703fa11f2fc0 (diff) | |
download | hardware_samsung-ee21f4bdd1e8b4d4302938c12a64f2efe6d9f49b.zip hardware_samsung-ee21f4bdd1e8b4d4302938c12a64f2efe6d9f49b.tar.gz hardware_samsung-ee21f4bdd1e8b4d4302938c12a64f2efe6d9f49b.tar.bz2 |
exynos4: Add open source libsecion.
This libsecion is reverse engineered from the libsecion.so blob and then
written based on the Exynos 5 libion available in AOSP.
Change-Id: Ibe69047c78491e3c7f3173b18fcabdf327fcfbd0
Signed-off-by: angelsl <hidingfromhidden@gmail.com>
Diffstat (limited to 'exynos4/hal/include')
-rw-r--r-- | exynos4/hal/include/secion.h | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/exynos4/hal/include/secion.h b/exynos4/hal/include/secion.h new file mode 100644 index 0000000..eb701e9 --- /dev/null +++ b/exynos4/hal/include/secion.h @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2012 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _LIB_SECION_H_ +#define _LIB_SECION_H_ + +#include <unistd.h> + +typedef unsigned long ion_phys_addr_t; +typedef int ion_client; +typedef int ion_buffer; + +enum ION_MSYNC_FLAGS { + IMSYNC_DEV_TO_READ = 0, + IMSYNC_DEV_TO_WRITE = 1, + IMSYNC_DEV_TO_RW = 2, + IMSYNC_SYNC_FOR_DEV = 0x10000, + IMSYNC_SYNC_FOR_CPU = 0x20000, +}; + +struct secion_param { + ion_client client; + ion_buffer buffer; + size_t size; + void *memory; + ion_phys_addr_t physaddr; +}; + +#ifdef __cplusplus +extern "C" { +#endif + +ion_client ion_client_create(void); +void ion_client_destroy(ion_client client); +ion_buffer ion_alloc(ion_client client, size_t len, size_t align, unsigned int flags); +void ion_free(ion_buffer buffer); +void *ion_map(ion_buffer buffer, size_t len, off_t offset); +int ion_unmap(void *addr, size_t len); +int ion_msync(ion_client client, ion_buffer buffer, enum ION_MSYNC_FLAGS flags, size_t size, off_t offset); +ion_phys_addr_t ion_getphys(ion_client client, ion_buffer buffer); +int createIONMem(struct secion_param *param, size_t size, unsigned int flags); +int destroyIONMem(struct secion_param *param); + +#ifdef __cplusplus +} +#endif +#endif /* _LIB_SECION_H_ */ |