2 * Copyright (C) 2011 Texas Instruments Incorporated
3 * Author: Mark Salter <msalter@redhat.com>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
11 #ifndef __ASM_C6X_SYSCALL_H
12 #define __ASM_C6X_SYSCALL_H
14 #include <uapi/linux/audit.h>
15 #include <linux/err.h>
16 #include <linux/sched.h>
18 static inline int syscall_get_nr(struct task_struct *task,
24 static inline void syscall_rollback(struct task_struct *task,
30 static inline long syscall_get_error(struct task_struct *task,
33 return IS_ERR_VALUE(regs->a4) ? regs->a4 : 0;
36 static inline long syscall_get_return_value(struct task_struct *task,
42 static inline void syscall_set_return_value(struct task_struct *task,
46 regs->a4 = error ?: val;
49 static inline void syscall_get_arguments(struct task_struct *task,
50 struct pt_regs *regs, unsigned int i,
51 unsigned int n, unsigned long *args)
86 static inline void syscall_set_arguments(struct task_struct *task,
88 unsigned int i, unsigned int n,
89 const unsigned long *args)
124 static inline int syscall_get_arch(struct task_struct *task)
126 return IS_ENABLED(CONFIG_CPU_BIG_ENDIAN)
127 ? AUDIT_ARCH_C6XBE : AUDIT_ARCH_C6X;
130 #endif /* __ASM_C6X_SYSCALLS_H */