Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 91112478 authored by Laura Abbott's avatar Laura Abbott
Browse files

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: default avatarLaura Abbott <lauraa@codeaurora.org>
parent 70d51296
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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)
+25 −0
Original line number Diff line number Diff line
/* 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
+0 −7
Original line number Diff line number Diff line
@@ -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 */