diff options
author | Palmer Dabbelt <palmer@sifive.com> | 2019-01-07 19:45:47 +0300 |
---|---|---|
committer | Palmer Dabbelt <palmer@sifive.com> | 2019-01-07 19:45:47 +0300 |
commit | 801009424e05cf110f016d7fac7fcf20ef94941a (patch) | |
tree | b46e0f4c1fa20bbd00dc838c19d3b824cc673b23 /arch/riscv/include/asm/syscall.h | |
parent | 2cffc9569050a8dbc0c4a6ee7186c0919487c3ec (diff) | |
parent | 5aeb1b36cedd3a1dfdbfe368629fed52dee34103 (diff) | |
download | linux-801009424e05cf110f016d7fac7fcf20ef94941a.tar.xz |
Fix a handful of audit-related issue
This is sort of a mix between a new feature and a bug fix. I've managed
to screw up merging this patch set a handful of times but I think it's
OK this time around. The main new feature here is audit support for
RISC-V, with some fixes to audit-related bugs that cropped up along the
way:
* The addition of NR_syscalls into unistd.h, which is necessary for
CONFIG_FTRACE_SYSCALLS.
* The definition of CREATE_TRACE_POINTS so
__tracepoint_sys_{enter,exit} get defined.
* A fix for trace_sys_exit() so we can enable
CONFIG_HAVE_SYSCALL_TRACEPOINTS.
Diffstat (limited to 'arch/riscv/include/asm/syscall.h')
-rw-r--r-- | arch/riscv/include/asm/syscall.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/riscv/include/asm/syscall.h b/arch/riscv/include/asm/syscall.h index 8d25f8904c00..bba3da6ef157 100644 --- a/arch/riscv/include/asm/syscall.h +++ b/arch/riscv/include/asm/syscall.h @@ -18,6 +18,7 @@ #ifndef _ASM_RISCV_SYSCALL_H #define _ASM_RISCV_SYSCALL_H +#include <uapi/linux/audit.h> #include <linux/sched.h> #include <linux/err.h> @@ -99,4 +100,13 @@ static inline void syscall_set_arguments(struct task_struct *task, memcpy(®s->a1 + i * sizeof(regs->a1), args, n * sizeof(regs->a0)); } +static inline int syscall_get_arch(void) +{ +#ifdef CONFIG_64BIT + return AUDIT_ARCH_RISCV64; +#else + return AUDIT_ARCH_RISCV32; +#endif +} + #endif /* _ASM_RISCV_SYSCALL_H */ |