^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_MSGBUF_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) #define __ASM_GENERIC_MSGBUF_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) #include <asm/ipcbuf.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) * generic msqid64_ds structure.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) * Note extra padding because this structure is passed back and forth
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) * between kernel and user space.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) * msqid64_ds was originally meant to be architecture specific, but
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) * everyone just ended up making identical copies without specific
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) * optimizations, so we may just as well all use the same one.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) * 64 bit architectures use a 64-bit long time field here, while
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) * 32 bit architectures have a pair of unsigned long values.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) * On big-endian systems, the lower half is in the wrong place.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) * Pad space is left for:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) * - 2 miscellaneous 32-bit values
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) struct msqid64_ds {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) struct ipc64_perm msg_perm;
^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 msg_stime; /* last msgsnd time */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) long msg_rtime; /* last msgrcv time */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) long msg_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 msg_stime; /* last msgsnd time */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) unsigned long msg_stime_high;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) unsigned long msg_rtime; /* last msgrcv time */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) unsigned long msg_rtime_high;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) unsigned long msg_ctime; /* last change time */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) unsigned long msg_ctime_high;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) unsigned long msg_cbytes; /* current number of bytes on queue */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) unsigned long msg_qnum; /* number of messages in queue */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) unsigned long msg_qbytes; /* max number of bytes on queue */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) __kernel_pid_t msg_lspid; /* pid of last msgsnd */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) __kernel_pid_t msg_lrpid; /* last receive pid */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) unsigned long __unused4;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) unsigned long __unused5;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) #endif /* __ASM_GENERIC_MSGBUF_H */