1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2#ifndef _ASM_SHMBUF_H
3#define _ASM_SHMBUF_H
4
5/*
6 * The shmid64_ds structure for the MIPS architecture.
7 * Note extra padding because this structure is passed back and forth
8 * between kernel and user space.
9 *
10 * As MIPS was lacking proper padding after shm_?time, we use 48 bits
11 * of the padding at the end to store a few additional bits of the time.
12 * libc implementations need to take care to convert this into a proper
13 * data structure when moving to 64-bit time_t.
14 */
15
16#ifdef __mips64
17struct shmid64_ds {
18	struct ipc64_perm	shm_perm;	/* operation perms */
19	size_t			shm_segsz;	/* size of segment (bytes) */
20	long			shm_atime;	/* last attach time */
21	long			shm_dtime;	/* last detach time */
22	long			shm_ctime;	/* last change time */
23	__kernel_pid_t		shm_cpid;	/* pid of creator */
24	__kernel_pid_t		shm_lpid;	/* pid of last operator */
25	unsigned long		shm_nattch;	/* no. of current attaches */
26	unsigned long		__unused1;
27	unsigned long		__unused2;
28};
29#else
30struct shmid64_ds {
31	struct ipc64_perm	shm_perm;	/* operation perms */
32	size_t			shm_segsz;	/* size of segment (bytes) */
33	unsigned long		shm_atime;	/* last attach time */
34	unsigned long		shm_dtime;	/* last detach time */
35	unsigned long		shm_ctime;	/* last change time */
36	__kernel_pid_t		shm_cpid;	/* pid of creator */
37	__kernel_pid_t		shm_lpid;	/* pid of last operator */
38	unsigned long		shm_nattch;	/* no. of current attaches */
39	unsigned short		shm_atime_high;
40	unsigned short		shm_dtime_high;
41	unsigned short		shm_ctime_high;
42	unsigned short		__unused1;
43};
44#endif
45
46struct shminfo64 {
47	unsigned long	shmmax;
48	unsigned long	shmmin;
49	unsigned long	shmmni;
50	unsigned long	shmseg;
51	unsigned long	shmall;
52	unsigned long	__unused1;
53	unsigned long	__unused2;
54	unsigned long	__unused3;
55	unsigned long	__unused4;
56};
57
58#endif /* _ASM_SHMBUF_H */
59