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 <lauraa@codeaurora.org>
This commit is contained in:
Laura Abbott 2014-05-28 10:56:41 -07:00
parent 70d5129655
commit 9111247800
3 changed files with 27 additions and 7 deletions

View file

@ -34,6 +34,8 @@
#include <linux/ashmem.h>
#include <asm/cacheflush.h>
#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)

View file

@ -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 <linux/compat.h>
/* 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

View file

@ -3,7 +3,6 @@
#include <linux/limits.h>
#include <linux/ioctl.h>
#include <linux/compat.h>
#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 */