^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) #ifndef __ASM_GENERIC_SHMBUF_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) #define __ASM_GENERIC_SHMBUF_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) #include <asm/bitsperlong.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) * The shmid64_ds structure for x86 architecture.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) * Note extra padding because this structure is passed back and forth
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) * between kernel and user space.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) * shmid64_ds was originally meant to be architecture specific, but
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) * everyone just ended up making identical copies without specific
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) * optimizations, so we may just as well all use the same one.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) * 64 bit architectures use a 64-bit long time field here, while
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) * 32 bit architectures have a pair of unsigned long values.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) * On big-endian systems, the lower half is in the wrong place.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) * Pad space is left for:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) * - 2 miscellaneous 32-bit values
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) struct shmid64_ds {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) struct ipc64_perm shm_perm; /* operation perms */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) size_t shm_segsz; /* size of segment (bytes) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) #if __BITS_PER_LONG == 64
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) long shm_atime; /* last attach time */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) long shm_dtime; /* last detach time */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) long shm_ctime; /* last change time */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) unsigned long shm_atime; /* last attach time */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) unsigned long shm_atime_high;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) unsigned long shm_dtime; /* last detach time */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) unsigned long shm_dtime_high;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) unsigned long shm_ctime; /* last change time */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) unsigned long shm_ctime_high;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) __kernel_pid_t shm_cpid; /* pid of creator */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) __kernel_pid_t shm_lpid; /* pid of last operator */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) unsigned long shm_nattch; /* no. of current attaches */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) unsigned long __unused4;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) unsigned long __unused5;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) struct shminfo64 {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) unsigned long shmmax;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) unsigned long shmmin;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) unsigned long shmmni;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) unsigned long shmseg;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) unsigned long shmall;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) unsigned long __unused1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) unsigned long __unused2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) unsigned long __unused3;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) unsigned long __unused4;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) #endif /* __ASM_GENERIC_SHMBUF_H */