18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
28c2ecf20Sopenharmony_ci#ifndef __ASM_GENERIC_MSGBUF_H
38c2ecf20Sopenharmony_ci#define __ASM_GENERIC_MSGBUF_H
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ci#include <asm/bitsperlong.h>
68c2ecf20Sopenharmony_ci#include <asm/ipcbuf.h>
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_ci/*
98c2ecf20Sopenharmony_ci * generic msqid64_ds structure.
108c2ecf20Sopenharmony_ci *
118c2ecf20Sopenharmony_ci * Note extra padding because this structure is passed back and forth
128c2ecf20Sopenharmony_ci * between kernel and user space.
138c2ecf20Sopenharmony_ci *
148c2ecf20Sopenharmony_ci * msqid64_ds was originally meant to be architecture specific, but
158c2ecf20Sopenharmony_ci * everyone just ended up making identical copies without specific
168c2ecf20Sopenharmony_ci * optimizations, so we may just as well all use the same one.
178c2ecf20Sopenharmony_ci *
188c2ecf20Sopenharmony_ci * 64 bit architectures use a 64-bit long time field here, while
198c2ecf20Sopenharmony_ci * 32 bit architectures have a pair of unsigned long values.
208c2ecf20Sopenharmony_ci * On big-endian systems, the lower half is in the wrong place.
218c2ecf20Sopenharmony_ci *
228c2ecf20Sopenharmony_ci * Pad space is left for:
238c2ecf20Sopenharmony_ci * - 2 miscellaneous 32-bit values
248c2ecf20Sopenharmony_ci */
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_cistruct msqid64_ds {
278c2ecf20Sopenharmony_ci	struct ipc64_perm msg_perm;
288c2ecf20Sopenharmony_ci#if __BITS_PER_LONG == 64
298c2ecf20Sopenharmony_ci	long		 msg_stime;	/* last msgsnd time */
308c2ecf20Sopenharmony_ci	long		 msg_rtime;	/* last msgrcv time */
318c2ecf20Sopenharmony_ci	long		 msg_ctime;	/* last change time */
328c2ecf20Sopenharmony_ci#else
338c2ecf20Sopenharmony_ci	unsigned long	msg_stime;	/* last msgsnd time */
348c2ecf20Sopenharmony_ci	unsigned long	msg_stime_high;
358c2ecf20Sopenharmony_ci	unsigned long	msg_rtime;	/* last msgrcv time */
368c2ecf20Sopenharmony_ci	unsigned long	msg_rtime_high;
378c2ecf20Sopenharmony_ci	unsigned long	msg_ctime;	/* last change time */
388c2ecf20Sopenharmony_ci	unsigned long	msg_ctime_high;
398c2ecf20Sopenharmony_ci#endif
408c2ecf20Sopenharmony_ci	unsigned long	msg_cbytes;	/* current number of bytes on queue */
418c2ecf20Sopenharmony_ci	unsigned long	msg_qnum;	/* number of messages in queue */
428c2ecf20Sopenharmony_ci	unsigned long	 msg_qbytes;	/* max number of bytes on queue */
438c2ecf20Sopenharmony_ci	__kernel_pid_t msg_lspid;	/* pid of last msgsnd */
448c2ecf20Sopenharmony_ci	__kernel_pid_t msg_lrpid;	/* last receive pid */
458c2ecf20Sopenharmony_ci	unsigned long	 __unused4;
468c2ecf20Sopenharmony_ci	unsigned long	 __unused5;
478c2ecf20Sopenharmony_ci};
488c2ecf20Sopenharmony_ci
498c2ecf20Sopenharmony_ci#endif /* __ASM_GENERIC_MSGBUF_H */
50