00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046 #ifndef _RTAI_NUCLEUS_FUSION_H
00047 #define _RTAI_NUCLEUS_FUSION_H
00048
00049 #define FUSION_SKIN_MAGIC 0x504f5358
00050
00051
00052 #define FUSION_LOW_PRIO 1
00053 #define FUSION_HIGH_PRIO 99
00054
00055 #define FUSION_IRQ_PRIO (FUSION_HIGH_PRIO + 1)
00056
00057 #define FUSION_MIN_PRIO FUSION_LOW_PRIO
00058 #define FUSION_MAX_PRIO FUSION_IRQ_PRIO
00059
00060 #ifndef __RTAI_SIM__
00061
00062 #include <nucleus/asm/syscall.h>
00063
00064 #define FUSION_APERIODIC_TIMER 0
00065
00066 #define FUSION_LINUX_DOMAIN 0
00067 #define FUSION_RTAI_DOMAIN 1
00068
00069 #define __xn_fusion_init 0
00070 #define __xn_fusion_create 1
00071 #define __xn_fusion_start 2
00072 #define __xn_fusion_set_periodic 3
00073 #define __xn_fusion_wait_period 4
00074 #define __xn_fusion_time 5
00075 #define __xn_fusion_cputime 6
00076 #define __xn_fusion_start_timer 7
00077 #define __xn_fusion_stop_timer 8
00078 #define __xn_fusion_sleep 9
00079 #define __xn_fusion_ns2ticks 10
00080 #define __xn_fusion_ticks2ns 11
00081 #define __xn_fusion_inquire 12
00082 #define __xn_fusion_idle 13
00083 #define __xn_fusion_cancel 14
00084 #define __xn_fusion_activate 15
00085 #define __xn_fusion_hold 16
00086 #define __xn_fusion_release 17
00087
00088 typedef unsigned long long nanotime_t;
00089
00090 typedef long long nanostime_t;
00091
00092 #ifdef __cplusplus
00093 extern "C" {
00094 #endif
00095
00096 #ifdef __KERNEL__
00097
00098 int xnfusion_mount(void);
00099
00100 int xnfusion_umount(void);
00101
00102 int xnfusion_attach(void);
00103
00104 #else
00105
00106 #include <sys/types.h>
00107 #include <pthread.h>
00108
00109
00110
00111 int pthread_info_rt(xnsysinfo_t *infop);
00112
00113 int pthread_init_rt(const char *name,
00114 void *uhandle,
00115 void **khandlep);
00116
00117 int pthread_create_rt(const char *name,
00118 void *uhandle,
00119 pid_t syncpid,
00120 int *syncp,
00121 void **khandlep);
00122
00123 int pthread_barrier_rt(void);
00124
00125 int pthread_start_rt(void *khandle);
00126
00127 int pthread_sync_rt(int *syncp);
00128
00129 int pthread_migrate_rt(int domain);
00130
00131 int pthread_start_timer_rt(nanotime_t nstick);
00132
00133 int pthread_stop_timer_rt(void);
00134
00135 int pthread_time_rt(nanotime_t *tp);
00136
00137 int pthread_cputime_rt(nanotime_t *tp);
00138
00139 int pthread_ns2ticks_rt(nanostime_t ns,
00140 nanostime_t *pticks);
00141
00142 int pthread_ticks2ns_rt(nanostime_t ticks,
00143 nanostime_t *pns);
00144
00145 int pthread_ns2tsc_rt(nanostime_t ns,
00146 nanostime_t *ptsc);
00147
00148 int pthread_tsc2ns_rt(nanostime_t tsc,
00149 nanostime_t *pns);
00150
00151 int pthread_sleep_rt(nanotime_t ticks);
00152
00153 int pthread_inquire_rt(xninquiry_t *infop);
00154
00155 int pthread_set_periodic_rt(nanotime_t idate,
00156 nanotime_t period);
00157
00158 int pthread_wait_period_rt(void);
00159
00160
00161
00162
00163
00164 int __pthread_idle_vm(int *lockp);
00165
00166 int __pthread_cancel_vm(void *deadhandle,
00167 void *nexthandle);
00168
00169 int __pthread_activate_vm(void *nexthandle,
00170 void *prevhandle);
00171
00172 int __pthread_hold_vm(int *pendp);
00173
00174 int __pthread_release_vm(int *lockp);
00175
00176 #endif
00177
00178 #ifdef __cplusplus
00179 };
00180 #endif
00181
00182 #endif
00183
00184 #endif