hc
2024-05-10 9999e48639b3cecb08ffb37358bcba3b48161b29
kernel/arch/riscv/include/asm/syscall.h
....@@ -1,16 +1,8 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * Copyright (C) 2008-2009 Red Hat, Inc. All rights reserved.
34 * Copyright 2010 Tilera Corporation. All Rights Reserved.
45 * Copyright 2015 Regents of the University of California, Berkeley
5
- *
6
- * This program is free software; you can redistribute it and/or
7
- * modify it under the terms of the GNU General Public License
8
- * as published by the Free Software Foundation, version 2.
9
- *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU General Public License for more details.
146 *
157 * See asm-generic/syscall.h for descriptions of what we must do here.
168 */
....@@ -18,6 +10,7 @@
1810 #ifndef _ASM_RISCV_SYSCALL_H
1911 #define _ASM_RISCV_SYSCALL_H
2012
13
+#include <uapi/linux/audit.h>
2114 #include <linux/sched.h>
2215 #include <linux/err.h>
2316
....@@ -33,13 +26,6 @@
3326 struct pt_regs *regs)
3427 {
3528 return regs->a7;
36
-}
37
-
38
-static inline void syscall_set_nr(struct task_struct *task,
39
- struct pt_regs *regs,
40
- int sysno)
41
-{
42
- regs->a7 = sysno;
4329 }
4430
4531 static inline void syscall_rollback(struct task_struct *task,
....@@ -71,34 +57,29 @@
7157
7258 static inline void syscall_get_arguments(struct task_struct *task,
7359 struct pt_regs *regs,
74
- unsigned int i, unsigned int n,
7560 unsigned long *args)
7661 {
77
- BUG_ON(i + n > 6);
78
- if (i == 0) {
79
- args[0] = regs->orig_a0;
80
- args++;
81
- n--;
82
- } else {
83
- i--;
84
- }
85
- memcpy(args, &regs->a1 + i, n * sizeof(args[0]));
62
+ args[0] = regs->orig_a0;
63
+ args++;
64
+ memcpy(args, &regs->a1, 5 * sizeof(args[0]));
8665 }
8766
8867 static inline void syscall_set_arguments(struct task_struct *task,
8968 struct pt_regs *regs,
90
- unsigned int i, unsigned int n,
9169 const unsigned long *args)
9270 {
93
- BUG_ON(i + n > 6);
94
- if (i == 0) {
95
- regs->orig_a0 = args[0];
96
- args++;
97
- n--;
98
- } else {
99
- i--;
100
- }
101
- memcpy(&regs->a1 + i, args, n * sizeof(regs->a1));
71
+ regs->orig_a0 = args[0];
72
+ args++;
73
+ memcpy(&regs->a1, args, 5 * sizeof(regs->a1));
74
+}
75
+
76
+static inline int syscall_get_arch(struct task_struct *task)
77
+{
78
+#ifdef CONFIG_64BIT
79
+ return AUDIT_ARCH_RISCV64;
80
+#else
81
+ return AUDIT_ARCH_RISCV32;
82
+#endif
10283 }
10384
10485 #endif /* _ASM_RISCV_SYSCALL_H */