| 1 | /* SPDX-License-Identifier: (GPL-2.0-only or LGPL-2.1-only) |
| 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 | |
| 18 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,1,0)) |
| 19 | |
| 20 | #define lttng_syscall_get_arguments(task, regs, args) \ |
| 21 | syscall_get_arguments(task, regs, args) |
| 22 | |
| 23 | #else /* LINUX_VERSION_CODE >= KERNEL_VERSION(5,1,0) */ |
| 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 | |
| 32 | #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(5,1,0) */ |
| 33 | |
| 34 | #endif /* _LTTNG_WRAPPER_SYSCALL_H */ |