diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-02 16:40:50 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-02 16:40:50 -0400 |
commit | bdfc7cbdeef8cadba0e5793079ac0130b8e2220c (patch) | |
tree | 82af0cae4898e259edcc6cbdad639087dc1189a8 /arch/mips/include/asm/syscall.h | |
parent | 62d1a3ba5adc5653d43f6cd3a90758bb6ad5d5bd (diff) | |
parent | ade63aada79c61bcd5f51cbd310f237399892268 (diff) |
Merge branch 'mips-for-linux-next' of git://git.linux-mips.org/pub/scm/ralf/upstream-sfr
Pull MIPS updates from Ralf Baechle:
- Support for Imgtec's Aptiv family of MIPS cores.
- Improved detection of BCM47xx configurations.
- Fix hiberation for certain configurations.
- Add support for the Chinese Loongson 3 CPU, a MIPS64 R2 core and
systems.
- Detection and support for the MIPS P5600 core.
- A few more random fixes that didn't make 3.14.
- Support for the EVA Extended Virtual Addressing
- Switch Alchemy to the platform PATA driver
- Complete unification of Alchemy support
- Allow availability of I/O cache coherency to be runtime detected
- Improvments to multiprocessing support for Imgtec platforms
- A few microoptimizations
- Cleanups of FPU support
- Paul Gortmaker's fixes for the init stuff
- Support for seccomp
* 'mips-for-linux-next' of git://git.linux-mips.org/pub/scm/ralf/upstream-sfr: (165 commits)
MIPS: CPC: Use __raw_ memory access functions
MIPS: CM: use __raw_ memory access functions
MIPS: Fix warning when including smp-ops.h with CONFIG_SMP=n
MIPS: Malta: GIC IPIs may be used without MT
MIPS: smp-mt: Use common GIC IPI implementation
MIPS: smp-cmp: Remove incorrect core number probe
MIPS: Fix gigaton of warning building with microMIPS.
MIPS: Fix core number detection for MT cores
MIPS: MT: core_nvpes function to retrieve VPE count
MIPS: Provide empty mips_mt_set_cpuoptions when CONFIG_MIPS_MT=n
MIPS: Lasat: Replace del_timer by del_timer_sync
MIPS: Malta: Setup PM I/O region on boot
MIPS: Loongson: Add a Loongson-3 default config file
MIPS: Loongson 3: Add CPU hotplug support
MIPS: Loongson 3: Add Loongson-3 SMP support
MIPS: Loongson: Add Loongson-3 Kconfig options
MIPS: Loongson: Add swiotlb to support All-Memory DMA
MIPS: Loongson 3: Add serial port support
MIPS: Loongson 3: Add IRQ init and dispatch support
MIPS: Loongson 3: Add HT-linked PCI support
...
Diffstat (limited to 'arch/mips/include/asm/syscall.h')
-rw-r--r-- | arch/mips/include/asm/syscall.h | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/arch/mips/include/asm/syscall.h b/arch/mips/include/asm/syscall.h index f35b131977e6..6c488c85d791 100644 --- a/arch/mips/include/asm/syscall.h +++ b/arch/mips/include/asm/syscall.h | |||
@@ -20,11 +20,22 @@ | |||
20 | #include <linux/sched.h> | 20 | #include <linux/sched.h> |
21 | #include <linux/uaccess.h> | 21 | #include <linux/uaccess.h> |
22 | #include <asm/ptrace.h> | 22 | #include <asm/ptrace.h> |
23 | #include <asm/unistd.h> | ||
24 | |||
25 | #ifndef __NR_syscall /* Only defined if _MIPS_SIM == _MIPS_SIM_ABI32 */ | ||
26 | #define __NR_syscall 4000 | ||
27 | #endif | ||
23 | 28 | ||
24 | static inline long syscall_get_nr(struct task_struct *task, | 29 | static inline long syscall_get_nr(struct task_struct *task, |
25 | struct pt_regs *regs) | 30 | struct pt_regs *regs) |
26 | { | 31 | { |
27 | return regs->regs[2]; | 32 | /* O32 ABI syscall() - Either 64-bit with O32 or 32-bit */ |
33 | if ((config_enabled(CONFIG_32BIT) || | ||
34 | test_tsk_thread_flag(task, TIF_32BIT_REGS)) && | ||
35 | (regs->regs[2] == __NR_syscall)) | ||
36 | return regs->regs[4]; | ||
37 | else | ||
38 | return regs->regs[2]; | ||
28 | } | 39 | } |
29 | 40 | ||
30 | static inline unsigned long mips_get_syscall_arg(unsigned long *arg, | 41 | static inline unsigned long mips_get_syscall_arg(unsigned long *arg, |
@@ -68,6 +79,12 @@ static inline long syscall_get_return_value(struct task_struct *task, | |||
68 | return regs->regs[2]; | 79 | return regs->regs[2]; |
69 | } | 80 | } |
70 | 81 | ||
82 | static inline void syscall_rollback(struct task_struct *task, | ||
83 | struct pt_regs *regs) | ||
84 | { | ||
85 | /* Do nothing */ | ||
86 | } | ||
87 | |||
71 | static inline void syscall_set_return_value(struct task_struct *task, | 88 | static inline void syscall_set_return_value(struct task_struct *task, |
72 | struct pt_regs *regs, | 89 | struct pt_regs *regs, |
73 | int error, long val) | 90 | int error, long val) |
@@ -87,6 +104,13 @@ static inline void syscall_get_arguments(struct task_struct *task, | |||
87 | unsigned long *args) | 104 | unsigned long *args) |
88 | { | 105 | { |
89 | int ret; | 106 | int ret; |
107 | /* O32 ABI syscall() - Either 64-bit with O32 or 32-bit */ | ||
108 | if ((config_enabled(CONFIG_32BIT) || | ||
109 | test_tsk_thread_flag(task, TIF_32BIT_REGS)) && | ||
110 | (regs->regs[2] == __NR_syscall)) { | ||
111 | i++; | ||
112 | n++; | ||
113 | } | ||
90 | 114 | ||
91 | while (n--) | 115 | while (n--) |
92 | ret |= mips_get_syscall_arg(args++, task, regs, i++); | 116 | ret |= mips_get_syscall_arg(args++, task, regs, i++); |
@@ -103,11 +127,13 @@ extern const unsigned long sys_call_table[]; | |||
103 | extern const unsigned long sys32_call_table[]; | 127 | extern const unsigned long sys32_call_table[]; |
104 | extern const unsigned long sysn32_call_table[]; | 128 | extern const unsigned long sysn32_call_table[]; |
105 | 129 | ||
106 | static inline int __syscall_get_arch(void) | 130 | static inline int syscall_get_arch(struct task_struct *task, |
131 | struct pt_regs *regs) | ||
107 | { | 132 | { |
108 | int arch = EM_MIPS; | 133 | int arch = EM_MIPS; |
109 | #ifdef CONFIG_64BIT | 134 | #ifdef CONFIG_64BIT |
110 | arch |= __AUDIT_ARCH_64BIT; | 135 | if (!test_tsk_thread_flag(task, TIF_32BIT_REGS)) |
136 | arch |= __AUDIT_ARCH_64BIT; | ||
111 | #endif | 137 | #endif |
112 | #if defined(__LITTLE_ENDIAN) | 138 | #if defined(__LITTLE_ENDIAN) |
113 | arch |= __AUDIT_ARCH_LE; | 139 | arch |= __AUDIT_ARCH_LE; |