RTAI services functions.


Detailed Description

This module defines some functions that can be used by RTAI tasks, for managing interrupts and communication services with Linux processes.


Files

file  hal.c
 ARTI -- RTAI-compatible Adeos-based Real-Time Interface.
file  hal.c
 ARTI -- RTAI-compatible Adeos-based Real-Time Interface.
file  rtai_hal.h
 ARTI -- RTAI-compatible Adeos-based Real-Time Interface.
file  rtai_hal.h
 ARTI -- RTAI-compatible Adeos-based Real-Time Interface.
file  rtai_hal.h
 ARTI -- RTAI-compatible Adeos-based Real-Time Interface.

Defines

#define INCLUDED_BY_HAL_C
#define __RTAI_HAL__
#define RTAI_NR_IRQS   (RTAI_TIMER_DECR_IRQ + 1)
#define BEGIN_PIC()
#define adeos_pend_irq(irq)
#define rtai_critical_sync   NULL
#define rt_free_apic_timers()   rt_free_timer()
#define RTAI_SCHED_ISR_LOCK()
#define RTAI_SCHED_ISR_UNLOCK()
#define RT_PRINTK_SRQ   1
#define PRINTK_BUF_SIZE   (10000)
#define TEMP_BUF_SIZE   (500)
#define RTAI_DUOSS
#define LOCKED_LINUX_IN_IRQ_HANDLER
#define UNWRAPPED_CATCH_EVENT
#define DOMAIN_TO_STALL   (fusion_domain)
#define RTAI_NR_CPUS   1
#define RTAI_DEFAULT_TICK   100000
#define RTAI_DEFAULT_STACKSZ   1024
#define RTAI_DUOSS
#define LOCKED_LINUX_IN_IRQ_HANDLER
#define UNWRAPPED_CATCH_EVENT
#define DOMAIN_TO_STALL   (fusion_domain)
#define RTAI_NR_CPUS   1
#define RTAI_DEFAULT_TICK   100000
#define RTAI_DEFAULT_STACKSZ   1024
#define RTAI_NR_CPUS   1
#define RTAI_DEFAULT_TICK   100000
#define RTAI_DEFAULT_STACKSZ   4092

Functions

 MODULE_LICENSE ("GPL")
 MODULE_PARM (rtai_cpufreq_arg,"i")
unsigned long rtai_critical_enter (void(*synch)(void))
void rtai_critical_exit (unsigned long flags)
int rt_request_irq (unsigned irq, int(*handler)(unsigned irq, void *cookie), void *cookie, int retmode)
int rt_release_irq (unsigned irq)
void rt_set_irq_cookie (unsigned irq, void *cookie)
void rt_set_irq_retmode (unsigned irq, int retmode)
 rtai_save_and_lock_preempt_count ()
 start and initialize the PIC to accept interrupt request irq.
void rt_shutdown_irq (unsigned irq)
 Shut down an IRQ source.
void _rt_enable_irq (unsigned irq)
 Enable an IRQ source.
void rt_enable_irq (unsigned irq)
void rt_disable_irq (unsigned irq)
 Disable an IRQ source.
void rt_mask_and_ack_irq (unsigned irq)
 Mask and acknowledge and IRQ source.
void _rt_end_irq (unsigned irq)
 Unmask and IRQ source.
void rt_unmask_irq (unsigned irq)
void rt_ack_irq (unsigned irq)
 Acknowledge an IRQ source.
int rt_request_linux_irq (unsigned irq, irqreturn_t(*handler)(int irq, void *dev_id, struct pt_regs *regs), char *name, void *dev_id)
 Install shared Linux interrupt handler.
int rt_free_linux_irq (unsigned irq, void *dev_id)
 Uninstall shared Linux interrupt handler.
void rt_pend_linux_irq (unsigned irq)
 Pend an IRQ to Linux.
int rt_request_srq (unsigned label, void(*k_handler)(void), long long(*u_handler)(unsigned))
 Install a system request handler.
int rt_free_srq (unsigned srq)
 Uninstall a system request handler.
void rt_pend_linux_srq (unsigned srq)
 Append a Linux IRQ.
void rtai_broadcast_to_timers (int irq, void *dev_id, struct pt_regs *regs)
void rt_request_apic_timers (void(*handler)(void), struct apic_timer_setup_data *tmdata)
int rt_assign_irq_to_cpu (int irq, unsigned long cpus_mask)
int rt_reset_irq_to_sym_mode (int irq)
void rt_request_timer_cpuid (void(*handler)(void), unsigned tick, int cpuid)
int rt_request_timer (void(*handler)(void), unsigned tick, int use_apic)
 Install a timer interrupt handler.
void rt_free_timer (void)
 Uninstall a timer interrupt handler.
 rtai_isr_hook (cpuid)
 while (0)
void rtai_ssrq_trampoline (unsigned virq)
long long rtai_usrq_trampoline (unsigned srq, unsigned label)
asmlinkage int rtai_syscall_entry (struct pt_regs *regs)
void rtai_install_archdep (void)
void rtai_uninstall_archdep (void)
void(*)(int) rt_set_ihook (void(*hookfn)(int))
void rtai_domain_entry (int iflag)
void rt_printk_srq_handler (void)
int __rtai_hal_init (void)
void __rtai_hal_exit (void)
 module_init (__rtai_hal_init)
 module_exit (__rtai_hal_exit)
int rt_printk (const char *fmt,...)
void * ll2a (long long ll, char *s)
 EXPORT_SYMBOL (rtai_realtime_irq)
 EXPORT_SYMBOL (rt_request_irq)
 EXPORT_SYMBOL (rt_release_irq)
 EXPORT_SYMBOL (rt_set_irq_cookie)
 EXPORT_SYMBOL (rt_set_irq_retmode)
 EXPORT_SYMBOL (rt_startup_irq)
 EXPORT_SYMBOL (rt_shutdown_irq)
 EXPORT_SYMBOL (rt_enable_irq)
 EXPORT_SYMBOL (rt_disable_irq)
 EXPORT_SYMBOL (rt_mask_and_ack_irq)
 EXPORT_SYMBOL (rt_unmask_irq)
 EXPORT_SYMBOL (rt_ack_irq)
 EXPORT_SYMBOL (rt_request_linux_irq)
 EXPORT_SYMBOL (rt_free_linux_irq)
 EXPORT_SYMBOL (rt_pend_linux_irq)
 EXPORT_SYMBOL (rt_request_srq)
 EXPORT_SYMBOL (rt_free_srq)
 EXPORT_SYMBOL (rt_pend_linux_srq)
 EXPORT_SYMBOL (rt_assign_irq_to_cpu)
 EXPORT_SYMBOL (rt_reset_irq_to_sym_mode)
 EXPORT_SYMBOL (rt_request_apic_timers)
 EXPORT_SYMBOL (rt_request_timer)
 EXPORT_SYMBOL (rt_free_timer)
 EXPORT_SYMBOL (rt_set_ihook)
 EXPORT_SYMBOL (rtai_critical_enter)
 EXPORT_SYMBOL (rtai_critical_exit)
 EXPORT_SYMBOL (rtai_set_linux_task_priority)
 EXPORT_SYMBOL (rtai_linux_context)
 EXPORT_SYMBOL (rtai_domain)
 EXPORT_SYMBOL (rtai_proc_root)
 EXPORT_SYMBOL (rtai_tunables)
 EXPORT_SYMBOL (rtai_cpu_lock)
 EXPORT_SYMBOL (rtai_cpu_realtime)
 EXPORT_SYMBOL (rt_times)
 EXPORT_SYMBOL (rt_smp_times)
 EXPORT_SYMBOL (rt_printk)
 EXPORT_SYMBOL (ll2a)
 EXPORT_SYMBOL (rtai_lxrt_invoke_entry)
 EXPORT_SYMBOL (rt_scheduling)
__inline__ unsigned long ffnz (unsigned long word)
unsigned long long rtai_ulldiv (unsigned long long ull, unsigned long uld, unsigned long *r)
int rtai_imuldiv (int i, int mult, int div)
long long rtai_llimd (long long ll, int mult, int div)
unsigned long long rtai_u64div32c (unsigned long long a, unsigned long b, int *r)
unsigned long long rtai_ullmul (unsigned long m0, unsigned long m1)
unsigned long long rtai_llimd (unsigned long long ull, unsigned long mult, unsigned long div)

Variables

unsigned long rtai_cpufreq_arg = RTAI_CALIBRATED_CPU_FREQ
struct {
   volatile int   locked
   volatile int   rqsted
rt_scheduling [RTAI_NR_CPUS]
void(* rtai_isr_hook )(int cpuid)
desc_struct idt_table []
adomain_t rtai_domain
struct {
   int(*   handler )(unsigned irq, void *cookie)
   void *   cookie
   int   retmode
rtai_realtime_irq [RTAI_NR_IRQS]
struct {
   unsigned long   flags
   int   count
rtai_linux_irq [NR_IRQS]
struct {
   void(*   k_handler )(void)
   long long(*   u_handler )(unsigned)
   unsigned   label
rtai_sysreq_table [RTAI_NR_SRQS]
unsigned rtai_sysreq_virq
unsigned long rtai_sysreq_map = 3
unsigned long rtai_sysreq_pending
unsigned long rtai_sysreq_running
spinlock_t rtai_ssrq_lock = SPIN_LOCK_UNLOCKED
volatile int rtai_sync_level
atomic_t rtai_sync_count = ATOMIC_INIT(1)
rt_times rt_times = { 0 }
rt_times rt_smp_times [RTAI_NR_CPUS] = { { 0 } }
rtai_switch_data rtai_linux_context [RTAI_NR_CPUS] = { { 0 } }
calibration_data rtai_tunables = { 0 }
volatile unsigned long rtai_cpu_realtime = 0
volatile unsigned long rtai_cpu_lock = 0
int rtai_adeos_ptdbase = -1
hw_interrupt_type __adeos_std_irq_dtype []
unsigned long adeos_pended
long long(* rtai_lxrt_invoke_entry )(unsigned long, unsigned long)
void * adeos_extern_irq_handler
char rt_printk_buf [PRINTK_BUF_SIZE]
int buf_front
int buf_back
char buf [TEMP_BUF_SIZE]


Define Documentation

#define __RTAI_HAL__
 

Definition at line 60 of file hal.c.

#define adeos_pend_irq irq   ) 
 

Value:

do { \ unsigned long flags; \ rtai_save_flags_and_cli(flags); \ adeos_pend_uncond(irq, rtai_cpuid()); \ rtai_restore_flags(flags); \ } while (0)
Definition at line 607 of file hal.c.

Referenced by rt_pend_linux_irq(), and rt_pend_linux_srq().

 
#define BEGIN_PIC  ) 
 

Value:

do { \ rtai_save_flags_and_cli(flags); \ cpuid = rtai_cpuid(); \ lflags = xchg(&adp_root->cpudata[cpuid].status, 1 << IPIPE_STALL_FLAG);
Definition at line 218 of file hal.c.

Referenced by _rt_enable_irq(), _rt_end_irq(), rt_disable_irq(), and rt_shutdown_irq().

#define DOMAIN_TO_STALL   (fusion_domain)
 

Definition at line 47 of file rtai_hal.h.

#define DOMAIN_TO_STALL   (fusion_domain)
 

Definition at line 47 of file rtai_hal.h.

#define INCLUDED_BY_HAL_C
 

Definition at line 44 of file hal.c.

#define LOCKED_LINUX_IN_IRQ_HANDLER
 

Definition at line 45 of file rtai_hal.h.

#define LOCKED_LINUX_IN_IRQ_HANDLER
 

Definition at line 45 of file rtai_hal.h.

#define PRINTK_BUF_SIZE   (10000)
 

Definition at line 1329 of file hal.c.

Referenced by rt_printk(), and rt_printk_srq_handler().

 
#define rt_free_apic_timers  )     rt_free_timer()
 

Definition at line 727 of file hal.c.

#define RT_PRINTK_SRQ   1
 

Definition at line 1242 of file hal.c.

Referenced by __rtai_hal_exit(), __rtai_hal_init(), and rt_printk().

#define rtai_critical_sync   NULL
 

Definition at line 712 of file hal.c.

Referenced by rt_free_timer(), and rt_request_timer().

#define RTAI_DEFAULT_STACKSZ   4092
 

Definition at line 646 of file rtai_hal.h.

#define RTAI_DEFAULT_STACKSZ   1024
 

Definition at line 899 of file rtai_hal.h.

#define RTAI_DEFAULT_STACKSZ   1024
 

Definition at line 899 of file rtai_hal.h.

#define RTAI_DEFAULT_TICK   100000
 

Definition at line 642 of file rtai_hal.h.

#define RTAI_DEFAULT_TICK   100000
 

Definition at line 895 of file rtai_hal.h.

#define RTAI_DEFAULT_TICK   100000
 

Definition at line 895 of file rtai_hal.h.

#define RTAI_DUOSS
 

Definition at line 41 of file rtai_hal.h.

#define RTAI_DUOSS
 

Definition at line 41 of file rtai_hal.h.

#define RTAI_NR_CPUS   1
 

Definition at line 49 of file rtai_hal.h.

#define RTAI_NR_CPUS   1
 

Definition at line 56 of file rtai_hal.h.

#define RTAI_NR_CPUS   1
 

Definition at line 56 of file rtai_hal.h.

#define RTAI_NR_IRQS   (RTAI_TIMER_DECR_IRQ + 1)
 

Definition at line 89 of file hal.c.

Referenced by rt_release_irq(), rt_request_irq(), rt_set_irq_cookie(), and rt_set_irq_retmode().

 
#define RTAI_SCHED_ISR_LOCK  ) 
 

Value:

do { \ if (!rt_scheduling[cpuid].locked++) { \ rt_scheduling[cpuid].rqsted = 0; \ } \ } while (0)
Definition at line 848 of file hal.c.

 
#define RTAI_SCHED_ISR_UNLOCK  ) 
 

Value:

do { \ rtai_cli(); \ if (rt_scheduling[cpuid].locked && !(--rt_scheduling[cpuid].locked)) { \ if (rt_scheduling[cpuid].rqsted > 0 && rtai_isr_hook) {
Definition at line 854 of file hal.c.

#define TEMP_BUF_SIZE   (500)
 

Definition at line 1330 of file hal.c.

#define UNWRAPPED_CATCH_EVENT
 

Definition at line 46 of file rtai_hal.h.

#define UNWRAPPED_CATCH_EVENT
 

Definition at line 46 of file rtai_hal.h.


Function Documentation

void __rtai_hal_exit void   ) 
 

Definition at line 1298 of file hal.c.

References adeos_extern_irq_handler, printk(), RT_PRINTK_SRQ, rtai_adeos_ptdbase, rtai_domain, rtai_sysreq_map, rtai_sysreq_virq, and rtai_uninstall_archdep().

Here is the call graph for this function:

int __rtai_hal_init void   ) 
 

Definition at line 1244 of file hal.c.

References adeos_extern_irq_handler, flags, printk(), RT_PRINTK_SRQ, rt_printk_srq_handler(), rtai_adeos_ptdbase, rtai_critical_enter(), rtai_critical_exit(), rtai_domain, rtai_domain_entry(), rtai_install_archdep(), rtai_ssrq_trampoline(), rtai_sysreq_map, rtai_sysreq_table, and rtai_sysreq_virq.

Here is the call graph for this function:

void _rt_enable_irq unsigned  irq  )  [inline, static]
 

Enable an IRQ source.

The above function allow you to manipulate the PIC at hand, but you must know what you are doing. Such a duty does not pertain to this manual and you should refer to your PIC datasheet.

Note that Linux has the same functions, but they must be used only for its interrupts. Only the above ones can be safely used in real time handlers.

It must also be remarked that when you install a real time interrupt handler, RTAI already calls either rt_mask_and_ack_irq(), for level triggered interrupts, or rt_ack_irq(), for edge triggered interrupts, before passing control to you interrupt handler. hus generally you should just call rt_unmask_irq() at due time, for level triggered interrupts, while nothing should be done for edge triggered ones. Recall that in the latter case you allow also any new interrupts on the same request as soon as you enable interrupts at the CPU level.

Often some of the above functions do equivalent things. Once more there is no way of doing it right except by knowing the hardware you are manipulating. Furthermore you must also remember that when you install a hard real time handler the related interrupt is usually disabled, unless you are overtaking one already owned by Linux which has been enabled by it. Recall that if have done it right, and interrupts do not show up, it is likely you have just to rt_enable_irq() your irq. Definition at line 338 of file hal.c.

References __adeos_std_irq_dtype, BEGIN_PIC, cpuid, END_PIC, and flags.

Referenced by rt_ack_irq(), rt_enable_irq(), and rt_unmask_irq().

void _rt_end_irq unsigned  irq  )  [inline, static]
 

Unmask and IRQ source.

The related request can then interrupt the CPU again, provided it has also been acknowledged.

The above function allow you to manipulate the PIC at hand, but you must know what you are doing. Such a duty does not pertain to this manual and you should refer to your PIC datasheet.

Note that Linux has the same functions, but they must be used only for its interrupts. Only the above ones can be safely used in real time handlers.

It must also be remarked that when you install a real time interrupt handler, RTAI already calls either rt_mask_and_ack_irq(), for level triggered interrupts, or rt_ack_irq(), for edge triggered interrupts, before passing control to you interrupt handler. hus generally you should just call rt_unmask_irq() at due time, for level triggered interrupts, while nothing should be done for edge triggered ones. Recall that in the latter case you allow also any new interrupts on the same request as soon as you enable interrupts at the CPU level.

Often some of the above functions do equivalent things. Once more there is no way of doing it right except by knowing the hardware you are manipulating. Furthermore you must also remember that when you install a hard real time handler the related interrupt is usually disabled, unless you are overtaking one already owned by Linux which has been enabled by it. Recall that if have done it right, and interrupts do not show up, it is likely you have just to rt_enable_irq() your irq. Definition at line 458 of file hal.c.

References __adeos_std_irq_dtype, BEGIN_PIC, cpuid, END_PIC, and flags.

Referenced by rt_unmask_irq().

EXPORT_SYMBOL rt_scheduling   ) 
 

EXPORT_SYMBOL rtai_lxrt_invoke_entry   ) 
 

EXPORT_SYMBOL ll2a   ) 
 

EXPORT_SYMBOL rt_printk   ) 
 

EXPORT_SYMBOL rt_smp_times   ) 
 

EXPORT_SYMBOL rt_times   ) 
 

EXPORT_SYMBOL rtai_cpu_realtime   ) 
 

EXPORT_SYMBOL rtai_cpu_lock   ) 
 

EXPORT_SYMBOL rtai_tunables   ) 
 

EXPORT_SYMBOL rtai_proc_root   ) 
 

EXPORT_SYMBOL rtai_domain   ) 
 

EXPORT_SYMBOL rtai_linux_context   ) 
 

EXPORT_SYMBOL rtai_set_linux_task_priority   ) 
 

EXPORT_SYMBOL rtai_critical_exit   ) 
 

EXPORT_SYMBOL rtai_critical_enter   ) 
 

EXPORT_SYMBOL rt_set_ihook   ) 
 

EXPORT_SYMBOL rt_free_timer   ) 
 

EXPORT_SYMBOL rt_request_timer   ) 
 

EXPORT_SYMBOL rt_request_apic_timers   ) 
 

EXPORT_SYMBOL rt_reset_irq_to_sym_mode   ) 
 

EXPORT_SYMBOL rt_assign_irq_to_cpu   ) 
 

EXPORT_SYMBOL rt_pend_linux_srq   ) 
 

EXPORT_SYMBOL rt_free_srq   ) 
 

EXPORT_SYMBOL rt_request_srq   ) 
 

EXPORT_SYMBOL rt_pend_linux_irq   ) 
 

EXPORT_SYMBOL rt_free_linux_irq   ) 
 

EXPORT_SYMBOL rt_request_linux_irq   ) 
 

EXPORT_SYMBOL rt_ack_irq   ) 
 

EXPORT_SYMBOL rt_unmask_irq   ) 
 

EXPORT_SYMBOL rt_mask_and_ack_irq   ) 
 

EXPORT_SYMBOL rt_disable_irq   ) 
 

EXPORT_SYMBOL rt_enable_irq   ) 
 

EXPORT_SYMBOL rt_shutdown_irq   ) 
 

EXPORT_SYMBOL rt_startup_irq   ) 
 

EXPORT_SYMBOL rt_set_irq_retmode   ) 
 

EXPORT_SYMBOL rt_set_irq_cookie   ) 
 

EXPORT_SYMBOL rt_release_irq   ) 
 

EXPORT_SYMBOL rt_request_irq   ) 
 

EXPORT_SYMBOL rtai_realtime_irq   ) 
 

__inline__ unsigned long ffnz unsigned long  word  )  [static]
 

Definition at line 60 of file rtai_hal.h.

void* ll2a long long  ll,
char *  s
 

Definition at line 1385 of file hal.c.

References LOW, and rtai_ulldiv().

Here is the call graph for this function:

module_exit __rtai_hal_exit   ) 
 

module_init __rtai_hal_init   ) 
 

MODULE_LICENSE "GPL"   ) 
 

MODULE_PARM rtai_cpufreq_arg  ,
"i" 
 

void rt_ack_irq unsigned  irq  ) 
 

Acknowledge an IRQ source.

The related request can then interrupt the CPU again, provided it has not been masked.

The above function allow you to manipulate the PIC at hand, but you must know what you are doing. Such a duty does not pertain to this manual and you should refer to your PIC datasheet.

Note that Linux has the same functions, but they must be used only for its interrupts. Only the above ones can be safely used in real time handlers.

It must also be remarked that when you install a real time interrupt handler, RTAI already calls either rt_mask_and_ack_irq(), for level triggered interrupts, or rt_ack_irq(), for edge triggered interrupts, before passing control to you interrupt handler. hus generally you should just call rt_unmask_irq() at due time, for level triggered interrupts, while nothing should be done for edge triggered ones. Recall that in the latter case you allow also any new interrupts on the same request as soon as you enable interrupts at the CPU level.

Often some of the above functions do equivalent things. Once more there is no way of doing it right except by knowing the hardware you are manipulating. Furthermore you must also remember that when you install a hard real time handler the related interrupt is usually disabled, unless you are overtaking one already owned by Linux which has been enabled by it. Recall that if have done it right, and interrupts do not show up, it is likely you have just to rt_enable_irq() your irq. Definition at line 510 of file hal.c.

References _rt_enable_irq().

Here is the call graph for this function:

int rt_assign_irq_to_cpu int  irq,
unsigned long  cpus_mask
 

Definition at line 735 of file hal.c.

Referenced by rt_request_irq_task(), and user_srq().

void rt_disable_irq unsigned  irq  ) 
 

Disable an IRQ source.

The above function allow you to manipulate the PIC at hand, but you must know what you are doing. Such a duty does not pertain to this manual and you should refer to your PIC datasheet.

Note that Linux has the same functions, but they must be used only for its interrupts. Only the above ones can be safely used in real time handlers.

It must also be remarked that when you install a real time interrupt handler, RTAI already calls either rt_mask_and_ack_irq(), for level triggered interrupts, or rt_ack_irq(), for edge triggered interrupts, before passing control to you interrupt handler. hus generally you should just call rt_unmask_irq() at due time, for level triggered interrupts, while nothing should be done for edge triggered ones. Recall that in the latter case you allow also any new interrupts on the same request as soon as you enable interrupts at the CPU level.

Often some of the above functions do equivalent things. Once more there is no way of doing it right except by knowing the hardware you are manipulating. Furthermore you must also remember that when you install a hard real time handler the related interrupt is usually disabled, unless you are overtaking one already owned by Linux which has been enabled by it. Recall that if have done it right, and interrupts do not show up, it is likely you have just to rt_enable_irq() your irq. Definition at line 381 of file hal.c.

References __adeos_std_irq_dtype, BEGIN_PIC, cpuid, END_PIC, and flags.

void rt_enable_irq unsigned  irq  ) 
 

Definition at line 349 of file hal.c.

References _rt_enable_irq().

Here is the call graph for this function:

int rt_free_linux_irq unsigned  irq,
void *  dev_id
 

Uninstall shared Linux interrupt handler.

Parameters:
dev_id is to pass to the interrupt handler, in the same way as the standard Linux irq request call.
irq is the IRQ level of the interrupt handler to be freed.
Return values:
0 on success.
EINVAL if irq is not a valid IRQ number.
Definition at line 581 of file hal.c.

References flags, rtai_linux_irq, rtai_restore_flags, and rtai_save_flags_and_cli.

Referenced by stop_rt_timer().

int rt_free_srq unsigned  srq  ) 
 

Uninstall a system request handler.

rt_free_srq uninstalls the specified system call srq, returned by installing the related handler with a previous call to rt_request_srq().

Return values:
EINVAL if srq is invalid.
Definition at line 683 of file hal.c.

References rtai_sysreq_map, and srq.

Referenced by __rtai_lxrt_exit(), __rtai_lxrt_init(), __rtai_netrpc_exit(), cleanup_module(), cleanup_softrtnet(), and init_softrtnet().

void rt_free_timer void   ) 
 

Uninstall a timer interrupt handler.

rt_free_timer uninstalls a timer previously set by rt_request_timer(). Definition at line 819 of file hal.c.

References flags, rt_release_irq(), rtai_critical_enter(), rtai_critical_exit(), rtai_critical_sync, and TRACE_RTAI_TIMER.

Here is the call graph for this function:

void rt_mask_and_ack_irq unsigned  irq  ) 
 

Mask and acknowledge and IRQ source.

No * other interrupts can be accepted, once also the CPU will enable interrupts, which ones depends on the PIC at hand and on how it is programmed.

The above function allow you to manipulate the PIC at hand, but you must know what you are doing. Such a duty does not pertain to this manual and you should refer to your PIC datasheet.

Note that Linux has the same functions, but they must be used only for its interrupts. Only the above ones can be safely used in real time handlers.

It must also be remarked that when you install a real time interrupt handler, RTAI already calls either rt_mask_and_ack_irq(), for level triggered interrupts, or rt_ack_irq(), for edge triggered interrupts, before passing control to you interrupt handler. hus generally you should just call rt_unmask_irq() at due time, for level triggered interrupts, while nothing should be done for edge triggered ones. Recall that in the latter case you allow also any new interrupts on the same request as soon as you enable interrupts at the CPU level.

Often some of the above functions do equivalent things. Once more there is no way of doing it right except by knowing the hardware you are manipulating. Furthermore you must also remember that when you install a hard real time handler the related interrupt is usually disabled, unless you are overtaking one already owned by Linux which has been enabled by it. Recall that if have done it right, and interrupts do not show up, it is likely you have just to rt_enable_irq() your irq. Definition at line 423 of file hal.c.

void rt_pend_linux_irq unsigned  irq  ) 
 

Pend an IRQ to Linux.

rt_pend_linux_irq appends a Linux interrupt irq for processing in Linux IRQ mode, i.e. with hardware interrupts fully enabled.

Note:
rt_pend_linux_irq does not perform any check on irq.
Definition at line 623 of file hal.c.

References adeos_pend_irq.

void rt_pend_linux_srq unsigned  srq  ) 
 

Append a Linux IRQ.

rt_pend_linux_srq appends a system call request srq to be used as a service request to the Linux kernel.

Parameters:
srq is the value returned by rt_request_srq.
Note:
rt_pend_linux_srq does not perform any check on irq.
Definition at line 698 of file hal.c.

References adeos_pend_irq, rtai_sysreq_pending, rtai_sysreq_virq, and srq.

Referenced by clr_rtext(), rt_printk(), rt_send_req_rel_port(), and soft_rt_sendto().

int rt_printk const char *  fmt,
  ...
 

Definition at line 1337 of file hal.c.

References buf, buf_front, flags, PRINTK_BUF_SIZE, rt_pend_linux_srq(), rt_printk_buf, RT_PRINTK_SRQ, rt_spin_lock_irqsave(), and rt_spin_unlock_irqrestore.

Here is the call graph for this function:

void rt_printk_srq_handler void   )  [static]
 

Definition at line 1363 of file hal.c.

References buf_back, buf_front, printk(), PRINTK_BUF_SIZE, and rt_printk_buf.

Referenced by __rtai_hal_init().

Here is the call graph for this function:

int rt_release_irq unsigned  irq  ) 
 

Definition at line 186 of file hal.c.

References flags, rtai_critical_enter(), rtai_critical_exit(), RTAI_NR_IRQS, and rtai_realtime_irq.

Referenced by rt_free_timer(), rt_release_irq_task(), and rt_request_timer().

Here is the call graph for this function:

void rt_request_apic_timers void(*  handler)(void),
struct apic_timer_setup_data *  tmdata
 

Definition at line 723 of file hal.c.

int rt_request_irq unsigned  irq,
int(*  handler)(unsigned irq, void *cookie),
void *  cookie,
int  retmode
 

Definition at line 164 of file hal.c.

References cookie, flags, handler, retmode, rtai_critical_enter(), rtai_critical_exit(), RTAI_NR_IRQS, and rtai_realtime_irq.

Referenced by rt_request_irq_task(), and rt_request_timer().

Here is the call graph for this function:

int rt_request_linux_irq unsigned  irq,
irqreturn_t(*  handler)(int irq, void *dev_id, struct pt_regs *regs),
char *  name,
void *  dev_id
 

Install shared Linux interrupt handler.

rt_request_linux_irq installs function handler as a standard Linux interrupt service routine for IRQ level irq forcing Linux to share the IRQ with other interrupt handlers, even if it does not want. The handler is appended to any already existing Linux handler for the same irq and is run by Linux irq as any of its handler. In this way a real time application can monitor Linux interrupts handling at its will. The handler appears in /proc/interrupts.

Parameters:
handler pointer on the interrupt service routine to be installed.
name is a name for /proc/interrupts.
dev_id is to pass to the interrupt handler, in the same way as the standard Linux irq request call.
The interrupt service routine can be uninstalled with rt_free_linux_irq().

Return values:
0 on success.
EINVAL if irq is not a valid IRQ number or handler is NULL.
EBUSY if there is already a handler of interrupt irq.
Definition at line 539 of file hal.c.

References flags, handler, rtai_linux_irq, rtai_restore_flags, and rtai_save_flags_and_cli.

Referenced by start_rt_timer().

int rt_request_srq unsigned  label,
void(*  k_handler)(void),
long long(*  u_handler)(unsigned)
 

Install a system request handler.

rt_request_srq installs a two way RTAI system request (srq) by assigning u_handler, a function to be used when a user calls srq from user space, and k_handler, the function to be called in kernel space following its activation by a call to rt_pend_linux_srq(). k_handler is in practice used to request a service from the kernel. In fact Linux system requests cannot be used safely from RTAI so you can setup a handler that receives real time requests and safely executes them when Linux is running.

Parameters:
u_handler can be used to effectively enter kernel space without the overhead and clumsiness of standard Unix/Linux protocols. This is very flexible service that allows you to personalize your use of RTAI.
Returns:
the number of the assigned system request on success.
Return values:
EINVAL if k_handler is NULL.
EBUSY if no free srq slot is available.
Definition at line 647 of file hal.c.

References flags, k_handler, label, rtai_restore_flags, rtai_save_flags_and_cli, rtai_sysreq_map, rtai_sysreq_table, srq, and u_handler.

Referenced by __rtai_lxrt_init(), __rtai_netrpc_init(), init_module(), and init_softrtnet().

int rt_request_timer void(*  handler)(void),
unsigned  tick,
int  use_apic
 

Install a timer interrupt handler.

rt_request_timer requests a timer of period tick ticks, and installs the routine handler as a real time interrupt service routine for the timer.

Set tick to 0 for oneshot mode (in oneshot mode it is not used). If apic has a nonzero value the local APIC timer is used. Otherwise timing is based on the 8254. Definition at line 763 of file hal.c.

References flags, handler, rt_release_irq(), rt_request_irq(), rt_set_timer_delay, rt_times, rtai_critical_enter(), rtai_critical_exit(), rtai_critical_sync, rtai_rdtsc, rtai_sync_level, and TRACE_RTAI_TIMER.

Referenced by start_rt_timer(), and user_srq().

Here is the call graph for this function:

void rt_request_timer_cpuid void(*  handler)(void),
unsigned  tick,
int  cpuid
 

Definition at line 745 of file hal.c.

int rt_reset_irq_to_sym_mode int  irq  ) 
 

Definition at line 740 of file hal.c.

Referenced by rt_release_irq_task(), and user_srq().

void(*)(int) rt_set_ihook  ) 
 

Definition at line 1114 of file hal.c.

References rtai_isr_hook.

Referenced by __rtai_lxrt_exit(), and __rtai_lxrt_init().

void rt_set_irq_cookie unsigned  irq,
void *  cookie
 

Definition at line 202 of file hal.c.

References cookie, RTAI_NR_IRQS, and rtai_realtime_irq.

void rt_set_irq_retmode unsigned  irq,
int  retmode
 

Definition at line 209 of file hal.c.

References retmode, RTAI_NR_IRQS, and rtai_realtime_irq.

void rt_shutdown_irq unsigned  irq  ) 
 

Shut down an IRQ source.

No further interrupt request irq can be accepted.

The above function allow you to manipulate the PIC at hand, but you must know what you are doing. Such a duty does not pertain to this manual and you should refer to your PIC datasheet.

Note that Linux has the same functions, but they must be used only for its interrupts. Only the above ones can be safely used in real time handlers.

It must also be remarked that when you install a real time interrupt handler, RTAI already calls either rt_mask_and_ack_irq(), for level triggered interrupts, or rt_ack_irq(), for edge triggered interrupts, before passing control to you interrupt handler. hus generally you should just call rt_unmask_irq() at due time, for level triggered interrupts, while nothing should be done for edge triggered ones. Recall that in the latter case you allow also any new interrupts on the same request as soon as you enable interrupts at the CPU level.

Often some of the above functions do equivalent things. Once more there is no way of doing it right except by knowing the hardware you are manipulating. Furthermore you must also remember that when you install a hard real time handler the related interrupt is usually disabled, unless you are overtaking one already owned by Linux which has been enabled by it. Recall that if have done it right, and interrupts do not show up, it is likely you have just to rt_enable_irq() your irq. Definition at line 300 of file hal.c.

References __adeos_std_irq_dtype, BEGIN_PIC, cpuid, END_PIC, and flags.

void rt_unmask_irq unsigned  irq  ) 
 

Definition at line 471 of file hal.c.

References _rt_enable_irq(), and _rt_end_irq().

Here is the call graph for this function:

void rtai_broadcast_to_timers int  irq,
void *  dev_id,
struct pt_regs *  regs
 

Definition at line 714 of file hal.c.

unsigned long rtai_critical_enter void(*  synch)(void)  ) 
 

Definition at line 146 of file hal.c.

References atomic_dec_and_test, flags, printk(), rtai_sync_count, and rtai_sync_level.

Referenced by __rtai_hal_exit(), __rtai_hal_init(), lxrt_exit(), rt_free_timer(), rt_release_irq(), rt_request_irq(), rt_request_timer(), and rtai_uninstall_archdep().

Here is the call graph for this function:

void rtai_critical_exit unsigned long  flags  ) 
 

Definition at line 158 of file hal.c.

References atomic_inc(), flags, and rtai_sync_count.

Referenced by __rtai_hal_exit(), __rtai_hal_init(), lxrt_exit(), rt_free_timer(), rt_release_irq(), rt_request_irq(), rt_request_timer(), and rtai_uninstall_archdep().

Here is the call graph for this function:

void rtai_domain_entry int  iflag  )  [static]
 

Definition at line 1229 of file hal.c.

References CONFIG_RTAI_COMPILER, and rt_printk().

Referenced by __rtai_hal_init().

Here is the call graph for this function:

int rtai_imuldiv int  i,
int  mult,
int  div
[inline, static]
 

Definition at line 99 of file rtai_hal.h.

void rtai_install_archdep void   )  [static]
 

Definition at line 1086 of file hal.c.

References printk(), rtai_cpufreq_arg, and rtai_tunables.

Referenced by __rtai_hal_init().

Here is the call graph for this function:

rtai_isr_hook cpuid   ) 
 

Referenced by rtai_irq_trampoline().

unsigned long long rtai_llimd unsigned long long  ull,
unsigned long  mult,
unsigned long  div
[inline, static]
 

Definition at line 107 of file rtai_hal.h.

References rtai_ulldiv(), and rtai_ullmul().

Referenced by rt_request_timer().

Here is the call graph for this function:

long long rtai_llimd long long  ll,
int  mult,
int  div
[inline, static]
 

Definition at line 114 of file rtai_hal.h.

rtai_save_and_lock_preempt_count  ) 
 

start and initialize the PIC to accept interrupt request irq.

The above function allow you to manipulate the PIC at hand, but you must know what you are doing. Such a duty does not pertain to this manual and you should refer to your PIC datasheet.

Note that Linux has the same functions, but they must be used only for its interrupts. Only the above ones can be safely used in real time handlers.

It must also be remarked that when you install a real time interrupt handler, RTAI already calls either rt_mask_and_ack_irq(), for level triggered interrupts, or rt_ack_irq(), for edge triggered interrupts, before passing control to you interrupt handler. hus generally you should just call rt_unmask_irq() at due time, for level triggered interrupts, while nothing should be done for edge triggered ones. Recall that in the latter case you allow also any new interrupts on the same request as soon as you enable interrupts at the CPU level.

Often some of the above functions do equivalent things. Once more there is no way of doing it right except by knowing the hardware you are manipulating. Furthermore you must also remember that when you install a hard real time handler the related interrupt is usually disabled, unless you are overtaking one already owned by Linux which has been enabled by it. Recall that if have done it right, and interrupts do not show up, it is likely you have just to rt_enable_irq() your irq. Definition at line 224 of file hal.c.

References cpuid, and END_PIC.

void rtai_ssrq_trampoline unsigned  virq  )  [static]
 

Definition at line 1021 of file hal.c.

References ffnz(), rtai_ssrq_lock, rtai_sysreq_map, rtai_sysreq_pending, rtai_sysreq_running, rtai_sysreq_table, and srq.

Referenced by __rtai_hal_init().

Here is the call graph for this function:

asmlinkage int rtai_syscall_entry struct pt_regs *  regs  ) 
 

Definition at line 1066 of file hal.c.

References rtai_lxrt_invoke_entry, rtai_usrq_trampoline(), and srq.

Here is the call graph for this function:

unsigned long long rtai_u64div32c unsigned long long  a,
unsigned long  b,
int *  r
[inline, static]
 

Definition at line 150 of file rtai_hal.h.

unsigned long long rtai_ulldiv unsigned long long  ull,
unsigned long  uld,
unsigned long *  r
[inline, static]
 

Definition at line 69 of file rtai_hal.h.

unsigned long long rtai_ullmul unsigned long  m0,
unsigned long  m1
[inline, static]
 

Definition at line 60 of file rtai_hal.h.

Referenced by rtai_llimd().

void rtai_uninstall_archdep void   )  [static]
 

Definition at line 1104 of file hal.c.

References flags, rtai_critical_enter(), and rtai_critical_exit().

Referenced by __rtai_hal_exit().

Here is the call graph for this function:

long long rtai_usrq_trampoline unsigned  srq,
unsigned  label
[inline, static]
 

Definition at line 1042 of file hal.c.

References label, rtai_sysreq_map, rtai_sysreq_table, srq, TRACE_RTAI_SRQ_ENTRY, and TRACE_RTAI_SRQ_EXIT.

Referenced by rtai_syscall_entry(), and rtai_syscall_trampoline().

while  ) 
 

Definition at line 863 of file hal.c.


Variable Documentation

struct hw_interrupt_type __adeos_std_irq_dtype[]
 

Referenced by _rt_enable_irq(), _rt_end_irq(), rt_disable_irq(), and rt_shutdown_irq().

void* adeos_extern_irq_handler
 

Referenced by __rtai_hal_exit(), and __rtai_hal_init().

unsigned long adeos_pended [static]
 

Definition at line 605 of file hal.c.

char buf[TEMP_BUF_SIZE] [static]
 

Definition at line 1335 of file hal.c.

Referenced by rt_printk().

int buf_back [static]
 

Definition at line 1334 of file hal.c.

Referenced by rt_printk_srq_handler().

int buf_front [static]
 

Definition at line 1334 of file hal.c.

Referenced by rt_printk(), and rt_printk_srq_handler().

void* { ... } cookie [inherited]
 

Definition at line 93 of file hal.c.

int { ... } count [inherited]
 

Definition at line 99 of file hal.c.

unsigned { ... } flags [inherited]
 

Definition at line 98 of file hal.c.

int(* { ... } handler)(unsigned irq, void *cookie) [inherited]
 

struct desc_struct idt_table[]
 

void(* { ... } k_handler)(void) [inherited]
 

unsigned { ... } label [inherited]
 

Definition at line 105 of file hal.c.

volatile { ... } locked [inherited]
 

Definition at line 79 of file hal.c.

int { ... } retmode [inherited]
 

Definition at line 94 of file hal.c.

volatile { ... } rqsted [inherited]
 

Definition at line 79 of file hal.c.

char rt_printk_buf[PRINTK_BUF_SIZE] [static]
 

Definition at line 1332 of file hal.c.

Referenced by rt_printk(), and rt_printk_srq_handler().

struct { ... } rt_scheduling[RTAI_NR_CPUS]
 

struct rt_times rt_smp_times[RTAI_NR_CPUS] = { { 0 } }
 

Definition at line 134 of file hal.c.

struct rt_times rt_times = { 0 }
 

Definition at line 132 of file hal.c.

int rtai_adeos_ptdbase = -1
 

Definition at line 144 of file hal.c.

volatile unsigned long rtai_cpu_lock = 0
 

Definition at line 142 of file hal.c.

volatile unsigned long rtai_cpu_realtime = 0
 

Definition at line 140 of file hal.c.

unsigned long rtai_cpufreq_arg = RTAI_CALIBRATED_CPU_FREQ [static]
 

Definition at line 72 of file hal.c.

Referenced by rtai_install_archdep().

adomain_t rtai_domain
 

Definition at line 87 of file hal.c.

void(* rtai_isr_hook)(int cpuid) [static]
 

Definition at line 82 of file hal.c.

Referenced by rt_set_ihook().

struct rtai_switch_data rtai_linux_context[RTAI_NR_CPUS] = { { 0 } }
 

Definition at line 136 of file hal.c.

struct { ... } rtai_linux_irq[NR_IRQS] [static]
 

Referenced by rt_free_linux_irq(), and rt_request_linux_irq().

long long(* rtai_lxrt_invoke_entry)(unsigned long, unsigned long)
 

Definition at line 1064 of file hal.c.

Referenced by rtai_syscall_entry(), and rtai_syscall_trampoline().

struct { ... } rtai_realtime_irq[RTAI_NR_IRQS]
 

Referenced by rt_irq_signal(), rt_irq_wait(), rt_irq_wait_if(), rt_irq_wait_until(), rt_release_irq(), rt_release_irq_task(), rt_request_irq(), rt_set_irq_cookie(), rt_set_irq_retmode(), and rtai_irq_trampoline().

spinlock_t rtai_ssrq_lock = SPIN_LOCK_UNLOCKED [static]
 

Definition at line 116 of file hal.c.

Referenced by rtai_ssrq_trampoline().

atomic_t rtai_sync_count = ATOMIC_INIT(1) [static]
 

Definition at line 120 of file hal.c.

Referenced by rtai_critical_enter(), and rtai_critical_exit().

volatile int rtai_sync_level [static]
 

Definition at line 118 of file hal.c.

Referenced by rt_request_timer(), and rtai_critical_enter().

unsigned long rtai_sysreq_map = 3 [static]
 

Definition at line 110 of file hal.c.

Referenced by __rtai_hal_exit(), __rtai_hal_init(), rt_free_srq(), rt_request_srq(), rtai_ssrq_trampoline(), and rtai_usrq_trampoline().

unsigned long rtai_sysreq_pending [static]
 

Definition at line 112 of file hal.c.

Referenced by rt_pend_linux_srq(), and rtai_ssrq_trampoline().

unsigned long rtai_sysreq_running [static]
 

Definition at line 114 of file hal.c.

Referenced by rtai_ssrq_trampoline().

struct { ... } rtai_sysreq_table[RTAI_NR_SRQS] [static]
 

Referenced by __rtai_hal_init(), rt_request_srq(), rtai_ssrq_trampoline(), and rtai_usrq_trampoline().

unsigned rtai_sysreq_virq [static]
 

Definition at line 108 of file hal.c.

Referenced by __rtai_hal_exit(), __rtai_hal_init(), and rt_pend_linux_srq().

struct calibration_data rtai_tunables = { 0 }
 

Definition at line 138 of file hal.c.

long { ... } u_handler)(unsigned) [inherited]
 


Generated on Thu Nov 20 11:57:53 2008 for RTAI API by doxygen 1.3.8