aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2015-05-05 17:19:43 -0400
committerArnd Bergmann <arnd@arndb.de>2018-04-20 10:20:13 -0400
commitd0b67de998025210c31bbceb79739df8e28a3d4f (patch)
treec64c8ae40810dc4f543707469b897d3902c91678
parent91b9b0d71879eba67c93edd05e94bd3e28e1f199 (diff)
y2038: powerpc: Extend sysvipc data structures
powerpc, uses a nonstandard variation of the generic sysvipc data structures, intended to have the padding moved around so it can deal with big-endian 32-bit user space that has 64-bit time_t. powerpc has the same definition as parisc and sparc, but now also supports little-endian mode, which is now wrong because the padding is made for big-endian user space. This takes just take the same approach here that we have for the asm-generic headers and adds separate 32-bit fields for the upper halves of the timestamps, to let libc deal with the mess in user space. Signed-off-by: Arnd Bergmann <arnd@arndb.de>
-rw-r--r--arch/powerpc/include/asm/compat.h32
-rw-r--r--arch/powerpc/include/uapi/asm/msgbuf.h18
-rw-r--r--arch/powerpc/include/uapi/asm/sembuf.h14
-rw-r--r--arch/powerpc/include/uapi/asm/shmbuf.h19
4 files changed, 40 insertions, 43 deletions
diff --git a/arch/powerpc/include/asm/compat.h b/arch/powerpc/include/asm/compat.h
index b4773c81f7d5..85c8af2bb272 100644
--- a/arch/powerpc/include/asm/compat.h
+++ b/arch/powerpc/include/asm/compat.h
@@ -162,10 +162,10 @@ struct compat_ipc64_perm {
162 162
163struct compat_semid64_ds { 163struct compat_semid64_ds {
164 struct compat_ipc64_perm sem_perm; 164 struct compat_ipc64_perm sem_perm;
165 unsigned int __unused1; 165 unsigned int sem_otime_high;
166 compat_time_t sem_otime; 166 unsigned int sem_otime;
167 unsigned int __unused2; 167 unsigned int sem_ctime_high;
168 compat_time_t sem_ctime; 168 unsigned int sem_ctime;
169 compat_ulong_t sem_nsems; 169 compat_ulong_t sem_nsems;
170 compat_ulong_t __unused3; 170 compat_ulong_t __unused3;
171 compat_ulong_t __unused4; 171 compat_ulong_t __unused4;
@@ -173,12 +173,12 @@ struct compat_semid64_ds {
173 173
174struct compat_msqid64_ds { 174struct compat_msqid64_ds {
175 struct compat_ipc64_perm msg_perm; 175 struct compat_ipc64_perm msg_perm;
176 unsigned int __unused1; 176 unsigned int msg_stime_high;
177 compat_time_t msg_stime; 177 unsigned int msg_stime;
178 unsigned int __unused2; 178 unsigned int msg_rtime_high;
179 compat_time_t msg_rtime; 179 unsigned int msg_rtime;
180 unsigned int __unused3; 180 unsigned int msg_ctime_high;
181 compat_time_t msg_ctime; 181 unsigned int msg_ctime;
182 compat_ulong_t msg_cbytes; 182 compat_ulong_t msg_cbytes;
183 compat_ulong_t msg_qnum; 183 compat_ulong_t msg_qnum;
184 compat_ulong_t msg_qbytes; 184 compat_ulong_t msg_qbytes;
@@ -190,12 +190,12 @@ struct compat_msqid64_ds {
190 190
191struct compat_shmid64_ds { 191struct compat_shmid64_ds {
192 struct compat_ipc64_perm shm_perm; 192 struct compat_ipc64_perm shm_perm;
193 unsigned int __unused1; 193 unsigned int shm_atime_high;
194 compat_time_t shm_atime; 194 unsigned int shm_atime;
195 unsigned int __unused2; 195 unsigned int shm_dtime_high;
196 compat_time_t shm_dtime; 196 unsigned int shm_dtime;
197 unsigned int __unused3; 197 unsigned int shm_ctime_high;
198 compat_time_t shm_ctime; 198 unsigned int shm_ctime;
199 unsigned int __unused4; 199 unsigned int __unused4;
200 compat_size_t shm_segsz; 200 compat_size_t shm_segsz;
201 compat_pid_t shm_cpid; 201 compat_pid_t shm_cpid;
diff --git a/arch/powerpc/include/uapi/asm/msgbuf.h b/arch/powerpc/include/uapi/asm/msgbuf.h
index 65beb0942500..2b1b37797a47 100644
--- a/arch/powerpc/include/uapi/asm/msgbuf.h
+++ b/arch/powerpc/include/uapi/asm/msgbuf.h
@@ -10,18 +10,18 @@
10 10
11struct msqid64_ds { 11struct msqid64_ds {
12 struct ipc64_perm msg_perm; 12 struct ipc64_perm msg_perm;
13#ifndef __powerpc64__ 13#ifdef __powerpc64__
14 unsigned int __unused1;
15#endif
16 __kernel_time_t msg_stime; /* last msgsnd time */ 14 __kernel_time_t msg_stime; /* last msgsnd time */
17#ifndef __powerpc64__
18 unsigned int __unused2;
19#endif
20 __kernel_time_t msg_rtime; /* last msgrcv time */ 15 __kernel_time_t msg_rtime; /* last msgrcv time */
21#ifndef __powerpc64__
22 unsigned int __unused3;
23#endif
24 __kernel_time_t msg_ctime; /* last change time */ 16 __kernel_time_t msg_ctime; /* last change time */
17#else
18 unsigned long msg_stime_high;
19 unsigned long msg_stime; /* last msgsnd time */
20 unsigned long msg_rtime_high;
21 unsigned long msg_rtime; /* last msgrcv time */
22 unsigned long msg_ctime_high;
23 unsigned long msg_ctime; /* last change time */
24#endif
25 unsigned long msg_cbytes; /* current number of bytes on queue */ 25 unsigned long msg_cbytes; /* current number of bytes on queue */
26 unsigned long msg_qnum; /* number of messages in queue */ 26 unsigned long msg_qnum; /* number of messages in queue */
27 unsigned long msg_qbytes; /* max number of bytes on queue */ 27 unsigned long msg_qbytes; /* max number of bytes on queue */
diff --git a/arch/powerpc/include/uapi/asm/sembuf.h b/arch/powerpc/include/uapi/asm/sembuf.h
index 8f393d60f02d..3f60946f77e3 100644
--- a/arch/powerpc/include/uapi/asm/sembuf.h
+++ b/arch/powerpc/include/uapi/asm/sembuf.h
@@ -15,20 +15,20 @@
15 * between kernel and user space. 15 * between kernel and user space.
16 * 16 *
17 * Pad space is left for: 17 * Pad space is left for:
18 * - 64-bit time_t to solve y2038 problem 18 * - 2 miscellaneous 32/64-bit values
19 * - 2 miscellaneous 32-bit values
20 */ 19 */
21 20
22struct semid64_ds { 21struct semid64_ds {
23 struct ipc64_perm sem_perm; /* permissions .. see ipc.h */ 22 struct ipc64_perm sem_perm; /* permissions .. see ipc.h */
24#ifndef __powerpc64__ 23#ifndef __powerpc64__
25 unsigned long __unused1; 24 unsigned long sem_otime_high;
26#endif 25 unsigned long sem_otime; /* last semop time */
26 unsigned long sem_ctime_high;
27 unsigned long sem_ctime; /* last change time */
28#else
27 __kernel_time_t sem_otime; /* last semop time */ 29 __kernel_time_t sem_otime; /* last semop time */
28#ifndef __powerpc64__
29 unsigned long __unused2;
30#endif
31 __kernel_time_t sem_ctime; /* last change time */ 30 __kernel_time_t sem_ctime; /* last change time */
31#endif
32 unsigned long sem_nsems; /* no. of semaphores in array */ 32 unsigned long sem_nsems; /* no. of semaphores in array */
33 unsigned long __unused3; 33 unsigned long __unused3;
34 unsigned long __unused4; 34 unsigned long __unused4;
diff --git a/arch/powerpc/include/uapi/asm/shmbuf.h b/arch/powerpc/include/uapi/asm/shmbuf.h
index deb1c3e503d3..b591c4d7e4c5 100644
--- a/arch/powerpc/include/uapi/asm/shmbuf.h
+++ b/arch/powerpc/include/uapi/asm/shmbuf.h
@@ -16,25 +16,22 @@
16 * between kernel and user space. 16 * between kernel and user space.
17 * 17 *
18 * Pad space is left for: 18 * Pad space is left for:
19 * - 64-bit time_t to solve y2038 problem
20 * - 2 miscellaneous 32-bit values 19 * - 2 miscellaneous 32-bit values
21 */ 20 */
22 21
23struct shmid64_ds { 22struct shmid64_ds {
24 struct ipc64_perm shm_perm; /* operation perms */ 23 struct ipc64_perm shm_perm; /* operation perms */
25#ifndef __powerpc64__ 24#ifdef __powerpc64__
26 unsigned long __unused1;
27#endif
28 __kernel_time_t shm_atime; /* last attach time */ 25 __kernel_time_t shm_atime; /* last attach time */
29#ifndef __powerpc64__
30 unsigned long __unused2;
31#endif
32 __kernel_time_t shm_dtime; /* last detach time */ 26 __kernel_time_t shm_dtime; /* last detach time */
33#ifndef __powerpc64__
34 unsigned long __unused3;
35#endif
36 __kernel_time_t shm_ctime; /* last change time */ 27 __kernel_time_t shm_ctime; /* last change time */
37#ifndef __powerpc64__ 28#else
29 unsigned long shm_atime_high;
30 unsigned long shm_atime; /* last attach time */
31 unsigned long shm_dtime_high;
32 unsigned long shm_dtime; /* last detach time */
33 unsigned long shm_ctime_high;
34 unsigned long shm_ctime; /* last change time */
38 unsigned long __unused4; 35 unsigned long __unused4;
39#endif 36#endif
40 size_t shm_segsz; /* size of segment (bytes) */ 37 size_t shm_segsz; /* size of segment (bytes) */