This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
ACKNOWLEDGMENTS: Pierre Cloutier (pcloutier@poseidoncontrols.com) has suggested the 6 characters names and fixed many inconsistencies within this file.
Definition in file rtai_lxrt.h.
Include dependency graph for rtai_lxrt.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.
Data Structures | |
| struct | mode_regs |
| struct | linux_syscalls_list |
Defines | |
| #define | YIELD 0 |
| #define | SUSPEND 1 |
| #define | RESUME 2 |
| #define | MAKE_PERIODIC 3 |
| #define | WAIT_PERIOD 4 |
| #define | SLEEP 5 |
| #define | SLEEP_UNTIL 6 |
| #define | START_TIMER 7 |
| #define | STOP_TIMER 8 |
| #define | GET_TIME 9 |
| #define | COUNT2NANO 10 |
| #define | NANO2COUNT 11 |
| #define | BUSY_SLEEP 12 |
| #define | SET_PERIODIC_MODE 13 |
| #define | SET_ONESHOT_MODE 14 |
| #define | SIGNAL_HANDLER 15 |
| #define | TASK_USE_FPU 16 |
| #define | GET_TASK_INFO 17 |
| #define | HARD_TIMER_COUNT 18 |
| #define | GET_TIME_NS 19 |
| #define | GET_CPU_TIME_NS 20 |
| #define | SET_RUNNABLE_ON_CPUS 21 |
| #define | SET_RUNNABLE_ON_CPUID 22 |
| #define | GET_TIMER_CPU 23 |
| #define | START_RT_APIC_TIMERS 24 |
| #define | HARD_TIMER_COUNT_CPUID 25 |
| #define | COUNT2NANO_CPUID 26 |
| #define | NANO2COUNT_CPUID 27 |
| #define | GET_TIME_CPUID 28 |
| #define | GET_TIME_NS_CPUID 29 |
| #define | MAKE_PERIODIC_NS 30 |
| #define | SET_SCHED_POLICY 31 |
| #define | SET_RESUME_END 32 |
| #define | SPV_RMS 33 |
| #define | WAKEUP_SLEEPING 34 |
| #define | CHANGE_TASK_PRIO 35 |
| #define | SET_RESUME_TIME 36 |
| #define | SET_PERIOD 37 |
| #define | HARD_TIMER_RUNNING 38 |
| #define | TYPED_SEM_INIT 39 |
| #define | SEM_DELETE 40 |
| #define | NAMED_SEM_INIT 41 |
| #define | NAMED_SEM_DELETE 42 |
| #define | SEM_SIGNAL 43 |
| #define | SEM_WAIT 44 |
| #define | SEM_WAIT_IF 45 |
| #define | SEM_WAIT_UNTIL 46 |
| #define | SEM_WAIT_TIMED 47 |
| #define | SEM_BROADCAST 48 |
| #define | SEM_WAIT_BARRIER 49 |
| #define | SEM_COUNT 50 |
| #define | COND_WAIT 51 |
| #define | COND_WAIT_UNTIL 52 |
| #define | COND_WAIT_TIMED 53 |
| #define | RWL_INIT 54 |
| #define | RWL_DELETE 55 |
| #define | NAMED_RWL_INIT 56 |
| #define | NAMED_RWL_DELETE 57 |
| #define | RWL_RDLOCK 58 |
| #define | RWL_RDLOCK_IF 59 |
| #define | RWL_RDLOCK_UNTIL 60 |
| #define | RWL_RDLOCK_TIMED 61 |
| #define | RWL_WRLOCK 62 |
| #define | RWL_WRLOCK_IF 63 |
| #define | RWL_WRLOCK_UNTIL 64 |
| #define | RWL_WRLOCK_TIMED 65 |
| #define | RWL_UNLOCK 66 |
| #define | SPL_INIT 67 |
| #define | SPL_DELETE 68 |
| #define | NAMED_SPL_INIT 69 |
| #define | NAMED_SPL_DELETE 70 |
| #define | SPL_LOCK 71 |
| #define | SPL_LOCK_IF 72 |
| #define | SPL_LOCK_TIMED 73 |
| #define | SPL_UNLOCK 74 |
| #define | TYPED_MBX_INIT 75 |
| #define | MBX_DELETE 76 |
| #define | NAMED_MBX_INIT 77 |
| #define | NAMED_MBX_DELETE 78 |
| #define | MBX_SEND 79 |
| #define | MBX_SEND_WP 80 |
| #define | MBX_SEND_IF 81 |
| #define | MBX_SEND_UNTIL 82 |
| #define | MBX_SEND_TIMED 83 |
| #define | MBX_RECEIVE 84 |
| #define | MBX_RECEIVE_WP 85 |
| #define | MBX_RECEIVE_IF 86 |
| #define | MBX_RECEIVE_UNTIL 87 |
| #define | MBX_RECEIVE_TIMED 88 |
| #define | MBX_EVDRP 89 |
| #define | MBX_OVRWR_SEND 90 |
| #define | SENDMSG 91 |
| #define | SEND_IF 92 |
| #define | SEND_UNTIL 93 |
| #define | SEND_TIMED 94 |
| #define | RECEIVEMSG 95 |
| #define | RECEIVE_IF 96 |
| #define | RECEIVE_UNTIL 97 |
| #define | RECEIVE_TIMED 98 |
| #define | RPCMSG 99 |
| #define | RPC_IF 100 |
| #define | RPC_UNTIL 101 |
| #define | RPC_TIMED 102 |
| #define | EVDRP 103 |
| #define | ISRPC 104 |
| #define | RETURNMSG 105 |
| #define | RPCX 106 |
| #define | RPCX_IF 107 |
| #define | RPCX_UNTIL 108 |
| #define | RPCX_TIMED 109 |
| #define | SENDX 110 |
| #define | SENDX_IF 111 |
| #define | SENDX_UNTIL 112 |
| #define | SENDX_TIMED 113 |
| #define | RETURNX 114 |
| #define | RECEIVEX 115 |
| #define | RECEIVEX_IF 116 |
| #define | RECEIVEX_UNTIL 117 |
| #define | RECEIVEX_TIMED 118 |
| #define | EVDRPX 119 |
| #define | PROXY_ATTACH 120 |
| #define | PROXY_DETACH 121 |
| #define | PROXY_TRIGGER 122 |
| #define | RT_SEND 123 |
| #define | RT_RECEIVE 124 |
| #define | RT_CRECEIVE 125 |
| #define | RT_REPLY 126 |
| #define | RT_PROXY_ATTACH 127 |
| #define | RT_PROXY_DETACH 128 |
| #define | RT_TRIGGER 129 |
| #define | RT_NAME_ATTACH 130 |
| #define | RT_NAME_DETACH 131 |
| #define | RT_NAME_LOCATE 132 |
| #define | BITS_INIT 133 |
| #define | BITS_DELETE 134 |
| #define | NAMED_BITS_INIT 135 |
| #define | NAMED_BITS_DELETE 136 |
| #define | BITS_GET 137 |
| #define | BITS_RESET 138 |
| #define | BITS_SIGNAL 139 |
| #define | BITS_WAIT 140 |
| #define | BITS_WAIT_IF 141 |
| #define | BITS_WAIT_UNTIL 142 |
| #define | BITS_WAIT_TIMED 143 |
| #define | TBX_INIT 144 |
| #define | TBX_DELETE 145 |
| #define | NAMED_TBX_INIT 146 |
| #define | NAMED_TBX_DELETE 147 |
| #define | TBX_SEND 148 |
| #define | TBX_SEND_IF 149 |
| #define | TBX_SEND_UNTIL 150 |
| #define | TBX_SEND_TIMED 151 |
| #define | TBX_RECEIVE 152 |
| #define | TBX_RECEIVE_IF 153 |
| #define | TBX_RECEIVE_UNTIL 154 |
| #define | TBX_RECEIVE_TIMED 155 |
| #define | TBX_BROADCAST 156 |
| #define | TBX_BROADCAST_IF 157 |
| #define | TBX_BROADCAST_UNTIL 158 |
| #define | TBX_BROADCAST_TIMED 159 |
| #define | TBX_URGENT 160 |
| #define | TBX_URGENT_IF 161 |
| #define | TBX_URGENT_UNTIL 162 |
| #define | TBX_URGENT_TIMED 163 |
| #define | MQ_OPEN 164 |
| #define | MQ_RECEIVE 165 |
| #define | MQ_SEND 166 |
| #define | MQ_CLOSE 167 |
| #define | MQ_GETATTR 168 |
| #define | MQ_SETATTR 169 |
| #define | MQ_NOTIFY 170 |
| #define | MQ_UNLINK 171 |
| #define | MQ_TIMEDRECEIVE 172 |
| #define | MQ_TIMEDSEND 173 |
| #define | NAMED_TASK_INIT 174 |
| #define | NAMED_TASK_INIT_CPUID 175 |
| #define | NAMED_TASK_DELETE 176 |
| #define | GET_ADR 177 |
| #define | GET_NAME 178 |
| #define | NETRPC 179 |
| #define | SEND_REQ_REL_PORT 180 |
| #define | DDN2NL 181 |
| #define | SET_THIS_NODE 182 |
| #define | FIND_ASGN_STUB 183 |
| #define | REL_STUB 184 |
| #define | WAITING_RETURN 185 |
| #define | COND_SIGNAL 186 |
| #define | SHM_ALLOC 187 |
| #define | SHM_FREE 188 |
| #define | SHM_SIZE 189 |
| #define | HEAP_SET 190 |
| #define | HEAP_ALLOC 191 |
| #define | HEAP_FREE 192 |
| #define | HEAP_NAMED_ALLOC 193 |
| #define | HEAP_NAMED_FREE 194 |
| #define | MALLOC 195 |
| #define | FREE 196 |
| #define | NAMED_MALLOC 197 |
| #define | NAMED_FREE 198 |
| #define | SUSPEND_IF 199 |
| #define | SUSPEND_UNTIL 200 |
| #define | SUSPEND_TIMED 201 |
| #define | IRQ_WAIT 202 |
| #define | IRQ_WAIT_IF 203 |
| #define | IRQ_WAIT_UNTIL 204 |
| #define | IRQ_WAIT_TIMED 205 |
| #define | IRQ_SIGNAL 206 |
| #define | REQUEST_IRQ_TASK 207 |
| #define | RELEASE_IRQ_TASK 208 |
| #define | SCHED_LOCK 209 |
| #define | SCHED_UNLOCK 210 |
| #define | PEND_LINUX_IRQ 211 |
| #define | SET_LINUX_SYSCALL_MODE 212 |
| #define | REQUEST_RTC 214 |
| #define | RELEASE_RTC 215 |
| #define | RT_GETTID 216 |
| #define | SET_NETRPC_TIMEOUT 217 |
| #define | GET_REAL_TIME 218 |
| #define | GET_REAL_TIME_NS 219 |
| #define | MQ_REG_USP_NOTIFIER 220 |
| #define | RT_SIGNAL_HELPER 221 |
| #define | RT_SIGNAL_WAITSIG 222 |
| #define | RT_SIGNAL_REQUEST 223 |
| #define | RT_SIGNAL_RELEASE 224 |
| #define | RT_SIGNAL_ENABLE 225 |
| #define | RT_SIGNAL_DISABLE 226 |
| #define | RT_SIGNAL_TRIGGER 227 |
| #define | SEM_RT_POLL 228 |
| #define | RT_POLL_NETRPC 229 |
| #define | MAX_LXRT_FUN 230 |
| #define | RT_INITTICKQUEUE 69 |
| #define | RT_RELEASETICKQUEUE 70 |
| #define | RT_QDYNALLOC 71 |
| #define | RT_QDYNFREE 72 |
| #define | RT_QDYNINIT 73 |
| #define | RT_QBLKWAIT 74 |
| #define | RT_QBLKREPEAT 75 |
| #define | RT_QBLKSOON 76 |
| #define | RT_QBLKDEQUEUE 77 |
| #define | RT_QBLKCANCEL 78 |
| #define | RT_QSYNC 79 |
| #define | RT_QRECEIVE 80 |
| #define | RT_QLOOP 81 |
| #define | RT_QSTEP 82 |
| #define | RT_QBLKBEFORE 83 |
| #define | RT_QBLKAFTER 84 |
| #define | RT_QBLKUNHOOK 85 |
| #define | RT_QBLKRELEASE 86 |
| #define | RT_QBLKCOMPLETE 87 |
| #define | RT_QHOOKFLUSH 88 |
| #define | RT_QBLKATHEAD 89 |
| #define | RT_QBLKATTAIL 90 |
| #define | RT_QHOOKINIT 91 |
| #define | RT_QHOOKRELEASE 92 |
| #define | RT_QBLKSCHEDULE 93 |
| #define | RT_GETTICKQUEUEHOOK 94 |
| #define | RT_BOOM 95 |
| #define | RTAI_MALLOC 96 |
| #define | RT_FREE 97 |
| #define | RT_MMGR_STATS 98 |
| #define | RT_STOMP 99 |
| #define | RT_VC_ATTACH 100 |
| #define | RT_VC_RELEASE 101 |
| #define | RT_VC_RESERVE 102 |
| #define | RT_GET_LINUX_SIGNAL 103 |
| #define | RT_GET_ERRNO 104 |
| #define | RT_SET_LINUX_SIGNAL_HANDLER 105 |
| #define | LXRT_GET_ADR 1000 |
| #define | LXRT_GET_NAME 1001 |
| #define | LXRT_TASK_INIT 1002 |
| #define | LXRT_TASK_DELETE 1003 |
| #define | LXRT_SEM_INIT 1004 |
| #define | LXRT_SEM_DELETE 1005 |
| #define | LXRT_MBX_INIT 1006 |
| #define | LXRT_MBX_DELETE 1007 |
| #define | MAKE_SOFT_RT 1008 |
| #define | MAKE_HARD_RT 1009 |
| #define | PRINT_TO_SCREEN 1010 |
| #define | NONROOT_HRT 1011 |
| #define | RT_BUDDY 1012 |
| #define | HRT_USE_FPU 1013 |
| #define | USP_SIGHDL 1014 |
| #define | GET_USP_FLAGS 1015 |
| #define | SET_USP_FLAGS 1016 |
| #define | GET_USP_FLG_MSK 1017 |
| #define | SET_USP_FLG_MSK 1018 |
| #define | IS_HARD 1019 |
| #define | LINUX_SERVER_INIT 1020 |
| #define | ALLOC_REGISTER 1021 |
| #define | DELETE_DEREGISTER 1022 |
| #define | FORCE_TASK_SOFT 1023 |
| #define | PRINTK 1024 |
| #define | GET_EXECTIME 1025 |
| #define | GET_TIMEORIG 1026 |
| #define | LXRT_RWL_INIT 1027 |
| #define | LXRT_RWL_DELETE 1028 |
| #define | LXRT_SPL_INIT 1029 |
| #define | LXRT_SPL_DELETE 1030 |
| #define | FORCE_SOFT 0x80000000 |
| #define | GT_NR_SYSCALLS (1 << 11) |
| #define | ENCODE_LXRT_REQ(dynx, srq, lsize) (((dynx) << 24) | ((srq) << 12) | GT_NR_SYSCALLS | (lsize)) |
| #define | SRQ(x) (((x) >> 12) & 0xFFF) |
| #define | NARG(x) ((x) & (GT_NR_SYSCALLS - 1)) |
| #define | INDX(x) (((x) >> 24) & 0xF) |
| #define | SYNC_LINUX_SYSCALL 1 |
| #define | ASYNC_LINUX_SYSCALL 0 |
| #define | SRV_NSYSCALL_REGS 7 |
| #define | PAC_NSYSCALL_ARGS 6 |
| #define | rt_grow_and_lock_stack(incr) do { } while (0) |
| #define | BIDX 0 |
| #define | SIZARG sizeof(arg) |
| #define | RT_THREAD_STACK_MIN 64*1024 |
| #define | rt_sync_async_linux_syscall_server_create(task, mode, cbfun, nr_calls) rt_create_linux_syscall_server(task, mode, cbfun, nr_calls) |
| #define | rt_linux_syscall_server_create(task) rt_sync_async_linux_syscall_server_create(task, SYNC_LINUX_SYSCALL, NULL, 1); |
| #define | rt_task_delete(task) rt_thread_delete(task) |
| #define | rt_named_task_init(task_name, thread, data, stack_size, prio, uses_fpu, signal) rt_task_init(nam2num(task_name), thread, data, stack_size, prio, uses_fpu, signal) |
| #define | rt_named_task_init_cpuid(task_name, thread, data, stack_size, prio, uses_fpu, signal, run_on_cpu) rt_task_init_cpuid(nam2num(task_name), thread, data, stack_size, prio, uses_fpu, signal, run_on_cpu) |
| #define | VSNPRINTF_BUF_SIZE 256 |
| #define | rt_buddy() rt_agent() |
| #define | rt_is_soft_real_time(rt_task) (!rt_is_hard_real_time((rt_task))) |
| #define | rt_task_wakeup_sleeping(task) rt_task_masked_unblock(task, RT_SCHED_DELAYED) |
Functions | |
| static void * | rt_get_adr (unsigned long name) |
| Get an object address by its name. | |
| static unsigned long | rt_get_name (void *adr) |
| Get an object name by its address. | |
| static RT_TASK * | rt_task_init_schmod (unsigned long name, int priority, int stack_size, int max_msg_size, int policy, int cpus_allowed) |
| static int | rt_clone (void *fun, void *args, long stack_size, unsigned long flags) |
| static long | rt_thread_create (void *fun, void *args, int stack_size) |
| static int | rt_thread_join (long thread) |
| static int | rt_thread_delete (RT_TASK *task) |
| static void | linux_syscall_server_fun (struct linux_syscalls_list *list) |
| static void | rt_set_linux_syscall_mode (int mode, void(*callback_fun)(long, long)) |
| static int | rt_create_linux_syscall_server (RT_TASK *task, int mode, void(*callback_fun)(long, long), int nr_bufd_async_calls) |
| static RT_TASK * | rt_thread_init (unsigned long name, int priority, int max_msg_size, int policy, int cpus_allowed) |
| static RT_TASK * | rt_task_init (unsigned long name, int priority, int stack_size, int max_msg_size) |
| Create an RTAI task extension for a Linux process/task in user space. | |
| static void | rt_set_sched_policy (RT_TASK *task, int policy, int rr_quantum_ns) |
| static int | rt_change_prio (RT_TASK *task, int priority) |
| static void | rt_make_soft_real_time (void) |
| Return a hard real time Linux process, or pthread to the standard Linux behavior. | |
| static int | rt_task_yield (void) |
| static int | rt_task_suspend (RT_TASK *task) |
| static int | rt_task_suspend_if (RT_TASK *task) |
| static int | rt_task_suspend_until (RT_TASK *task, RTIME time) |
| static int | rt_task_suspend_timed (RT_TASK *task, RTIME delay) |
| static int | rt_task_resume (RT_TASK *task) |
| static void | rt_sched_lock (void) |
| static void | rt_sched_unlock (void) |
| static void | rt_pend_linux_irq (unsigned irq) |
| static int | rt_irq_wait (unsigned irq) |
| static int | rt_irq_wait_if (unsigned irq) |
| static int | rt_irq_wait_until (unsigned irq, RTIME time) |
| static int | rt_irq_wait_timed (unsigned irq, RTIME delay) |
| static int | rt_irq_signal (unsigned irq) |
| static int | rt_request_irq_task (unsigned irq, void *handler, int type, int affine2task) |
| static int | rt_release_irq_task (unsigned irq) |
| static int | rt_task_make_periodic (RT_TASK *task, RTIME start_time, RTIME period) |
| static int | rt_task_make_periodic_relative_ns (RT_TASK *task, RTIME start_delay, RTIME period) |
| static int | rt_task_wait_period (void) |
| static int | rt_sleep (RTIME delay) |
| static int | rt_sleep_until (RTIME time) |
| static int | rt_is_hard_timer_running (void) |
| static RTIME | start_rt_timer (int period) |
| static void | stop_rt_timer (void) |
| static void | rt_request_rtc (int rtc_freq, void *handler) |
| static void | rt_release_rtc (void) |
| static RTIME | rt_get_time (void) |
| static RTIME | rt_get_real_time (void) |
| static RTIME | rt_get_real_time_ns (void) |
| static RTIME | count2nano (RTIME count) |
| static RTIME | nano2count (RTIME nanos) |
| static void | rt_busy_sleep (int ns) |
| static void | rt_set_periodic_mode (void) |
| static void | rt_set_oneshot_mode (void) |
| static int | rt_task_signal_handler (RT_TASK *task, void(*handler)(void)) |
| static int | rt_task_use_fpu (RT_TASK *task, int use_fpu_flag) |
| static int | rt_buddy_task_use_fpu (RT_TASK *task, int use_fpu_flag) |
| static int | rt_task_get_info (RT_TASK *task, RT_TASK_INFO *task_info) |
| static int | rt_get_priorities (RT_TASK *task, int *priority, int *base_priority) |
| static int | rt_hard_timer_tick (void) |
| static RTIME | rt_get_time_ns (void) |
| static RTIME | rt_get_cpu_time_ns (void) |
| static void | rt_set_runnable_on_cpus (RT_TASK *task, unsigned long cpu_mask) |
| static void | rt_set_runnable_on_cpuid (RT_TASK *task, unsigned int cpuid) |
| static int | rt_get_timer_cpu (void) |
| static void | start_rt_apic_timers (struct apic_timer_setup_data *setup_mode, unsigned int rcvr_jiffies_cpuid) |
| static int | rt_hard_timer_tick_cpuid (int cpuid) |
| static RTIME | count2nano_cpuid (RTIME count, unsigned int cpuid) |
| static RTIME | nano2count_cpuid (RTIME nanos, unsigned int cpuid) |
| static RTIME | rt_get_time_cpuid (unsigned int cpuid) |
| static RTIME | rt_get_time_ns_cpuid (unsigned int cpuid) |
| static void | rt_boom (void) |
| static void | rt_mmgr_stats (void) |
| static void | rt_stomp (void) |
| static int | rt_get_linux_signal (RT_TASK *task) |
| static int | rt_get_errno (RT_TASK *task) |
| static int | rt_set_linux_signal_handler (RT_TASK *task, void(*handler)(int sig)) |
| static int | rtai_print_to_screen (const char *format,...) |
| static int | rt_printk (const char *format,...) |
| static int | rt_usp_signal_handler (void(*handler)(void)) |
| static unsigned long | rt_get_usp_flags (RT_TASK *rt_task) |
| static unsigned long | rt_get_usp_flags_mask (RT_TASK *rt_task) |
| static void | rt_set_usp_flags (RT_TASK *rt_task, unsigned long flags) |
| static void | rt_set_usp_flags_mask (unsigned long flags_mask) |
| static RT_TASK * | rt_force_task_soft (int pid) |
| static RT_TASK * | rt_agent (void) |
| static int | rt_gettid (void) |
| static void | rt_make_hard_real_time (void) |
| Give a Linux process, or pthread, hard real time execution capabilities allowing full kernel preemption. | |
| static void | rt_allow_nonroot_hrt (void) |
| Allows a non root user to use the Linux POSIX soft real time process management and memory lock functions, and allows it to do any input-output operation from user space. | |
| static int | rt_is_hard_real_time (RT_TASK *rt_task) |
| static void | rt_task_set_resume_end_times (RTIME resume, RTIME end) |
| static int | rt_set_resume_time (RT_TASK *rt_task, RTIME new_resume_time) |
| static int | rt_set_period (RT_TASK *rt_task, RTIME new_period) |
| static void | rt_spv_RMS (int cpuid) |
| static int | rt_task_masked_unblock (RT_TASK *task, unsigned long mask) |
| static void | rt_get_exectime (RT_TASK *task, RTIME *exectime) |
| static void | rt_gettimeorig (RTIME time_orig[]) |
| static RT_TASK * | ftask_init (unsigned long name, int priority) |
| static RTIME | start_ftimer (long period, long ftick_freq) |
| static RTIME | stop_ftimer (void) |
1.4.7