Xenomai  3.0.5
syscall.h
1 /*
2  * Copyright (C) 2005 Philippe Gerum <rpm@xenomai.org>.
3  *
4  * Xenomai is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published
6  * by the Free Software Foundation; either version 2 of the License,
7  * or (at your option) any later version.
8  *
9  * Xenomai is distributed in the hope that it will be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with Xenomai; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
17  * 02111-1307, USA.
18  */
19 #ifndef _COBALT_BLACKFIN_ASM_SYSCALL_H
20 #define _COBALT_BLACKFIN_ASM_SYSCALL_H
21 
22 #include <linux/errno.h>
23 #include <asm/ptrace.h>
24 #include <asm-generic/xenomai/syscall.h>
25 
26 #define __xn_reg_sys(__regs) ((__regs)->orig_p0)
27 #define __xn_syscall_p(__regs) (__xn_reg_sys(__regs) & __COBALT_SYSCALL_BIT)
28 #define __xn_syscall(__regs) (__xn_reg_sys(__regs) & ~__COBALT_SYSCALL_BIT)
29 
30 #define __xn_reg_rval(__regs) ((__regs)->r0)
31 #define __xn_reg_arg1(__regs) ((__regs)->r0)
32 #define __xn_reg_arg2(__regs) ((__regs)->r1)
33 #define __xn_reg_arg3(__regs) ((__regs)->r2)
34 #define __xn_reg_arg4(__regs) ((__regs)->r3)
35 #define __xn_reg_arg5(__regs) ((__regs)->r4)
36 
37 static inline void __xn_error_return(struct pt_regs *regs, int v)
38 {
39  __xn_reg_rval(regs) = v;
40 }
41 
42 static inline void __xn_status_return(struct pt_regs *regs, long v)
43 {
44  __xn_reg_rval(regs) = v;
45 }
46 
47 static inline int __xn_interrupted_p(struct pt_regs *regs)
48 {
49  return __xn_reg_rval(regs) == -EINTR;
50 }
51 
52 int xnarch_local_syscall(unsigned long a1, unsigned long a2,
53  unsigned long a3, unsigned long a4,
54  unsigned long a5);
55 
56 #endif /* !_COBALT_BLACKFIN_ASM_SYSCALL_H */