00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
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 
00056 
00057 #endif