summaryrefslogtreecommitdiffstats
path: root/arch/riscv/include/asm/syscall.h
diff options
context:
space:
mode:
authorDavid Abdurachmanov <david.abdurachmanov@gmail.com>2018-10-29 11:48:53 +0100
committerPalmer Dabbelt <palmer@sifive.com>2019-01-07 08:22:39 -0800
commitefe75c494f57890900caf6c8a0667db35bfaf56a (patch)
tree874556a5b33b4203aba387f88d1b0e231d35be38 /arch/riscv/include/asm/syscall.h
parent8fe28cb58bcb235034b64cbbb7550a8a43fd88be (diff)
downloadtalos-op-linux-efe75c494f57890900caf6c8a0667db35bfaf56a.tar.gz
talos-op-linux-efe75c494f57890900caf6c8a0667db35bfaf56a.zip
riscv: add audit support
On RISC-V (riscv) audit is supported through generic lib/audit.c. The patch adds required arch specific definitions. Signed-off-by: David Abdurachmanov <david.abdurachmanov@gmail.com> Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
Diffstat (limited to 'arch/riscv/include/asm/syscall.h')
-rw-r--r--arch/riscv/include/asm/syscall.h10
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(&regs->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 */
OpenPOWER on IntegriCloud