aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-s390
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-s390')
-rw-r--r--include/asm-s390/auxvec.h4
-rw-r--r--include/asm-s390/compat.h20
-rw-r--r--include/asm-s390/debug.h2
-rw-r--r--include/asm-s390/fcntl.h98
-rw-r--r--include/asm-s390/futex.h53
-rw-r--r--include/asm-s390/lowcore.h8
-rw-r--r--include/asm-s390/page.h16
-rw-r--r--include/asm-s390/spinlock.h4
-rw-r--r--include/asm-s390/types.h2
-rw-r--r--include/asm-s390/uaccess.h7
10 files changed, 78 insertions, 136 deletions
diff --git a/include/asm-s390/auxvec.h b/include/asm-s390/auxvec.h
new file mode 100644
index 000000000000..0d340720fd99
--- /dev/null
+++ b/include/asm-s390/auxvec.h
@@ -0,0 +1,4 @@
1#ifndef __ASMS390_AUXVEC_H
2#define __ASMS390_AUXVEC_H
3
4#endif
diff --git a/include/asm-s390/compat.h b/include/asm-s390/compat.h
index 7f8f544eb262..a007715f4aea 100644
--- a/include/asm-s390/compat.h
+++ b/include/asm-s390/compat.h
@@ -13,10 +13,10 @@ typedef s32 compat_ssize_t;
13typedef s32 compat_time_t; 13typedef s32 compat_time_t;
14typedef s32 compat_clock_t; 14typedef s32 compat_clock_t;
15typedef s32 compat_pid_t; 15typedef s32 compat_pid_t;
16typedef u16 compat_uid_t; 16typedef u16 __compat_uid_t;
17typedef u16 compat_gid_t; 17typedef u16 __compat_gid_t;
18typedef u32 compat_uid32_t; 18typedef u32 __compat_uid32_t;
19typedef u32 compat_gid32_t; 19typedef u32 __compat_gid32_t;
20typedef u16 compat_mode_t; 20typedef u16 compat_mode_t;
21typedef u32 compat_ino_t; 21typedef u32 compat_ino_t;
22typedef u16 compat_dev_t; 22typedef u16 compat_dev_t;
@@ -51,8 +51,8 @@ struct compat_stat {
51 compat_ino_t st_ino; 51 compat_ino_t st_ino;
52 compat_mode_t st_mode; 52 compat_mode_t st_mode;
53 compat_nlink_t st_nlink; 53 compat_nlink_t st_nlink;
54 compat_uid_t st_uid; 54 __compat_uid_t st_uid;
55 compat_gid_t st_gid; 55 __compat_gid_t st_gid;
56 compat_dev_t st_rdev; 56 compat_dev_t st_rdev;
57 u16 __pad2; 57 u16 __pad2;
58 u32 st_size; 58 u32 st_size;
@@ -140,10 +140,10 @@ static inline void __user *compat_alloc_user_space(long len)
140 140
141struct compat_ipc64_perm { 141struct compat_ipc64_perm {
142 compat_key_t key; 142 compat_key_t key;
143 compat_uid32_t uid; 143 __compat_uid32_t uid;
144 compat_gid32_t gid; 144 __compat_gid32_t gid;
145 compat_uid32_t cuid; 145 __compat_uid32_t cuid;
146 compat_gid32_t cgid; 146 __compat_gid32_t cgid;
147 compat_mode_t mode; 147 compat_mode_t mode;
148 unsigned short __pad1; 148 unsigned short __pad1;
149 unsigned short seq; 149 unsigned short seq;
diff --git a/include/asm-s390/debug.h b/include/asm-s390/debug.h
index 92360d90144b..7127030ae162 100644
--- a/include/asm-s390/debug.h
+++ b/include/asm-s390/debug.h
@@ -52,8 +52,6 @@ struct __debug_entry{
52#define DEBUG_DATA(entry) (char*)(entry + 1) /* data is stored behind */ 52#define DEBUG_DATA(entry) (char*)(entry + 1) /* data is stored behind */
53 /* the entry information */ 53 /* the entry information */
54 54
55#define STCK(x) asm volatile ("STCK 0(%1)" : "=m" (x) : "a" (&(x)) : "cc")
56
57typedef struct __debug_entry debug_entry_t; 55typedef struct __debug_entry debug_entry_t;
58 56
59struct debug_view; 57struct debug_view;
diff --git a/include/asm-s390/fcntl.h b/include/asm-s390/fcntl.h
index 48f692b45732..46ab12db5739 100644
--- a/include/asm-s390/fcntl.h
+++ b/include/asm-s390/fcntl.h
@@ -1,97 +1 @@
1/* #include <asm-generic/fcntl.h>
2 * include/asm-s390/fcntl.h
3 *
4 * S390 version
5 *
6 * Derived from "include/asm-i386/fcntl.h"
7 */
8#ifndef _S390_FCNTL_H
9#define _S390_FCNTL_H
10
11/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
12 located on an ext2 file system */
13#define O_ACCMODE 0003
14#define O_RDONLY 00
15#define O_WRONLY 01
16#define O_RDWR 02
17#define O_CREAT 0100 /* not fcntl */
18#define O_EXCL 0200 /* not fcntl */
19#define O_NOCTTY 0400 /* not fcntl */
20#define O_TRUNC 01000 /* not fcntl */
21#define O_APPEND 02000
22#define O_NONBLOCK 04000
23#define O_NDELAY O_NONBLOCK
24#define O_SYNC 010000
25#define FASYNC 020000 /* fcntl, for BSD compatibility */
26#define O_DIRECT 040000 /* direct disk access hint */
27#define O_LARGEFILE 0100000
28#define O_DIRECTORY 0200000 /* must be a directory */
29#define O_NOFOLLOW 0400000 /* don't follow links */
30#define O_NOATIME 01000000
31
32#define F_DUPFD 0 /* dup */
33#define F_GETFD 1 /* get close_on_exec */
34#define F_SETFD 2 /* set/clear close_on_exec */
35#define F_GETFL 3 /* get file->f_flags */
36#define F_SETFL 4 /* set file->f_flags */
37#define F_GETLK 5
38#define F_SETLK 6
39#define F_SETLKW 7
40
41#define F_SETOWN 8 /* for sockets. */
42#define F_GETOWN 9 /* for sockets. */
43#define F_SETSIG 10 /* for sockets. */
44#define F_GETSIG 11 /* for sockets. */
45
46#ifndef __s390x__
47#define F_GETLK64 12 /* using 'struct flock64' */
48#define F_SETLK64 13
49#define F_SETLKW64 14
50#endif /* ! __s390x__ */
51
52/* for F_[GET|SET]FL */
53#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
54
55/* for posix fcntl() and lockf() */
56#define F_RDLCK 0
57#define F_WRLCK 1
58#define F_UNLCK 2
59
60/* for old implementation of bsd flock () */
61#define F_EXLCK 4 /* or 3 */
62#define F_SHLCK 8 /* or 4 */
63
64/* for leases */
65#define F_INPROGRESS 16
66
67/* operations for bsd flock(), also used by the kernel implementation */
68#define LOCK_SH 1 /* shared lock */
69#define LOCK_EX 2 /* exclusive lock */
70#define LOCK_NB 4 /* or'd with one of the above to prevent
71 blocking */
72#define LOCK_UN 8 /* remove lock */
73
74#define LOCK_MAND 32 /* This is a mandatory flock */
75#define LOCK_READ 64 /* ... Which allows concurrent read operations */
76#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */
77#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */
78
79struct flock {
80 short l_type;
81 short l_whence;
82 off_t l_start;
83 off_t l_len;
84 pid_t l_pid;
85};
86
87#ifndef __s390x__
88struct flock64 {
89 short l_type;
90 short l_whence;
91 loff_t l_start;
92 loff_t l_len;
93 pid_t l_pid;
94};
95#endif
96#define F_LINUX_SPECIFIC_BASE 1024
97#endif
diff --git a/include/asm-s390/futex.h b/include/asm-s390/futex.h
new file mode 100644
index 000000000000..2cac5ecd9d00
--- /dev/null
+++ b/include/asm-s390/futex.h
@@ -0,0 +1,53 @@
1#ifndef _ASM_FUTEX_H
2#define _ASM_FUTEX_H
3
4#ifdef __KERNEL__
5
6#include <linux/futex.h>
7#include <asm/errno.h>
8#include <asm/uaccess.h>
9
10static inline int
11futex_atomic_op_inuser (int encoded_op, int __user *uaddr)
12{
13 int op = (encoded_op >> 28) & 7;
14 int cmp = (encoded_op >> 24) & 15;
15 int oparg = (encoded_op << 8) >> 20;
16 int cmparg = (encoded_op << 20) >> 20;
17 int oldval = 0, ret, tem;
18 if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28))
19 oparg = 1 << oparg;
20
21 if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int)))
22 return -EFAULT;
23
24 inc_preempt_count();
25
26 switch (op) {
27 case FUTEX_OP_SET:
28 case FUTEX_OP_ADD:
29 case FUTEX_OP_OR:
30 case FUTEX_OP_ANDN:
31 case FUTEX_OP_XOR:
32 default:
33 ret = -ENOSYS;
34 }
35
36 dec_preempt_count();
37
38 if (!ret) {
39 switch (cmp) {
40 case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break;
41 case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break;
42 case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break;
43 case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break;
44 case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break;
45 case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break;
46 default: ret = -ENOSYS;
47 }
48 }
49 return ret;
50}
51
52#endif
53#endif
diff --git a/include/asm-s390/lowcore.h b/include/asm-s390/lowcore.h
index afe6a9f9b0ae..c6f51c9ce3ff 100644
--- a/include/asm-s390/lowcore.h
+++ b/include/asm-s390/lowcore.h
@@ -68,6 +68,7 @@
68#define __LC_SYSTEM_TIMER 0x270 68#define __LC_SYSTEM_TIMER 0x270
69#define __LC_LAST_UPDATE_CLOCK 0x278 69#define __LC_LAST_UPDATE_CLOCK 0x278
70#define __LC_STEAL_CLOCK 0x280 70#define __LC_STEAL_CLOCK 0x280
71#define __LC_RETURN_MCCK_PSW 0x288
71#define __LC_KERNEL_STACK 0xC40 72#define __LC_KERNEL_STACK 0xC40
72#define __LC_THREAD_INFO 0xC44 73#define __LC_THREAD_INFO 0xC44
73#define __LC_ASYNC_STACK 0xC48 74#define __LC_ASYNC_STACK 0xC48
@@ -90,6 +91,7 @@
90#define __LC_SYSTEM_TIMER 0x278 91#define __LC_SYSTEM_TIMER 0x278
91#define __LC_LAST_UPDATE_CLOCK 0x280 92#define __LC_LAST_UPDATE_CLOCK 0x280
92#define __LC_STEAL_CLOCK 0x288 93#define __LC_STEAL_CLOCK 0x288
94#define __LC_RETURN_MCCK_PSW 0x290
93#define __LC_KERNEL_STACK 0xD40 95#define __LC_KERNEL_STACK 0xD40
94#define __LC_THREAD_INFO 0xD48 96#define __LC_THREAD_INFO 0xD48
95#define __LC_ASYNC_STACK 0xD50 97#define __LC_ASYNC_STACK 0xD50
@@ -196,7 +198,8 @@ struct _lowcore
196 __u64 system_timer; /* 0x270 */ 198 __u64 system_timer; /* 0x270 */
197 __u64 last_update_clock; /* 0x278 */ 199 __u64 last_update_clock; /* 0x278 */
198 __u64 steal_clock; /* 0x280 */ 200 __u64 steal_clock; /* 0x280 */
199 __u8 pad8[0xc00-0x288]; /* 0x288 */ 201 psw_t return_mcck_psw; /* 0x288 */
202 __u8 pad8[0xc00-0x290]; /* 0x290 */
200 203
201 /* System info area */ 204 /* System info area */
202 __u32 save_area[16]; /* 0xc00 */ 205 __u32 save_area[16]; /* 0xc00 */
@@ -285,7 +288,8 @@ struct _lowcore
285 __u64 system_timer; /* 0x278 */ 288 __u64 system_timer; /* 0x278 */
286 __u64 last_update_clock; /* 0x280 */ 289 __u64 last_update_clock; /* 0x280 */
287 __u64 steal_clock; /* 0x288 */ 290 __u64 steal_clock; /* 0x288 */
288 __u8 pad8[0xc00-0x290]; /* 0x290 */ 291 psw_t return_mcck_psw; /* 0x290 */
292 __u8 pad8[0xc00-0x2a0]; /* 0x2a0 */
289 /* System info area */ 293 /* System info area */
290 __u64 save_area[16]; /* 0xc00 */ 294 __u64 save_area[16]; /* 0xc00 */
291 __u8 pad9[0xd40-0xc80]; /* 0xc80 */ 295 __u8 pad9[0xd40-0xc80]; /* 0xc80 */
diff --git a/include/asm-s390/page.h b/include/asm-s390/page.h
index 2be287b9df88..2430c561e021 100644
--- a/include/asm-s390/page.h
+++ b/include/asm-s390/page.h
@@ -111,20 +111,6 @@ static inline void copy_page(void *to, void *from)
111#define alloc_zeroed_user_highpage(vma, vaddr) alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO, vma, vaddr) 111#define alloc_zeroed_user_highpage(vma, vaddr) alloc_page_vma(GFP_HIGHUSER | __GFP_ZERO, vma, vaddr)
112#define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE 112#define __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE
113 113
114/* Pure 2^n version of get_order */
115extern __inline__ int get_order(unsigned long size)
116{
117 int order;
118
119 size = (size-1) >> (PAGE_SHIFT-1);
120 order = -1;
121 do {
122 size >>= 1;
123 order++;
124 } while (size);
125 return order;
126}
127
128/* 114/*
129 * These are used to make use of C type-checking.. 115 * These are used to make use of C type-checking..
130 */ 116 */
@@ -207,4 +193,6 @@ page_get_storage_key(unsigned long addr)
207 193
208#endif /* __KERNEL__ */ 194#endif /* __KERNEL__ */
209 195
196#include <asm-generic/page.h>
197
210#endif /* _S390_PAGE_H */ 198#endif /* _S390_PAGE_H */
diff --git a/include/asm-s390/spinlock.h b/include/asm-s390/spinlock.h
index 8ff10300f7ee..321b23bba1ec 100644
--- a/include/asm-s390/spinlock.h
+++ b/include/asm-s390/spinlock.h
@@ -47,7 +47,7 @@ extern int _raw_spin_trylock_retry(spinlock_t *lp, unsigned int pc);
47 47
48static inline void _raw_spin_lock(spinlock_t *lp) 48static inline void _raw_spin_lock(spinlock_t *lp)
49{ 49{
50 unsigned long pc = (unsigned long) __builtin_return_address(0); 50 unsigned long pc = 1 | (unsigned long) __builtin_return_address(0);
51 51
52 if (unlikely(_raw_compare_and_swap(&lp->lock, 0, pc) != 0)) 52 if (unlikely(_raw_compare_and_swap(&lp->lock, 0, pc) != 0))
53 _raw_spin_lock_wait(lp, pc); 53 _raw_spin_lock_wait(lp, pc);
@@ -55,7 +55,7 @@ static inline void _raw_spin_lock(spinlock_t *lp)
55 55
56static inline int _raw_spin_trylock(spinlock_t *lp) 56static inline int _raw_spin_trylock(spinlock_t *lp)
57{ 57{
58 unsigned long pc = (unsigned long) __builtin_return_address(0); 58 unsigned long pc = 1 | (unsigned long) __builtin_return_address(0);
59 59
60 if (likely(_raw_compare_and_swap(&lp->lock, 0, pc) == 0)) 60 if (likely(_raw_compare_and_swap(&lp->lock, 0, pc) == 0))
61 return 1; 61 return 1;
diff --git a/include/asm-s390/types.h b/include/asm-s390/types.h
index 3fefd61416a5..d0be3e477013 100644
--- a/include/asm-s390/types.h
+++ b/include/asm-s390/types.h
@@ -79,8 +79,6 @@ typedef unsigned long u64;
79 79
80typedef u32 dma_addr_t; 80typedef u32 dma_addr_t;
81 81
82typedef unsigned int kmem_bufctl_t;
83
84#ifndef __s390x__ 82#ifndef __s390x__
85typedef union { 83typedef union {
86 unsigned long long pair; 84 unsigned long long pair;
diff --git a/include/asm-s390/uaccess.h b/include/asm-s390/uaccess.h
index 3e3bfe6a8fa8..38a5cf8ab9e3 100644
--- a/include/asm-s390/uaccess.h
+++ b/include/asm-s390/uaccess.h
@@ -65,13 +65,6 @@
65 65
66#define access_ok(type,addr,size) __access_ok(addr,size) 66#define access_ok(type,addr,size) __access_ok(addr,size)
67 67
68/* this function will go away soon - use access_ok() instead */
69extern inline int __deprecated verify_area(int type, const void __user *addr,
70 unsigned long size)
71{
72 return access_ok(type, addr, size) ? 0 : -EFAULT;
73}
74
75/* 68/*
76 * The exception table consists of pairs of addresses: the first is the 69 * The exception table consists of pairs of addresses: the first is the
77 * address of an instruction that is allowed to fault, and the second is 70 * address of an instruction that is allowed to fault, and the second is