hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/arch/s390/include/asm/syscall.h
....@@ -14,13 +14,8 @@
1414 #include <linux/err.h>
1515 #include <asm/ptrace.h>
1616
17
-/*
18
- * The syscall table always contains 32 bit pointers since we know that the
19
- * address of the function to be called is (way) below 4GB. So the "int"
20
- * type here is what we want [need] for both 32 bit and 64 bit systems.
21
- */
22
-extern const unsigned int sys_call_table[];
23
-extern const unsigned int sys_call_table_emu[];
17
+extern const unsigned long sys_call_table[];
18
+extern const unsigned long sys_call_table_emu[];
2419
2520 static inline long syscall_get_nr(struct task_struct *task,
2621 struct pt_regs *regs)
....@@ -66,46 +61,38 @@
6661
6762 static inline void syscall_get_arguments(struct task_struct *task,
6863 struct pt_regs *regs,
69
- unsigned int i, unsigned int n,
7064 unsigned long *args)
7165 {
7266 unsigned long mask = -1UL;
67
+ unsigned int n = 6;
7368
74
- /*
75
- * No arguments for this syscall, there's nothing to do.
76
- */
77
- if (!n)
78
- return;
79
-
80
- BUG_ON(i + n > 6);
8169 #ifdef CONFIG_COMPAT
8270 if (test_tsk_thread_flag(task, TIF_31BIT))
8371 mask = 0xffffffff;
8472 #endif
8573 while (n-- > 0)
86
- if (i + n > 0)
87
- args[n] = regs->gprs[2 + i + n] & mask;
88
- if (i == 0)
89
- args[0] = regs->orig_gpr2 & mask;
74
+ if (n > 0)
75
+ args[n] = regs->gprs[2 + n] & mask;
76
+
77
+ args[0] = regs->orig_gpr2 & mask;
9078 }
9179
9280 static inline void syscall_set_arguments(struct task_struct *task,
9381 struct pt_regs *regs,
94
- unsigned int i, unsigned int n,
9582 const unsigned long *args)
9683 {
97
- BUG_ON(i + n > 6);
84
+ unsigned int n = 6;
85
+
9886 while (n-- > 0)
99
- if (i + n > 0)
100
- regs->gprs[2 + i + n] = args[n];
101
- if (i == 0)
102
- regs->orig_gpr2 = args[0];
87
+ if (n > 0)
88
+ regs->gprs[2 + n] = args[n];
89
+ regs->orig_gpr2 = args[0];
10390 }
10491
105
-static inline int syscall_get_arch(void)
92
+static inline int syscall_get_arch(struct task_struct *task)
10693 {
10794 #ifdef CONFIG_COMPAT
108
- if (test_tsk_thread_flag(current, TIF_31BIT))
95
+ if (test_tsk_thread_flag(task, TIF_31BIT))
10996 return AUDIT_ARCH_S390;
11097 #endif
11198 return AUDIT_ARCH_S390X;