18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
28c2ecf20Sopenharmony_ci#ifndef _ASM_SHMBUF_H
38c2ecf20Sopenharmony_ci#define _ASM_SHMBUF_H
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ci/*
68c2ecf20Sopenharmony_ci * The shmid64_ds structure for the MIPS architecture.
78c2ecf20Sopenharmony_ci * Note extra padding because this structure is passed back and forth
88c2ecf20Sopenharmony_ci * between kernel and user space.
98c2ecf20Sopenharmony_ci *
108c2ecf20Sopenharmony_ci * As MIPS was lacking proper padding after shm_?time, we use 48 bits
118c2ecf20Sopenharmony_ci * of the padding at the end to store a few additional bits of the time.
128c2ecf20Sopenharmony_ci * libc implementations need to take care to convert this into a proper
138c2ecf20Sopenharmony_ci * data structure when moving to 64-bit time_t.
148c2ecf20Sopenharmony_ci */
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ci#ifdef __mips64
178c2ecf20Sopenharmony_cistruct shmid64_ds {
188c2ecf20Sopenharmony_ci	struct ipc64_perm	shm_perm;	/* operation perms */
198c2ecf20Sopenharmony_ci	size_t			shm_segsz;	/* size of segment (bytes) */
208c2ecf20Sopenharmony_ci	long			shm_atime;	/* last attach time */
218c2ecf20Sopenharmony_ci	long			shm_dtime;	/* last detach time */
228c2ecf20Sopenharmony_ci	long			shm_ctime;	/* last change time */
238c2ecf20Sopenharmony_ci	__kernel_pid_t		shm_cpid;	/* pid of creator */
248c2ecf20Sopenharmony_ci	__kernel_pid_t		shm_lpid;	/* pid of last operator */
258c2ecf20Sopenharmony_ci	unsigned long		shm_nattch;	/* no. of current attaches */
268c2ecf20Sopenharmony_ci	unsigned long		__unused1;
278c2ecf20Sopenharmony_ci	unsigned long		__unused2;
288c2ecf20Sopenharmony_ci};
298c2ecf20Sopenharmony_ci#else
308c2ecf20Sopenharmony_cistruct shmid64_ds {
318c2ecf20Sopenharmony_ci	struct ipc64_perm	shm_perm;	/* operation perms */
328c2ecf20Sopenharmony_ci	size_t			shm_segsz;	/* size of segment (bytes) */
338c2ecf20Sopenharmony_ci	unsigned long		shm_atime;	/* last attach time */
348c2ecf20Sopenharmony_ci	unsigned long		shm_dtime;	/* last detach time */
358c2ecf20Sopenharmony_ci	unsigned long		shm_ctime;	/* last change time */
368c2ecf20Sopenharmony_ci	__kernel_pid_t		shm_cpid;	/* pid of creator */
378c2ecf20Sopenharmony_ci	__kernel_pid_t		shm_lpid;	/* pid of last operator */
388c2ecf20Sopenharmony_ci	unsigned long		shm_nattch;	/* no. of current attaches */
398c2ecf20Sopenharmony_ci	unsigned short		shm_atime_high;
408c2ecf20Sopenharmony_ci	unsigned short		shm_dtime_high;
418c2ecf20Sopenharmony_ci	unsigned short		shm_ctime_high;
428c2ecf20Sopenharmony_ci	unsigned short		__unused1;
438c2ecf20Sopenharmony_ci};
448c2ecf20Sopenharmony_ci#endif
458c2ecf20Sopenharmony_ci
468c2ecf20Sopenharmony_cistruct shminfo64 {
478c2ecf20Sopenharmony_ci	unsigned long	shmmax;
488c2ecf20Sopenharmony_ci	unsigned long	shmmin;
498c2ecf20Sopenharmony_ci	unsigned long	shmmni;
508c2ecf20Sopenharmony_ci	unsigned long	shmseg;
518c2ecf20Sopenharmony_ci	unsigned long	shmall;
528c2ecf20Sopenharmony_ci	unsigned long	__unused1;
538c2ecf20Sopenharmony_ci	unsigned long	__unused2;
548c2ecf20Sopenharmony_ci	unsigned long	__unused3;
558c2ecf20Sopenharmony_ci	unsigned long	__unused4;
568c2ecf20Sopenharmony_ci};
578c2ecf20Sopenharmony_ci
588c2ecf20Sopenharmony_ci#endif /* _ASM_SHMBUF_H */
59