diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-11 11:50:01 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-11 11:50:01 -0400 |
commit | 37d9869ed928268409b48f52c57449918c0fd307 (patch) | |
tree | 7dd954260d723d1e0716b6432ba07b5c7be7f2ac /arch/s390/include/asm/syscall.h | |
parent | 098ef215b1e87cff51f983bae4e4e1358b932ec9 (diff) | |
parent | 89d49841e9e7a90b04b036b7dbe7521b55edbe24 (diff) |
Merge branch 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6
* 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6: (27 commits)
[S390] Fix checkstack for s390
[S390] fix initialization of stp
[S390] 3215: Remove tasklet.
[S390] console flush on panic / reboot
[S390] introduce dirty bit for kvm live migration
[S390] Add ioctl support for EMC Symmetrix Subsystem Control I/O
[S390] xpram: per device block request queues.
[S390] dasd: fix message flood for unsolicited interrupts
[S390] Move private simple udelay function to arch/s390/lib/delay.c.
[S390] dcssblk: add >2G DCSSs support and stacked contiguous DCSSs support.
[S390] ptrace changes
[S390] s390: use sys_pause for 31bit pause entry point
[S390] qdio enhanced SIGA (iqdio) support.
[S390] cio: fix cio_tpi.
[S390] cio: Correct use of ! and &
[S390] cio: inline assembly cleanup
[S390] bus_id -> dev_set_name() for css and ccw busses
[S390] bus_id ->dev_name() conversions in qdio
[S390] Use s390_root_dev_* in kvm_virtio.
[S390] more bus_id -> dev_name conversions
...
Diffstat (limited to 'arch/s390/include/asm/syscall.h')
-rw-r--r-- | arch/s390/include/asm/syscall.h | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/arch/s390/include/asm/syscall.h b/arch/s390/include/asm/syscall.h new file mode 100644 index 000000000000..6e623971fbb9 --- /dev/null +++ b/arch/s390/include/asm/syscall.h | |||
@@ -0,0 +1,80 @@ | |||
1 | /* | ||
2 | * Access to user system call parameters and results | ||
3 | * | ||
4 | * Copyright IBM Corp. 2008 | ||
5 | * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com) | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License (version 2 only) | ||
9 | * as published by the Free Software Foundation. | ||
10 | */ | ||
11 | |||
12 | #ifndef _ASM_SYSCALL_H | ||
13 | #define _ASM_SYSCALL_H 1 | ||
14 | |||
15 | #include <asm/ptrace.h> | ||
16 | |||
17 | static inline long syscall_get_nr(struct task_struct *task, | ||
18 | struct pt_regs *regs) | ||
19 | { | ||
20 | if (regs->trap != __LC_SVC_OLD_PSW) | ||
21 | return -1; | ||
22 | return regs->gprs[2]; | ||
23 | } | ||
24 | |||
25 | static inline void syscall_rollback(struct task_struct *task, | ||
26 | struct pt_regs *regs) | ||
27 | { | ||
28 | regs->gprs[2] = regs->orig_gpr2; | ||
29 | } | ||
30 | |||
31 | static inline long syscall_get_error(struct task_struct *task, | ||
32 | struct pt_regs *regs) | ||
33 | { | ||
34 | return (regs->gprs[2] >= -4096UL) ? -regs->gprs[2] : 0; | ||
35 | } | ||
36 | |||
37 | static inline long syscall_get_return_value(struct task_struct *task, | ||
38 | struct pt_regs *regs) | ||
39 | { | ||
40 | return regs->gprs[2]; | ||
41 | } | ||
42 | |||
43 | static inline void syscall_set_return_value(struct task_struct *task, | ||
44 | struct pt_regs *regs, | ||
45 | int error, long val) | ||
46 | { | ||
47 | regs->gprs[2] = error ? -error : val; | ||
48 | } | ||
49 | |||
50 | static inline void syscall_get_arguments(struct task_struct *task, | ||
51 | struct pt_regs *regs, | ||
52 | unsigned int i, unsigned int n, | ||
53 | unsigned long *args) | ||
54 | { | ||
55 | BUG_ON(i + n > 6); | ||
56 | #ifdef CONFIG_COMPAT | ||
57 | if (test_tsk_thread_flag(task, TIF_31BIT)) { | ||
58 | if (i + n == 6) | ||
59 | args[--n] = (u32) regs->args[0]; | ||
60 | while (n-- > 0) | ||
61 | args[n] = (u32) regs->gprs[2 + i + n]; | ||
62 | } | ||
63 | #endif | ||
64 | if (i + n == 6) | ||
65 | args[--n] = regs->args[0]; | ||
66 | memcpy(args, ®s->gprs[2 + i], n * sizeof(args[0])); | ||
67 | } | ||
68 | |||
69 | static inline void syscall_set_arguments(struct task_struct *task, | ||
70 | struct pt_regs *regs, | ||
71 | unsigned int i, unsigned int n, | ||
72 | const unsigned long *args) | ||
73 | { | ||
74 | BUG_ON(i + n > 6); | ||
75 | if (i + n == 6) | ||
76 | regs->args[0] = args[--n]; | ||
77 | memcpy(®s->gprs[2 + i], args, n * sizeof(args[0])); | ||
78 | } | ||
79 | |||
80 | #endif /* _ASM_SYSCALL_H */ | ||