| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com) |
|---|
| 3 | | - * |
|---|
| 4 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 5 | | - * it under the terms of the GNU General Public License version 2 as |
|---|
| 6 | | - * published by the Free Software Foundation. |
|---|
| 7 | 4 | */ |
|---|
| 8 | 5 | |
|---|
| 9 | 6 | #ifndef _ASM_ARC_SYSCALL_H |
|---|
| 10 | 7 | #define _ASM_ARC_SYSCALL_H 1 |
|---|
| 11 | 8 | |
|---|
| 9 | +#include <uapi/linux/audit.h> |
|---|
| 12 | 10 | #include <linux/err.h> |
|---|
| 13 | 11 | #include <linux/sched.h> |
|---|
| 14 | 12 | #include <asm/unistd.h> |
|---|
| .. | .. |
|---|
| 55 | 53 | */ |
|---|
| 56 | 54 | static inline void |
|---|
| 57 | 55 | syscall_get_arguments(struct task_struct *task, struct pt_regs *regs, |
|---|
| 58 | | - unsigned int i, unsigned int n, unsigned long *args) |
|---|
| 56 | + unsigned long *args) |
|---|
| 59 | 57 | { |
|---|
| 60 | 58 | unsigned long *inside_ptregs = &(regs->r0); |
|---|
| 61 | | - inside_ptregs -= i; |
|---|
| 62 | | - |
|---|
| 63 | | - BUG_ON((i + n) > 6); |
|---|
| 59 | + unsigned int n = 6; |
|---|
| 60 | + unsigned int i = 0; |
|---|
| 64 | 61 | |
|---|
| 65 | 62 | while (n--) { |
|---|
| 66 | 63 | args[i++] = (*inside_ptregs); |
|---|
| .. | .. |
|---|
| 68 | 65 | } |
|---|
| 69 | 66 | } |
|---|
| 70 | 67 | |
|---|
| 68 | +static inline int |
|---|
| 69 | +syscall_get_arch(struct task_struct *task) |
|---|
| 70 | +{ |
|---|
| 71 | + return IS_ENABLED(CONFIG_ISA_ARCOMPACT) |
|---|
| 72 | + ? (IS_ENABLED(CONFIG_CPU_BIG_ENDIAN) |
|---|
| 73 | + ? AUDIT_ARCH_ARCOMPACTBE : AUDIT_ARCH_ARCOMPACT) |
|---|
| 74 | + : (IS_ENABLED(CONFIG_CPU_BIG_ENDIAN) |
|---|
| 75 | + ? AUDIT_ARCH_ARCV2BE : AUDIT_ARCH_ARCV2); |
|---|
| 76 | +} |
|---|
| 77 | + |
|---|
| 71 | 78 | #endif |
|---|