summaryrefslogtreecommitdiffstats
path: root/arch/mips/include/uapi/asm/shmbuf.h
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2018-05-07 14:21:39 +0200
committerThomas Gleixner <tglx@linutronix.de>2018-05-07 14:21:39 +0200
commit4fe581d7f114d56f31f392448477cff5a4394065 (patch)
treeda70446e8b9bf49441907a3c15c04e39edeb9210 /arch/mips/include/uapi/asm/shmbuf.h
parent1cfd904f16740df21b2df7b41c7a0dc00cbd434c (diff)
parent5dc0b1529d21b54aad4098874e334a52027fd16d (diff)
downloadlinux-4fe581d7f114d56f31f392448477cff5a4394065.tar.bz2
Merge tag 'y2038-ipc' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground into timers/2038
Pull 'y2038: IPC system call conversion' from Arnd Bergmann: "This is a follow-up to Deepa's work on the timekeeping system calls, providing a y2038-safe syscall API for SYSVIPC. It uses a combination of two strategies: For sys_msgctl, sys_semctl and sys_shmctl, I do not introduce a completely new set of replacement system calls, but instead extend the existing ones to return data in the reserved fields of the normal data structure. This should be completely transparent to any existing user space, and only after the 32-bit time_t wraps, it will make a difference in the returned data. libc implementations will consequently have to provide their own data structures when they move to 64-bit time_t, and convert the structures in user space from the ones returned by the kernel. In contrast, mq_timedsend, mq_timedreceive and and semtimedop all do need to change because having a libc redefine the timespec type breaks the ABI, so with this series there will be two separate entry points for 32-bit architectures. There are three cases here: - little-endian architectures (except powerpc and mips) can use the normal layout and just cast the data structure to the user space type that contains 64-bit numbers. - parisc and sparc can do the same thing with big-endian user space - little-endian powerpc and most big-endian architectures have to flip the upper and lower 32-bit halves of the time_t value in memory, but can otherwise keep using the normal layout - mips and big-endian xtensa need to be more careful because they are not consistent in their definitions, and they have to provide custom libc implementations for the system calls to use 64-bit time_t."
Diffstat (limited to 'arch/mips/include/uapi/asm/shmbuf.h')
-rw-r--r--arch/mips/include/uapi/asm/shmbuf.h23
1 files changed, 21 insertions, 2 deletions
diff --git a/arch/mips/include/uapi/asm/shmbuf.h b/arch/mips/include/uapi/asm/shmbuf.h
index 379e6bca518b..9b9bba3401f2 100644
--- a/arch/mips/include/uapi/asm/shmbuf.h
+++ b/arch/mips/include/uapi/asm/shmbuf.h
@@ -7,10 +7,13 @@
* Note extra padding because this structure is passed back and forth
* between kernel and user space.
*
- * Pad space is left for:
- * - 2 miscellaneous 32-bit rsp. 64-bit values
+ * As MIPS was lacking proper padding after shm_?time, we use 48 bits
+ * of the padding at the end to store a few additional bits of the time.
+ * libc implementations need to take care to convert this into a proper
+ * data structure when moving to 64-bit time_t.
*/
+#ifdef __mips64
struct shmid64_ds {
struct ipc64_perm shm_perm; /* operation perms */
size_t shm_segsz; /* size of segment (bytes) */
@@ -23,6 +26,22 @@ struct shmid64_ds {
unsigned long __unused1;
unsigned long __unused2;
};
+#else
+struct shmid64_ds {
+ struct ipc64_perm shm_perm; /* operation perms */
+ size_t shm_segsz; /* size of segment (bytes) */
+ unsigned long shm_atime; /* last attach time */
+ unsigned long shm_dtime; /* last detach time */
+ unsigned long shm_ctime; /* last change time */
+ __kernel_pid_t shm_cpid; /* pid of creator */
+ __kernel_pid_t shm_lpid; /* pid of last operator */
+ unsigned long shm_nattch; /* no. of current attaches */
+ unsigned short shm_atime_high;
+ unsigned short shm_dtime_high;
+ unsigned short shm_ctime_high;
+ unsigned short __unused1;
+};
+#endif
struct shminfo64 {
unsigned long shmmax;