base/include/asm-i386/rtai_srq.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 1999-2003 Paolo Mantegazza <mantegazza@aero.polimi.it>
00003  *
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License as
00006  * published by the Free Software Foundation; either version 2 of the
00007  * License, or (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00017  */
00018 
00019 
00020 #ifndef _RTAI_ASM_I386_SRQ_H
00021 #define _RTAI_ASM_I386_SRQ_H
00022 
00023 #ifndef __KERNEL__
00024 
00025 #include <sys/syscall.h>
00026 #include <unistd.h>
00027 
00028 #include <asm/rtai_vectors.h>
00029 
00030 #ifdef CONFIG_RTAI_LXRT_USE_LINUX_SYSCALL
00031 #define USE_LINUX_SYSCALL
00032 #else
00033 #undef USE_LINUX_SYSCALL
00034 #endif
00035 
00036 #define RTAI_SRQ_SYSCALL_NR  0x70000001
00037 
00038 static inline long long rtai_srq(int srq, unsigned long args)
00039 {
00040     long long retval;
00041 #ifdef USE_LINUX_SYSCALL
00042         syscall(RTAI_SRQ_SYSCALL_NR, srq, args, &retval);
00043 #else
00044         RTAI_DO_TRAP(RTAI_SYS_VECTOR, retval, srq, args);
00045 #endif
00046     return retval;
00047 }
00048 
00049 
00050 static inline int rtai_open_srq(unsigned long label)
00051 {
00052     return (int)rtai_srq(0, label);
00053 }
00054 
00055 #endif /* !__KERNEL__ */
00056 
00057 #endif /* !_RTAI_ASM_I386_SRQ_H */

Generated on Tue Feb 2 17:46:05 2010 for RTAI API by  doxygen 1.4.7