From 9111247800f57aa94aed3d4a6495255a958a7b82 Mon Sep 17 00:00:00 2001 From: Laura Abbott Date: Wed, 28 May 2014 10:56:41 -0700 Subject: [PATCH] staging: android: ashmem: Factor out compat code from uapi Compat related code should not be exported to userspace directly. Factor out the compat related code back into an ashmem.h file. Change-Id: I90ae26a0045a5ff7d7af7e9caadf5d807270eaef Signed-off-by: Laura Abbott --- drivers/staging/android/ashmem.c | 2 ++ drivers/staging/android/ashmem.h | 25 +++++++++++++++++++++++++ include/uapi/linux/ashmem.h | 7 ------- 3 files changed, 27 insertions(+), 7 deletions(-) create mode 100644 drivers/staging/android/ashmem.h diff --git a/drivers/staging/android/ashmem.c b/drivers/staging/android/ashmem.c index ecad9b09a678..5661711b9f55 100644 --- a/drivers/staging/android/ashmem.c +++ b/drivers/staging/android/ashmem.c @@ -34,6 +34,8 @@ #include #include +#include "ashmem.h" + #define ASHMEM_NAME_PREFIX "dev/ashmem/" #define ASHMEM_NAME_PREFIX_LEN (sizeof(ASHMEM_NAME_PREFIX) - 1) #define ASHMEM_FULL_NAME_LEN (ASHMEM_NAME_LEN + ASHMEM_NAME_PREFIX_LEN) diff --git a/drivers/staging/android/ashmem.h b/drivers/staging/android/ashmem.h new file mode 100644 index 000000000000..b03b9d69854d --- /dev/null +++ b/drivers/staging/android/ashmem.h @@ -0,0 +1,25 @@ +/* Copyright (c) 2014, The Linux Foundation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 and + * only version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#ifndef _ANDROID_ASHMEM_H +#define _ANDROID_ASHMEM_H + +#include + +/* support of 32bit userspace on 64bit platforms */ +#ifdef CONFIG_COMPAT +#define COMPAT_ASHMEM_SET_SIZE _IOW(__ASHMEMIOC, 3, compat_size_t) +#define COMPAT_ASHMEM_SET_PROT_MASK _IOW(__ASHMEMIOC, 5, unsigned int) +#endif + +#endif diff --git a/include/uapi/linux/ashmem.h b/include/uapi/linux/ashmem.h index 7965b39a94f5..5abac76c0e02 100644 --- a/include/uapi/linux/ashmem.h +++ b/include/uapi/linux/ashmem.h @@ -3,7 +3,6 @@ #include #include -#include #define ASHMEM_NAME_LEN 256 @@ -38,10 +37,4 @@ struct ashmem_pin { #define ASHMEM_CACHE_CLEAN_RANGE _IO(__ASHMEMIOC, 12) #define ASHMEM_CACHE_INV_RANGE _IO(__ASHMEMIOC, 13) -/* support of 32bit userspace on 64bit platforms */ -#ifdef CONFIG_COMPAT -#define COMPAT_ASHMEM_SET_SIZE _IOW(__ASHMEMIOC, 3, compat_size_t) -#define COMPAT_ASHMEM_SET_PROT_MASK _IOW(__ASHMEMIOC, 5, unsigned int) -#endif - #endif /* _UAPI_LINUX_ASHMEM_H */