aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-11-09 19:37:00 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2015-11-09 19:37:00 -0500
commit373ee21eecebc5c06786a803d99661a3657afcc7 (patch)
tree7bbea5ea95be806b5bd7453df8f51b185d0ff623
parentf4d68930a88219ffda60f137dcc858e4f5db6680 (diff)
parentd0cf62fb63f760e98244d31396b3b58f3a1e326b (diff)
Merge branch 'parisc-4.4-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux
Pull parisc updates from Helge Deller: "We have two patches in here: - The parisc uapi headers have been screwed up since quite some time. This patch fixes some bugs (e.g. endianess not respected in compat_semid64_ds) and cleans them up (e.g. uid_t was used instead of __kernel_uid_t) so that they can be used by userspace again. This patch has been reviewed by Arnd Bergmann and is scheduled for stable kernel series. - Drop the hpux_stat64 struct from stat.h, we do not support HP-UX binaries since kernel 4.0" * 'parisc-4.4-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux: parisc: Fixes and cleanups in kernel uapi header files parisc: Drop hpux_stat64 struct from stat.h header file
-rw-r--r--arch/parisc/include/asm/compat.h4
-rw-r--r--arch/parisc/include/uapi/asm/ipcbuf.h19
-rw-r--r--arch/parisc/include/uapi/asm/msgbuf.h10
-rw-r--r--arch/parisc/include/uapi/asm/posix_types.h2
-rw-r--r--arch/parisc/include/uapi/asm/sembuf.h6
-rw-r--r--arch/parisc/include/uapi/asm/shmbuf.h8
-rw-r--r--arch/parisc/include/uapi/asm/stat.h31
-rw-r--r--arch/parisc/mm/init.c16
8 files changed, 44 insertions, 52 deletions
diff --git a/arch/parisc/include/asm/compat.h b/arch/parisc/include/asm/compat.h
index 94710cfc1ce8..0448a2c8eafb 100644
--- a/arch/parisc/include/asm/compat.h
+++ b/arch/parisc/include/asm/compat.h
@@ -206,10 +206,10 @@ struct compat_ipc64_perm {
206 206
207struct compat_semid64_ds { 207struct compat_semid64_ds {
208 struct compat_ipc64_perm sem_perm; 208 struct compat_ipc64_perm sem_perm;
209 compat_time_t sem_otime;
210 unsigned int __unused1; 209 unsigned int __unused1;
211 compat_time_t sem_ctime; 210 compat_time_t sem_otime;
212 unsigned int __unused2; 211 unsigned int __unused2;
212 compat_time_t sem_ctime;
213 compat_ulong_t sem_nsems; 213 compat_ulong_t sem_nsems;
214 compat_ulong_t __unused3; 214 compat_ulong_t __unused3;
215 compat_ulong_t __unused4; 215 compat_ulong_t __unused4;
diff --git a/arch/parisc/include/uapi/asm/ipcbuf.h b/arch/parisc/include/uapi/asm/ipcbuf.h
index bd956c425785..790c4119f647 100644
--- a/arch/parisc/include/uapi/asm/ipcbuf.h
+++ b/arch/parisc/include/uapi/asm/ipcbuf.h
@@ -1,6 +1,9 @@
1#ifndef __PARISC_IPCBUF_H__ 1#ifndef __PARISC_IPCBUF_H__
2#define __PARISC_IPCBUF_H__ 2#define __PARISC_IPCBUF_H__
3 3
4#include <asm/bitsperlong.h>
5#include <linux/posix_types.h>
6
4/* 7/*
5 * The ipc64_perm structure for PA-RISC is almost identical to 8 * The ipc64_perm structure for PA-RISC is almost identical to
6 * kern_ipc_perm as we have always had 32-bit UIDs and GIDs in the kernel. 9 * kern_ipc_perm as we have always had 32-bit UIDs and GIDs in the kernel.
@@ -10,16 +13,18 @@
10 13
11struct ipc64_perm 14struct ipc64_perm
12{ 15{
13 key_t key; 16 __kernel_key_t key;
14 uid_t uid; 17 __kernel_uid_t uid;
15 gid_t gid; 18 __kernel_gid_t gid;
16 uid_t cuid; 19 __kernel_uid_t cuid;
17 gid_t cgid; 20 __kernel_gid_t cgid;
21#if __BITS_PER_LONG != 64
18 unsigned short int __pad1; 22 unsigned short int __pad1;
19 mode_t mode; 23#endif
24 __kernel_mode_t mode;
20 unsigned short int __pad2; 25 unsigned short int __pad2;
21 unsigned short int seq; 26 unsigned short int seq;
22 unsigned int __pad3; 27 unsigned int __pad3;
23 unsigned long long int __unused1; 28 unsigned long long int __unused1;
24 unsigned long long int __unused2; 29 unsigned long long int __unused2;
25}; 30};
diff --git a/arch/parisc/include/uapi/asm/msgbuf.h b/arch/parisc/include/uapi/asm/msgbuf.h
index 342138983914..2e83ac758e19 100644
--- a/arch/parisc/include/uapi/asm/msgbuf.h
+++ b/arch/parisc/include/uapi/asm/msgbuf.h
@@ -27,13 +27,13 @@ struct msqid64_ds {
27 unsigned int __pad3; 27 unsigned int __pad3;
28#endif 28#endif
29 __kernel_time_t msg_ctime; /* last change time */ 29 __kernel_time_t msg_ctime; /* last change time */
30 unsigned int msg_cbytes; /* current number of bytes on queue */ 30 unsigned long msg_cbytes; /* current number of bytes on queue */
31 unsigned int msg_qnum; /* number of messages in queue */ 31 unsigned long msg_qnum; /* number of messages in queue */
32 unsigned int msg_qbytes; /* max number of bytes on queue */ 32 unsigned long msg_qbytes; /* max number of bytes on queue */
33 __kernel_pid_t msg_lspid; /* pid of last msgsnd */ 33 __kernel_pid_t msg_lspid; /* pid of last msgsnd */
34 __kernel_pid_t msg_lrpid; /* last receive pid */ 34 __kernel_pid_t msg_lrpid; /* last receive pid */
35 unsigned int __unused1; 35 unsigned long __unused1;
36 unsigned int __unused2; 36 unsigned long __unused2;
37}; 37};
38 38
39#endif /* _PARISC_MSGBUF_H */ 39#endif /* _PARISC_MSGBUF_H */
diff --git a/arch/parisc/include/uapi/asm/posix_types.h b/arch/parisc/include/uapi/asm/posix_types.h
index b9344256f76b..f3b5f70b9a5f 100644
--- a/arch/parisc/include/uapi/asm/posix_types.h
+++ b/arch/parisc/include/uapi/asm/posix_types.h
@@ -7,8 +7,10 @@
7 * assume GCC is being used. 7 * assume GCC is being used.
8 */ 8 */
9 9
10#ifndef __LP64__
10typedef unsigned short __kernel_mode_t; 11typedef unsigned short __kernel_mode_t;
11#define __kernel_mode_t __kernel_mode_t 12#define __kernel_mode_t __kernel_mode_t
13#endif
12 14
13typedef unsigned short __kernel_ipc_pid_t; 15typedef unsigned short __kernel_ipc_pid_t;
14#define __kernel_ipc_pid_t __kernel_ipc_pid_t 16#define __kernel_ipc_pid_t __kernel_ipc_pid_t
diff --git a/arch/parisc/include/uapi/asm/sembuf.h b/arch/parisc/include/uapi/asm/sembuf.h
index f01d89e30d73..c20971bf520f 100644
--- a/arch/parisc/include/uapi/asm/sembuf.h
+++ b/arch/parisc/include/uapi/asm/sembuf.h
@@ -23,9 +23,9 @@ struct semid64_ds {
23 unsigned int __pad2; 23 unsigned int __pad2;
24#endif 24#endif
25 __kernel_time_t sem_ctime; /* last change time */ 25 __kernel_time_t sem_ctime; /* last change time */
26 unsigned int sem_nsems; /* no. of semaphores in array */ 26 unsigned long sem_nsems; /* no. of semaphores in array */
27 unsigned int __unused1; 27 unsigned long __unused1;
28 unsigned int __unused2; 28 unsigned long __unused2;
29}; 29};
30 30
31#endif /* _PARISC_SEMBUF_H */ 31#endif /* _PARISC_SEMBUF_H */
diff --git a/arch/parisc/include/uapi/asm/shmbuf.h b/arch/parisc/include/uapi/asm/shmbuf.h
index 8496c38560c6..750e13e77991 100644
--- a/arch/parisc/include/uapi/asm/shmbuf.h
+++ b/arch/parisc/include/uapi/asm/shmbuf.h
@@ -30,12 +30,12 @@ struct shmid64_ds {
30#if __BITS_PER_LONG != 64 30#if __BITS_PER_LONG != 64
31 unsigned int __pad4; 31 unsigned int __pad4;
32#endif 32#endif
33 size_t shm_segsz; /* size of segment (bytes) */ 33 __kernel_size_t shm_segsz; /* size of segment (bytes) */
34 __kernel_pid_t shm_cpid; /* pid of creator */ 34 __kernel_pid_t shm_cpid; /* pid of creator */
35 __kernel_pid_t shm_lpid; /* pid of last operator */ 35 __kernel_pid_t shm_lpid; /* pid of last operator */
36 unsigned int shm_nattch; /* no. of current attaches */ 36 unsigned long shm_nattch; /* no. of current attaches */
37 unsigned int __unused1; 37 unsigned long __unused1;
38 unsigned int __unused2; 38 unsigned long __unused2;
39}; 39};
40 40
41struct shminfo64 { 41struct shminfo64 {
diff --git a/arch/parisc/include/uapi/asm/stat.h b/arch/parisc/include/uapi/asm/stat.h
index b606b366d0a7..3310d2a49759 100644
--- a/arch/parisc/include/uapi/asm/stat.h
+++ b/arch/parisc/include/uapi/asm/stat.h
@@ -36,37 +36,6 @@ struct stat {
36 36
37#define STAT_HAVE_NSEC 37#define STAT_HAVE_NSEC
38 38
39struct hpux_stat64 {
40 unsigned int st_dev; /* dev_t is 32 bits on parisc */
41 unsigned int st_ino; /* 32 bits */
42 unsigned short st_mode; /* 16 bits */
43 unsigned short st_nlink; /* 16 bits */
44 unsigned short st_reserved1; /* old st_uid */
45 unsigned short st_reserved2; /* old st_gid */
46 unsigned int st_rdev;
47 signed long long st_size;
48 signed int st_atime;
49 unsigned int st_spare1;
50 signed int st_mtime;
51 unsigned int st_spare2;
52 signed int st_ctime;
53 unsigned int st_spare3;
54 int st_blksize;
55 unsigned long long st_blocks;
56 unsigned int __unused1; /* ACL stuff */
57 unsigned int __unused2; /* network */
58 unsigned int __unused3; /* network */
59 unsigned int __unused4; /* cnodes */
60 unsigned short __unused5; /* netsite */
61 short st_fstype;
62 unsigned int st_realdev;
63 unsigned short st_basemode;
64 unsigned short st_spareshort;
65 unsigned int st_uid;
66 unsigned int st_gid;
67 unsigned int st_spare4[3];
68};
69
70/* This is the struct that 32-bit userspace applications are expecting. 39/* This is the struct that 32-bit userspace applications are expecting.
71 * How 64-bit apps are going to be compiled, I have no idea. But at least 40 * How 64-bit apps are going to be compiled, I have no idea. But at least
72 * this way, we don't have a wrapper in the kernel. 41 * this way, we don't have a wrapper in the kernel.
diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c
index c229427fa546..c5fec4890fdf 100644
--- a/arch/parisc/mm/init.c
+++ b/arch/parisc/mm/init.c
@@ -23,6 +23,7 @@
23#include <linux/unistd.h> 23#include <linux/unistd.h>
24#include <linux/nodemask.h> /* for node_online_map */ 24#include <linux/nodemask.h> /* for node_online_map */
25#include <linux/pagemap.h> /* for release_pages and page_cache_release */ 25#include <linux/pagemap.h> /* for release_pages and page_cache_release */
26#include <linux/compat.h>
26 27
27#include <asm/pgalloc.h> 28#include <asm/pgalloc.h>
28#include <asm/pgtable.h> 29#include <asm/pgtable.h>
@@ -30,6 +31,7 @@
30#include <asm/pdc_chassis.h> 31#include <asm/pdc_chassis.h>
31#include <asm/mmzone.h> 32#include <asm/mmzone.h>
32#include <asm/sections.h> 33#include <asm/sections.h>
34#include <asm/msgbuf.h>
33 35
34extern int data_start; 36extern int data_start;
35extern void parisc_kernel_start(void); /* Kernel entry point in head.S */ 37extern void parisc_kernel_start(void); /* Kernel entry point in head.S */
@@ -590,6 +592,20 @@ unsigned long pcxl_dma_start __read_mostly;
590 592
591void __init mem_init(void) 593void __init mem_init(void)
592{ 594{
595 /* Do sanity checks on IPC (compat) structures */
596 BUILD_BUG_ON(sizeof(struct ipc64_perm) != 48);
597#ifndef CONFIG_64BIT
598 BUILD_BUG_ON(sizeof(struct semid64_ds) != 80);
599 BUILD_BUG_ON(sizeof(struct msqid64_ds) != 104);
600 BUILD_BUG_ON(sizeof(struct shmid64_ds) != 104);
601#endif
602#ifdef CONFIG_COMPAT
603 BUILD_BUG_ON(sizeof(struct compat_ipc64_perm) != sizeof(struct ipc64_perm));
604 BUILD_BUG_ON(sizeof(struct compat_semid64_ds) != 80);
605 BUILD_BUG_ON(sizeof(struct compat_msqid64_ds) != 104);
606 BUILD_BUG_ON(sizeof(struct compat_shmid64_ds) != 104);
607#endif
608
593 /* Do sanity checks on page table constants */ 609 /* Do sanity checks on page table constants */
594 BUILD_BUG_ON(PTE_ENTRY_SIZE != sizeof(pte_t)); 610 BUILD_BUG_ON(PTE_ENTRY_SIZE != sizeof(pte_t));
595 BUILD_BUG_ON(PMD_ENTRY_SIZE != sizeof(pmd_t)); 611 BUILD_BUG_ON(PMD_ENTRY_SIZE != sizeof(pmd_t));