xref: /OK3568_Linux_fs/kernel/include/uapi/asm-generic/msgbuf.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2*4882a593Smuzhiyun #ifndef __ASM_GENERIC_MSGBUF_H
3*4882a593Smuzhiyun #define __ASM_GENERIC_MSGBUF_H
4*4882a593Smuzhiyun 
5*4882a593Smuzhiyun #include <asm/bitsperlong.h>
6*4882a593Smuzhiyun #include <asm/ipcbuf.h>
7*4882a593Smuzhiyun 
8*4882a593Smuzhiyun /*
9*4882a593Smuzhiyun  * generic msqid64_ds structure.
10*4882a593Smuzhiyun  *
11*4882a593Smuzhiyun  * Note extra padding because this structure is passed back and forth
12*4882a593Smuzhiyun  * between kernel and user space.
13*4882a593Smuzhiyun  *
14*4882a593Smuzhiyun  * msqid64_ds was originally meant to be architecture specific, but
15*4882a593Smuzhiyun  * everyone just ended up making identical copies without specific
16*4882a593Smuzhiyun  * optimizations, so we may just as well all use the same one.
17*4882a593Smuzhiyun  *
18*4882a593Smuzhiyun  * 64 bit architectures use a 64-bit long time field here, while
19*4882a593Smuzhiyun  * 32 bit architectures have a pair of unsigned long values.
20*4882a593Smuzhiyun  * On big-endian systems, the lower half is in the wrong place.
21*4882a593Smuzhiyun  *
22*4882a593Smuzhiyun  * Pad space is left for:
23*4882a593Smuzhiyun  * - 2 miscellaneous 32-bit values
24*4882a593Smuzhiyun  */
25*4882a593Smuzhiyun 
26*4882a593Smuzhiyun struct msqid64_ds {
27*4882a593Smuzhiyun 	struct ipc64_perm msg_perm;
28*4882a593Smuzhiyun #if __BITS_PER_LONG == 64
29*4882a593Smuzhiyun 	long		 msg_stime;	/* last msgsnd time */
30*4882a593Smuzhiyun 	long		 msg_rtime;	/* last msgrcv time */
31*4882a593Smuzhiyun 	long		 msg_ctime;	/* last change time */
32*4882a593Smuzhiyun #else
33*4882a593Smuzhiyun 	unsigned long	msg_stime;	/* last msgsnd time */
34*4882a593Smuzhiyun 	unsigned long	msg_stime_high;
35*4882a593Smuzhiyun 	unsigned long	msg_rtime;	/* last msgrcv time */
36*4882a593Smuzhiyun 	unsigned long	msg_rtime_high;
37*4882a593Smuzhiyun 	unsigned long	msg_ctime;	/* last change time */
38*4882a593Smuzhiyun 	unsigned long	msg_ctime_high;
39*4882a593Smuzhiyun #endif
40*4882a593Smuzhiyun 	unsigned long	msg_cbytes;	/* current number of bytes on queue */
41*4882a593Smuzhiyun 	unsigned long	msg_qnum;	/* number of messages in queue */
42*4882a593Smuzhiyun 	unsigned long	 msg_qbytes;	/* max number of bytes on queue */
43*4882a593Smuzhiyun 	__kernel_pid_t msg_lspid;	/* pid of last msgsnd */
44*4882a593Smuzhiyun 	__kernel_pid_t msg_lrpid;	/* last receive pid */
45*4882a593Smuzhiyun 	unsigned long	 __unused4;
46*4882a593Smuzhiyun 	unsigned long	 __unused5;
47*4882a593Smuzhiyun };
48*4882a593Smuzhiyun 
49*4882a593Smuzhiyun #endif /* __ASM_GENERIC_MSGBUF_H */
50