1 /* SPDX-License-Identifier: GPL-2.0 OR Apache-2.0 */ 2 /* 3 * include/linux/ashmem.h 4 * 5 * Copyright 2008 Google Inc. 6 * Author: Robert Love 7 */ 8 9 #ifndef _LINUX_ASHMEM_H 10 #define _LINUX_ASHMEM_H 11 12 #include <linux/limits.h> 13 #include <linux/ioctl.h> 14 #include <linux/compat.h> 15 16 #include "uapi/ashmem.h" 17 18 #include <linux/shrinker.h> 19 const gfp_t RUST_CONST_HELPER___GFP_FS = ___GFP_FS; 20 const gfp_t RUST_CONST_HELPER___GFP_IO = ___GFP_IO; 21 22 #define ASHMEM_NAME_PREFIX "dev/ashmem/" 23 #define ASHMEM_NAME_PREFIX_LEN (sizeof(ASHMEM_NAME_PREFIX) - 1) 24 #define ASHMEM_FULL_NAME_LEN (ASHMEM_NAME_LEN + ASHMEM_NAME_PREFIX_LEN) 25 26 /* support of 32bit userspace on 64bit platforms */ 27 #ifdef CONFIG_COMPAT 28 enum { 29 COMPAT_ASHMEM_SET_SIZE = _IOW(__ASHMEMIOC, 3, compat_size_t), 30 COMPAT_ASHMEM_SET_PROT_MASK = _IOW(__ASHMEMIOC, 5, unsigned int), 31 }; 32 #endif 33 34 bool is_ashmem_file(struct file *file); 35 int ashmem_area_name(struct file *file, char *name); 36 long ashmem_area_size(struct file *file); 37 struct file *ashmem_area_vmfile(struct file *file); 38 39 #endif /* _LINUX_ASHMEM_H */ 40