#ifndef _ASM_ALPHA_SYSCALL_H
#define _ASM_ALPHA_SYSCALL_H
#include <uapi/linux/audit.h>
#include <linux/audit.h>
#include <linux/sched.h>
#include <linux/types.h>
#include <asm/ptrace.h>
static inline int syscall_get_arch(struct task_struct *task)
{
return AUDIT_ARCH_ALPHA;
}
static inline long syscall_get_return_value(struct task_struct *task,
struct pt_regs *regs)
{
return regs->r19 ? -(long)regs->r0 : (long)regs->r0;
}
static inline long syscall_get_nr(struct task_struct *task,
struct pt_regs *regs)
{
return (long)regs->r1;
}
static inline void syscall_set_nr(struct task_struct *task,
struct pt_regs *regs,
long nr)
{
regs->r1 = (unsigned long)nr;
}
static inline void syscall_get_arguments(struct task_struct *task,
struct pt_regs *regs,
unsigned long *args)
{
args[0] = regs->r16;
args[1] = regs->r17;
args[2] = regs->r18;
args[3] = regs->r19;
args[4] = regs->r20;
args[5] = regs->r21;
}
static inline void syscall_set_arguments(struct task_struct *task,
struct pt_regs *regs,
const unsigned long *args)
{
regs->r16 = args[0];
regs->r17 = args[1];
regs->r18 = args[2];
regs->r19 = args[3];
regs->r20 = args[4];
regs->r21 = args[5];
}
static inline void syscall_set_return_value(struct task_struct *task,
struct pt_regs *regs,
int error, long val)
{
if (error) {
regs->r0 = (unsigned long)(-error);
regs->r19 = 1;
} else {
regs->r0 = (unsigned long)val;
regs->r19 = 0;
}
}
static inline void syscall_rollback(struct task_struct *task,
struct pt_regs *regs)
{
regs->r1 = regs->r2;
}
#endif