Commit | Line | Data |
---|---|---|
1b7b9c65 MJ |
1 | /* SPDX-License-Identifier: (GPL-2.0 or LGPL-2.1) |
2 | * | |
3 | * wrapper/syscall.h | |
4 | * | |
5 | * wrapper around asm/syscall.h. | |
6 | * | |
7 | * Copyright (C) 2019 Michael Jeanson <mjeanson@efficios.com> | |
8 | */ | |
9 | ||
10 | #ifndef _LTTNG_WRAPPER_SYSCALL_H | |
11 | #define _LTTNG_WRAPPER_SYSCALL_H | |
12 | ||
13 | #include <asm/syscall.h> | |
14 | #include <lttng-kernel-version.h> | |
15 | ||
16 | #define LTTNG_SYSCALL_NR_ARGS 6 | |
17 | ||
2d042821 | 18 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,1,0)) |
1b7b9c65 MJ |
19 | |
20 | #define lttng_syscall_get_arguments(task, regs, args) \ | |
21 | syscall_get_arguments(task, regs, args) | |
22 | ||
2d042821 | 23 | #else /* LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,1,0) */ |
1b7b9c65 MJ |
24 | |
25 | static inline | |
26 | void lttng_syscall_get_arguments(struct task_struct *task, | |
27 | struct pt_regs *regs, unsigned long *args) | |
28 | { | |
29 | syscall_get_arguments(task, regs, 0, LTTNG_SYSCALL_NR_ARGS, args); | |
30 | } | |
31 | ||
2d042821 | 32 | #endif /* LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,1,0) */ |
1b7b9c65 MJ |
33 | |
34 | #endif /* _LTTNG_WRAPPER_SYSCALL_H */ |