1 /* Access to user system call parameters and results
3 * See asm-generic/syscall.h for function descriptions.
5 * Copyright (C) 2010 Red Hat, Inc. All Rights Reserved.
6 * Written by David Howells (dhowells@redhat.com)
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public Licence
10 * as published by the Free Software Foundation; either version
11 * 2 of the Licence, or (at your option) any later version.
14 #ifndef _ASM_SYSCALL_H
15 #define _ASM_SYSCALL_H
17 #include <linux/sched.h>
18 #include <linux/err.h>
20 extern const unsigned long sys_call_table
[];
22 static inline int syscall_get_nr(struct task_struct
*task
, struct pt_regs
*regs
)
27 static inline void syscall_rollback(struct task_struct
*task
,
30 regs
->d0
= regs
->orig_d0
;
33 static inline long syscall_get_error(struct task_struct
*task
,
36 unsigned long error
= regs
->d0
;
37 return IS_ERR_VALUE(error
) ? error
: 0;
40 static inline long syscall_get_return_value(struct task_struct
*task
,
46 static inline void syscall_set_return_value(struct task_struct
*task
,
50 regs
->d0
= (long) error
?: val
;
53 static inline void syscall_get_arguments(struct task_struct
*task
,
55 unsigned int i
, unsigned int n
,
85 static inline void syscall_set_arguments(struct task_struct
*task
,
87 unsigned int i
, unsigned int n
,
88 const unsigned long *args
)
117 #endif /* _ASM_SYSCALL_H */