aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/include/asm/syscall.h
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2014-03-31 12:17:33 -0400
committerRalf Baechle <ralf@linux-mips.org>2014-03-31 12:17:33 -0400
commitade63aada79c61bcd5f51cbd310f237399892268 (patch)
tree4f8605528bfd9b6261679883974b9ac4870223dd /arch/mips/include/asm/syscall.h
parent9a1724c7506bfa7d3d9dcab13f83e9e6446929f9 (diff)
parentc14af233fbe279d0e561ecf84f1208b1bae087ef (diff)
Merge branch '3.14-fixes' into mips-for-linux-next
Diffstat (limited to 'arch/mips/include/asm/syscall.h')
-rw-r--r--arch/mips/include/asm/syscall.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/arch/mips/include/asm/syscall.h b/arch/mips/include/asm/syscall.h
index 9031745cec1b..6c488c85d791 100644
--- a/arch/mips/include/asm/syscall.h
+++ b/arch/mips/include/asm/syscall.h
@@ -13,6 +13,7 @@
13#ifndef __ASM_MIPS_SYSCALL_H 13#ifndef __ASM_MIPS_SYSCALL_H
14#define __ASM_MIPS_SYSCALL_H 14#define __ASM_MIPS_SYSCALL_H
15 15
16#include <linux/compiler.h>
16#include <linux/audit.h> 17#include <linux/audit.h>
17#include <linux/elf-em.h> 18#include <linux/elf-em.h>
18#include <linux/kernel.h> 19#include <linux/kernel.h>
@@ -50,14 +51,14 @@ static inline unsigned long mips_get_syscall_arg(unsigned long *arg,
50 51
51#ifdef CONFIG_32BIT 52#ifdef CONFIG_32BIT
52 case 4: case 5: case 6: case 7: 53 case 4: case 5: case 6: case 7:
53 return get_user(*arg, (int *)usp + 4 * n); 54 return get_user(*arg, (int *)usp + n);
54#endif 55#endif
55 56
56#ifdef CONFIG_64BIT 57#ifdef CONFIG_64BIT
57 case 4: case 5: case 6: case 7: 58 case 4: case 5: case 6: case 7:
58#ifdef CONFIG_MIPS32_O32 59#ifdef CONFIG_MIPS32_O32
59 if (test_thread_flag(TIF_32BIT_REGS)) 60 if (test_thread_flag(TIF_32BIT_REGS))
60 return get_user(*arg, (int *)usp + 4 * n); 61 return get_user(*arg, (int *)usp + n);
61 else 62 else
62#endif 63#endif
63 *arg = regs->regs[4 + n]; 64 *arg = regs->regs[4 + n];
@@ -68,6 +69,8 @@ static inline unsigned long mips_get_syscall_arg(unsigned long *arg,
68 default: 69 default:
69 BUG(); 70 BUG();
70 } 71 }
72
73 unreachable();
71} 74}
72 75
73static inline long syscall_get_return_value(struct task_struct *task, 76static inline long syscall_get_return_value(struct task_struct *task,
@@ -100,7 +103,6 @@ static inline void syscall_get_arguments(struct task_struct *task,
100 unsigned int i, unsigned int n, 103 unsigned int i, unsigned int n,
101 unsigned long *args) 104 unsigned long *args)
102{ 105{
103 unsigned long arg;
104 int ret; 106 int ret;
105 /* O32 ABI syscall() - Either 64-bit with O32 or 32-bit */ 107 /* O32 ABI syscall() - Either 64-bit with O32 or 32-bit */
106 if ((config_enabled(CONFIG_32BIT) || 108 if ((config_enabled(CONFIG_32BIT) ||
@@ -111,7 +113,7 @@ static inline void syscall_get_arguments(struct task_struct *task,
111 } 113 }
112 114
113 while (n--) 115 while (n--)
114 ret |= mips_get_syscall_arg(&arg, task, regs, i++); 116 ret |= mips_get_syscall_arg(args++, task, regs, i++);
115 117
116 /* 118 /*
117 * No way to communicate an error because this is a void function. 119 * No way to communicate an error because this is a void function.