syscall_get_arch: add "struct task_struct *" argument
[linux-block.git] / arch / h8300 / include / asm / syscall.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
d2a5f499
YS
2#ifndef __ASM_H8300_SYSCALLS_32_H
3#define __ASM_H8300_SYSCALLS_32_H
4
5#ifdef __KERNEL__
6
7#include <linux/compiler.h>
8#include <linux/linkage.h>
9#include <linux/types.h>
10#include <linux/ptrace.h>
122a43b1 11#include <uapi/linux/audit.h>
d2a5f499
YS
12
13static inline int
14syscall_get_nr(struct task_struct *task, struct pt_regs *regs)
15{
16 return regs->orig_er0;
17}
18
19static inline void
20syscall_get_arguments(struct task_struct *task, struct pt_regs *regs,
21 unsigned int i, unsigned int n, unsigned long *args)
22{
23 BUG_ON(i + n > 6);
24
25 while (n > 0) {
26 switch (i) {
27 case 0:
28 *args++ = regs->er1;
29 break;
30 case 1:
31 *args++ = regs->er2;
32 break;
33 case 2:
34 *args++ = regs->er3;
35 break;
36 case 3:
37 *args++ = regs->er4;
38 break;
39 case 4:
40 *args++ = regs->er5;
41 break;
42 case 5:
43 *args++ = regs->er6;
44 break;
45 }
46 i++;
47 n--;
48 }
49}
50
122a43b1 51static inline int
16add411 52syscall_get_arch(struct task_struct *task)
122a43b1
DL
53{
54 return AUDIT_ARCH_H8300;
55}
d2a5f499
YS
56
57
58/* Misc syscall related bits */
59asmlinkage long do_syscall_trace_enter(struct pt_regs *regs);
60asmlinkage void do_syscall_trace_leave(struct pt_regs *regs);
61
62#endif /* __KERNEL__ */
63#endif /* __ASM_H8300_SYSCALLS_32_H */