hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/arch/arc/include/asm/syscall.h
....@@ -1,14 +1,12 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * 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.
74 */
85
96 #ifndef _ASM_ARC_SYSCALL_H
107 #define _ASM_ARC_SYSCALL_H 1
118
9
+#include <uapi/linux/audit.h>
1210 #include <linux/err.h>
1311 #include <linux/sched.h>
1412 #include <asm/unistd.h>
....@@ -55,12 +53,11 @@
5553 */
5654 static inline void
5755 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)
5957 {
6058 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;
6461
6562 while (n--) {
6663 args[i++] = (*inside_ptregs);
....@@ -68,4 +65,14 @@
6865 }
6966 }
7067
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
+
7178 #endif