Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 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> |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame^] | 11 | #include <uapi/linux/audit.h> |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 12 | |
| 13 | static inline int |
| 14 | syscall_get_nr(struct task_struct *task, struct pt_regs *regs) |
| 15 | { |
| 16 | return regs->orig_er0; |
| 17 | } |
| 18 | |
| 19 | static inline void |
| 20 | syscall_get_arguments(struct task_struct *task, struct pt_regs *regs, |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame^] | 21 | unsigned long *args) |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 22 | { |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame^] | 23 | *args++ = regs->er1; |
| 24 | *args++ = regs->er2; |
| 25 | *args++ = regs->er3; |
| 26 | *args++ = regs->er4; |
| 27 | *args++ = regs->er5; |
| 28 | *args = regs->er6; |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 29 | } |
| 30 | |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame^] | 31 | static inline int |
| 32 | syscall_get_arch(struct task_struct *task) |
| 33 | { |
| 34 | return AUDIT_ARCH_H8300; |
| 35 | } |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 36 | |
| 37 | |
| 38 | /* Misc syscall related bits */ |
| 39 | asmlinkage long do_syscall_trace_enter(struct pt_regs *regs); |
| 40 | asmlinkage void do_syscall_trace_leave(struct pt_regs *regs); |
| 41 | |
| 42 | #endif /* __KERNEL__ */ |
| 43 | #endif /* __ASM_H8300_SYSCALLS_32_H */ |