diff options
| author | Ingo Molnar <mingo@kernel.org> | 2015-09-13 12:25:35 +0300 | 
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2015-09-13 12:25:35 +0300 | 
| commit | d2bb1d42b95fa88f092623bbb8ed533f316b6a3c (patch) | |
| tree | fb796db809a266906fa358f24f1c07ced4df33f0 /arch/tile/include/asm/syscall.h | |
| parent | 3bd7617596df560e2cb22ad97888cb42dae39d02 (diff) | |
| parent | 6ff33f3902c3b1c5d0db6b1e2c70b6d76fba357f (diff) | |
| download | linux-d2bb1d42b95fa88f092623bbb8ed533f316b6a3c.tar.xz | |
Merge tag 'v4.3-rc1' into perf/core, to refresh the tree
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/tile/include/asm/syscall.h')
| -rw-r--r-- | arch/tile/include/asm/syscall.h | 28 | 
1 files changed, 27 insertions, 1 deletions
diff --git a/arch/tile/include/asm/syscall.h b/arch/tile/include/asm/syscall.h index 9644b88f133d..373d73064ea1 100644 --- a/arch/tile/include/asm/syscall.h +++ b/arch/tile/include/asm/syscall.h @@ -20,6 +20,8 @@  #include <linux/sched.h>  #include <linux/err.h> +#include <linux/audit.h> +#include <linux/compat.h>  #include <arch/abi.h>  /* The array of function pointers for syscalls. */ @@ -61,7 +63,15 @@ static inline void syscall_set_return_value(struct task_struct *task,  					    struct pt_regs *regs,  					    int error, long val)  { -	regs->regs[0] = (long) error ?: val; +	if (error) { +		/* R0 is the passed-in negative error, R1 is positive. */ +		regs->regs[0] = error; +		regs->regs[1] = -error; +	} else { +		/* R1 set to zero to indicate no error. */ +		regs->regs[0] = val; +		regs->regs[1] = 0; +	}  }  static inline void syscall_get_arguments(struct task_struct *task, @@ -82,4 +92,20 @@ static inline void syscall_set_arguments(struct task_struct *task,  	memcpy(®s[i], args, n * sizeof(args[0]));  } +/* + * We don't care about endianness (__AUDIT_ARCH_LE bit) here because + * tile has the same system calls both on little- and big- endian. + */ +static inline int syscall_get_arch(void) +{ +	if (is_compat_task()) +		return AUDIT_ARCH_TILEGX32; + +#ifdef CONFIG_TILEGX +	return AUDIT_ARCH_TILEGX; +#else +	return AUDIT_ARCH_TILEPRO; +#endif +} +  #endif	/* _ASM_TILE_SYSCALL_H */  | 
