00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef _RTAI_SPL_H
00020 #define _RTAI_SPL_H
00021
00022 #include <rtai_sem.h>
00023
00024 struct rtai_spl;
00025
00026 #ifdef __KERNEL__
00027
00028 #ifndef __cplusplus
00029
00030 typedef struct rtai_spl {
00031 void *owndby;
00032 int count;
00033 unsigned long flags;
00034 } SPL;
00035
00036 #else
00037 extern "C" {
00038 #endif
00039
00040 RTAI_SYSCALL_MODE int rt_spl_init(struct rtai_spl *spl);
00041
00042 RTAI_SYSCALL_MODE int rt_spl_delete(struct rtai_spl *spl);
00043
00044 RTAI_SYSCALL_MODE SPL *_rt_named_spl_init(unsigned long spl_name);
00045
00046 RTAI_SYSCALL_MODE int rt_named_spl_delete(SPL *spl);
00047
00048 RTAI_SYSCALL_MODE int rt_spl_lock(struct rtai_spl *spl);
00049
00050 RTAI_SYSCALL_MODE int rt_spl_lock_if(struct rtai_spl *spl);
00051
00052 RTAI_SYSCALL_MODE int rt_spl_lock_timed(struct rtai_spl *spl,
00053 unsigned long ns);
00054
00055 RTAI_SYSCALL_MODE int rt_spl_unlock(struct rtai_spl *spl);
00056
00057 #ifdef __cplusplus
00058 }
00059 #endif
00060
00061 #else
00062
00063 #ifdef __cplusplus
00064 extern "C" {
00065 #endif
00066
00067 RTAI_PROTO(struct rtai_spl *, rt_spl_init,(unsigned long name))
00068 {
00069 struct { unsigned long name; } arg = { name };
00070 return (struct rtai_spl *)rtai_lxrt(BIDX, SIZARG, LXRT_SPL_INIT, &arg).v[LOW];
00071 }
00072
00073 RTAI_PROTO(int, rt_spl_delete,(struct rtai_spl *spl))
00074 {
00075 struct { struct rtai_spl *spl; } arg = { spl };
00076 return rtai_lxrt(BIDX, SIZARG, LXRT_SPL_DELETE, &arg).i[LOW];
00077 }
00078
00079 RTAI_PROTO(struct rtai_spl *, rt_named_spl_init,(const char *name))
00080 {
00081 struct { const char *name; } arg = { name };
00082 return (struct rtai_spl *)rtai_lxrt(BIDX, SIZARG, NAMED_SPL_INIT, &arg).v[LOW];
00083 }
00084
00085 RTAI_PROTO(int, rt_named_spl_delete,(struct rtai_spl *spl))
00086 {
00087 struct { struct rtai_spl *spl; } arg = { spl };
00088 return rtai_lxrt(BIDX, SIZARG, NAMED_SPL_DELETE, &arg).i[LOW];
00089 }
00090
00091 RTAI_PROTO(int, rt_spl_lock,(struct rtai_spl *spl))
00092 {
00093 struct { struct rtai_spl *spl; } arg = { spl };
00094 return rtai_lxrt(BIDX, SIZARG, SPL_LOCK, &arg).i[LOW];
00095 }
00096
00097 RTAI_PROTO(int, rt_spl_lock_if,(struct rtai_spl *spl))
00098 {
00099 struct { struct rtai_spl *spl; } arg = { spl };
00100 return rtai_lxrt(BIDX, SIZARG, SPL_LOCK_IF, &arg).i[LOW];
00101 }
00102
00103 RTAI_PROTO(int, rt_spl_lock_timed,(struct rtai_spl *spl, RTIME delay))
00104 {
00105 struct { struct rtai_spl *spl; RTIME delay; } arg = { spl, delay };
00106 return rtai_lxrt(BIDX, SIZARG, SPL_LOCK_TIMED, &arg).i[LOW];
00107 }
00108
00109 RTAI_PROTO(int, rt_spl_unlock,(struct rtai_spl *spl))
00110 {
00111 struct { struct rtai_spl *spl; } arg = { spl };
00112 return rtai_lxrt(BIDX, SIZARG, SPL_UNLOCK, &arg).i[LOW];
00113 }
00114
00115 #ifdef __cplusplus
00116 }
00117 #endif
00118
00119 #endif
00120
00121 #if !defined(__KERNEL__) || defined(__cplusplus)
00122
00123 typedef struct rtai_spl {
00124 int opaque;
00125 } SPL;
00126
00127 #endif
00128
00129 #endif