Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 1 | /**************************************************************************** |
| 2 | **************************************************************************** |
| 3 | *** |
| 4 | *** This header was automatically generated from a Linux kernel header |
| 5 | *** of the same name, to make information necessary for userspace to |
| 6 | *** call into the kernel available to libc. It contains only constants, |
| 7 | *** structures, and macros generated from the original header, and thus, |
| 8 | *** contains no copyrightable information. |
| 9 | *** |
| 10 | *** To edit the content of this header, modify the corresponding |
| 11 | *** source file (e.g. under external/kernel-headers/original/) then |
| 12 | *** run bionic/libc/kernel/tools/update_all.py |
| 13 | *** |
| 14 | *** Any manual change here will be lost the next time this script will |
| 15 | *** be run. You've been warned! |
| 16 | *** |
| 17 | **************************************************************************** |
| 18 | ****************************************************************************/ |
| 19 | #ifndef _UAPI_LINUX_SHM_H_ |
| 20 | #define _UAPI_LINUX_SHM_H_ |
| 21 | #include <linux/ipc.h> |
| 22 | #include <linux/errno.h> |
Christopher Ferris | 1308ad3 | 2017-11-14 17:32:13 -0800 | [diff] [blame] | 23 | #include <asm-generic/hugetlb_encode.h> |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 24 | #include <unistd.h> |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 25 | #define SHMMIN 1 |
| 26 | #define SHMMNI 4096 |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame] | 27 | #define SHMMAX (ULONG_MAX - (1UL << 24)) |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame] | 28 | #define SHMALL (ULONG_MAX - (1UL << 24)) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 29 | #define SHMSEG SHMMNI |
Elliott Hughes | 7c59f3f | 2016-08-16 18:14:26 -0700 | [diff] [blame] | 30 | struct __kernel_legacy_shmid_ds { |
| 31 | struct __kernel_legacy_ipc_perm shm_perm; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 32 | int shm_segsz; |
Christopher Ferris | d32ca14 | 2020-02-04 16:16:51 -0800 | [diff] [blame^] | 33 | __kernel_old_time_t shm_atime; |
| 34 | __kernel_old_time_t shm_dtime; |
| 35 | __kernel_old_time_t shm_ctime; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 36 | __kernel_ipc_pid_t shm_cpid; |
| 37 | __kernel_ipc_pid_t shm_lpid; |
| 38 | unsigned short shm_nattch; |
| 39 | unsigned short shm_unused; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 40 | void * shm_unused2; |
| 41 | void * shm_unused3; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 42 | }; |
| 43 | #include <asm/shmbuf.h> |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 44 | #define SHM_R 0400 |
| 45 | #define SHM_W 0200 |
Christopher Ferris | 1308ad3 | 2017-11-14 17:32:13 -0800 | [diff] [blame] | 46 | #define SHM_HUGETLB 04000 |
| 47 | #define SHM_NORESERVE 010000 |
| 48 | #define SHM_HUGE_SHIFT HUGETLB_FLAG_ENCODE_SHIFT |
| 49 | #define SHM_HUGE_MASK HUGETLB_FLAG_ENCODE_MASK |
| 50 | #define SHM_HUGE_64KB HUGETLB_FLAG_ENCODE_64KB |
| 51 | #define SHM_HUGE_512KB HUGETLB_FLAG_ENCODE_512KB |
| 52 | #define SHM_HUGE_1MB HUGETLB_FLAG_ENCODE_1MB |
| 53 | #define SHM_HUGE_2MB HUGETLB_FLAG_ENCODE_2MB |
| 54 | #define SHM_HUGE_8MB HUGETLB_FLAG_ENCODE_8MB |
| 55 | #define SHM_HUGE_16MB HUGETLB_FLAG_ENCODE_16MB |
Christopher Ferris | 9ce2884 | 2018-10-25 12:11:39 -0700 | [diff] [blame] | 56 | #define SHM_HUGE_32MB HUGETLB_FLAG_ENCODE_32MB |
Christopher Ferris | 1308ad3 | 2017-11-14 17:32:13 -0800 | [diff] [blame] | 57 | #define SHM_HUGE_256MB HUGETLB_FLAG_ENCODE_256MB |
Christopher Ferris | 9ce2884 | 2018-10-25 12:11:39 -0700 | [diff] [blame] | 58 | #define SHM_HUGE_512MB HUGETLB_FLAG_ENCODE_512MB |
Christopher Ferris | 1308ad3 | 2017-11-14 17:32:13 -0800 | [diff] [blame] | 59 | #define SHM_HUGE_1GB HUGETLB_FLAG_ENCODE_1GB |
| 60 | #define SHM_HUGE_2GB HUGETLB_FLAG_ENCODE_2GB |
| 61 | #define SHM_HUGE_16GB HUGETLB_FLAG_ENCODE_16GB |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 62 | #define SHM_RDONLY 010000 |
| 63 | #define SHM_RND 020000 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 64 | #define SHM_REMAP 040000 |
| 65 | #define SHM_EXEC 0100000 |
| 66 | #define SHM_LOCK 11 |
| 67 | #define SHM_UNLOCK 12 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 68 | #define SHM_STAT 13 |
| 69 | #define SHM_INFO 14 |
Christopher Ferris | 76a1d45 | 2018-06-27 14:12:29 -0700 | [diff] [blame] | 70 | #define SHM_STAT_ANY 15 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 71 | struct shminfo { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 72 | int shmmax; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 73 | int shmmin; |
| 74 | int shmmni; |
| 75 | int shmseg; |
| 76 | int shmall; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 77 | }; |
| 78 | struct shm_info { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 79 | int used_ids; |
| 80 | __kernel_ulong_t shm_tot; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 81 | __kernel_ulong_t shm_rss; |
| 82 | __kernel_ulong_t shm_swp; |
| 83 | __kernel_ulong_t swap_attempts; |
| 84 | __kernel_ulong_t swap_successes; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 85 | }; |
| 86 | #endif |