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  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.
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 INCLUDED_BY_HAL_C
#define CHECK_STACK_IN_IRQ   0
#define __RTAI_HAL__
#define RTAI_NR_IRQS   IPIPE_NR_XIRQS
#define rtai_setup_periodic_apic(count, vector)
#define rtai_setup_oneshot_apic(count, vector)
#define __ack_APIC_irq()
#define rtai_irq_desc(irq)   (irq_desc[irq].chip)
#define BEGIN_PIC()
#define END_PIC()
#define hal_lock_irq(x, y, z)
#define hal_unlock_irq(x, y)
#define REQUEST_LINUX_IRQ_BROADCAST_TO_APIC_TIMERS()   0
#define FREE_LINUX_IRQ_BROADCAST_TO_APIC_TIMERS()   ;
#define RTAI_SCHED_ISR_LOCK()
#define RTAI_SCHED_ISR_UNLOCK()
#define HAL_TICK_REGS   hal_tick_regs[cpuid]
#define HAL_LOCK_LINUX()   do { sflags = rt_save_switch_to_real_time(cpuid); } while (0)
#define HAL_UNLOCK_LINUX()   do { rtai_cli(); rt_restore_switch_to_linux(sflags, cpuid); } while (0)
#define __STR(x)   #x
#define STR(x)   __STR(x)
#define SYMBOL_NAME_STR(X)   #X
#define SAVE_REG
#define RSTR_REG
#define DEFINE_VECTORED_ISR(name, fun)
#define rtai_critical_sync   NULL
#define CHECK_KERCTX()   ;
#define HINT_DIAG_MSG(x)
#define INCLUDED_BY_HAL_C
#define RTAI_SYSCALL_MODE
#define RTAI_DUOSS
#define LOCKED_LINUX_IN_IRQ_HANDLER
#define DOMAIN_TO_STALL   (fusion_domain)
#define RTAI_NR_CPUS   1
#define do_div(n, base)
#define RTAI_DEFAULT_TICK   100000
#define RTAI_DEFAULT_STACKSZ   1024
#define RTAI_SYSCALL_MODE
#define RTAI_DUOSS
#define LOCKED_LINUX_IN_IRQ_HANDLER
#define DOMAIN_TO_STALL   (fusion_domain)
#define RTAI_NR_CPUS   1
#define do_div(n, base)
#define RTAI_DEFAULT_TICK   100000
#define RTAI_DEFAULT_STACKSZ   1024
#define RTAI_SYSCALL_MODE
#define RTAI_DUOSS
#define LOCKED_LINUX_IN_IRQ_HANDLER
#define DOMAIN_TO_STALL   (fusion_domain)
#define RTAI_NR_CPUS   1
#define FIRST_EXTERNAL_VECTOR   0x40
#define RTAI_DEFAULT_TICK   100000
#define RTAI_DEFAULT_STACKSZ   1024
#define RTAI_SYSCALL_MODE
#define LOCKED_LINUX_IN_IRQ_HANDLER
#define UNWRAPPED_CATCH_EVENT
#define RTAI_NR_CPUS   1
#define RTAI_DEFAULT_TICK   100000
#define RTAI_DEFAULT_STACKSZ   1024

Functions

 MODULE_LICENSE ("GPL")
 RTAI_MODULE_PARM (rtai_cpufreq_arg, ulong)
unsigned long rtai_critical_enter (void(*synch)(void))
void rtai_critical_exit (unsigned long flags)
 RTAI_MODULE_PARM (IsolCpusMask, ulong)
int rt_request_irq (unsigned irq, int(*handler)(unsigned irq, void *cookie), void *cookie, int retmode)
int rt_release_irq (unsigned irq)
int rt_ack_tmr (unsigned int irq)
int rt_ack_uart (unsigned int irq)
int rt_set_irq_ack (unsigned irq, int(*irq_ack)(unsigned int))
void rt_set_irq_cookie (unsigned irq, void *cookie)
void rt_set_irq_retmode (unsigned irq, int retmode)
unsigned rt_startup_irq (unsigned irq)
 start and initialize the PIC to accept interrupt request irq.
void rt_shutdown_irq (unsigned irq)
 Shut down an IRQ source.
static void _rt_enable_irq (unsigned irq)
void rt_enable_irq (unsigned irq)
 Enable an IRQ source.
void rt_disable_irq (unsigned irq)
 Disable an IRQ source.
void rt_mask_and_ack_irq (unsigned irq)
 Mask and acknowledge and IRQ source.
static void _rt_end_irq (unsigned irq)
void rt_unmask_irq (unsigned irq)
 Unmask and IRQ source.
void rt_ack_irq (unsigned irq)
 Acknowledge an IRQ source.
void rt_end_irq (unsigned irq)
void rt_eoi_irq (unsigned irq)
int rt_request_linux_irq (unsigned irq, void *handler, 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.
RTAI_SYSCALL_MODE void usr_rt_pend_linux_irq (unsigned irq)
int rt_request_srq (unsigned label, void(*k_handler)(void), long long(*u_handler)(unsigned long))
 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.
irqreturn_t rtai_broadcast_to_local_timers (int irq, void *dev_id, struct pt_regs *regs)
int rt_assign_irq_to_cpu (int irq, unsigned long cpus_mask)
int rt_reset_irq_to_sym_mode (int irq)
void mcf_settimericr (int timer, int level)
int rt_request_timer (void(*handler)(void), unsigned tick, int unused)
 Install a timer interrupt handler.
void rt_free_timer (void)
 Uninstall a timer interrupt handler.
long long rdtsc ()
RT_TRAP_HANDLER rt_set_trap_handler (RT_TRAP_HANDLER handler)
int rtai_8254_timer_handler (struct pt_regs regs)
static int rtai_hirq_dispatcher (unsigned irq, struct pt_regs *regs)
 RTAI_MODULE_PARM (PrintFpuTrap, int)
 RTAI_MODULE_PARM (PrintFpuInit, int)
static int rtai_trap_fault (unsigned event, void *evdata)
static void rtai_lsrq_dispatcher (unsigned virq)
static long long rtai_usrq_dispatcher (unsigned long srq, unsigned long label)
static int intercept_syscall_prologue (unsigned long event, struct pt_regs *regs)
int usi_SRQ_call (unsigned long srq, unsigned long args, long long *result, unsigned long lsr)
asmlinkage int rtai_syscall_dispatcher (__volatile struct pt_regs pt)
void rtai_uvec_handler (void)
 DEFINE_VECTORED_ISR (rtai_uvec_handler, rtai_syscall_dispatcher)
desc_struct rtai_set_gate_vector (unsigned vector, int type, int dpl, void *handler)
void rtai_cmpxchg_trap_handler (void)
 __asm__ ("rtai_cmpxchg_trap_handler:\n\t""move #0x2700,%sr\n\t""movel %a1@, %d0\n\t""cmpl %d0,%d2\n\t""bnes 1f\n\t""movel %d3,%a1@\n\t""1:\n\t""rte")
void rtai_xchg_trap_handler (void)
 __asm__ ("rtai_xchg_trap_handler:\n\t""move #0x2700,%sr\n\t""movel %a1@, %d0\n\t""movel %d2,%a1@\n\t""rte")
void rtai_reset_gate_vector (unsigned vector, struct desc_struct e)
static void rtai_install_archdep (void)
static void rtai_uninstall_archdep (void)
int rtai_calibrate_8254 (void)
void(*)(int) rt_set_ihook (void(*hookfn)(int))
void rtai_set_linux_task_priority (struct task_struct *task, int policy, int prio)
void ack_bad_irq (unsigned int irq)
int __rtai_hal_init (void)
void __rtai_hal_exit (void)
 module_init (__rtai_hal_init)
 module_exit (__rtai_hal_exit)
asmlinkage int rt_printk (const char *fmt,...)
asmlinkage int rt_sync_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_end_irq)
 EXPORT_SYMBOL (rt_eoi_irq)
 EXPORT_SYMBOL (rt_request_linux_irq)
 EXPORT_SYMBOL (rt_free_linux_irq)
 EXPORT_SYMBOL (rt_pend_linux_irq)
 EXPORT_SYMBOL (usr_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_timer)
 EXPORT_SYMBOL (rt_free_timer)
 EXPORT_SYMBOL (rdtsc)
 EXPORT_SYMBOL (rt_set_trap_handler)
 EXPORT_SYMBOL (rt_set_ihook)
 EXPORT_SYMBOL (rt_set_irq_ack)
 EXPORT_SYMBOL (rtai_calibrate_8254)
 EXPORT_SYMBOL (rtai_broadcast_to_local_timers)
 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 (rt_sync_printk)
 EXPORT_SYMBOL (ll2a)
 EXPORT_SYMBOL (rtai_set_gate_vector)
 EXPORT_SYMBOL (rtai_reset_gate_vector)
 EXPORT_SYMBOL (rtai_catch_event)
 EXPORT_SYMBOL (rtai_lxrt_dispatcher)
 EXPORT_SYMBOL (rt_scheduling)
static __inline__ unsigned
long 
ffnz (unsigned long word)
static unsigned long long rtai_ulldiv (unsigned long long ull, unsigned long uld, unsigned long *r)
static int rtai_imuldiv (int i, int mult, int div)
static long long rtai_llimd (long long ll, int mult, int div)
static unsigned long long rtai_u64div32c (unsigned long long a, unsigned long b, int *r)
static unsigned long long rtai_llimd (unsigned long long ll, unsigned int mult, unsigned int div)
static long rtai_imuldiv (long i, long mult, long div)
static long long rtai_llimd (long long ll, long mult, long div)

Variables

static unsigned long rtai_cpufreq_arg = CONFIG_CLOCK_FREQ
struct {
   volatile int   locked
   volatile int   rqsted
rt_scheduling [RTAI_NR_CPUS]
static void(*) rtai_isr_hook (int cpuid)
hal_domain_struct rtai_domain
rtai_realtime_irq_s rtai_realtime_irq [RTAI_NR_IRQS]
struct {
   unsigned long   flags
   int   count
rtai_linux_irq [RTAI_NR_IRQS]
struct {
   void(*   k_handler )(void)
   long long(*   u_handler )(unsigned long)
   unsigned long   label
rtai_sysreq_table [RTAI_NR_SRQS]
static unsigned rtai_sysreq_virq
static unsigned long rtai_sysreq_map = 1
static unsigned long rtai_sysreq_pending
static unsigned long rtai_sysreq_running
static spinlock_t rtai_lsrq_lock = SPIN_LOCK_UNLOCKED
static volatile int rtai_sync_level
static atomic_t rtai_sync_count = ATOMIC_INIT(1)
static struct desc_struct rtai_sysvec
static struct desc_struct rtai_cmpxchg_trap_vec
static struct desc_struct rtai_xchg_trap_vec
static RT_TRAP_HANDLER rtai_trap_handler
rt_times rt_times
rt_times rt_smp_times [RTAI_NR_CPUS]
rtai_switch_data rtai_linux_context [RTAI_NR_CPUS]
calibration_data rtai_tunables
volatile unsigned long rtai_cpu_realtime
volatile unsigned long rtai_cpu_lock [2]
unsigned long IsolCpusMask = 0
static int timer_inuse = 0
unsigned long io_apic_irqs
static int PrintFpuTrap = 0
static int PrintFpuInit = 0
long long(*) rtai_lxrt_dispatcher (unsigned long, unsigned long)
static int(*) sched_intercept_syscall_prologue (struct pt_regs *)
void * _ramvec
void * hal_irq_handler


Define Documentation

 
#define __ack_APIC_irq (  ) 

Definition at line 94 of file hal.c.

#define __RTAI_HAL__

Definition at line 71 of file hal.c.

#define __STR (  )     #x

Definition at line 789 of file hal.c.

 
#define BEGIN_PIC (  ) 

Definition at line 265 of file hal.c.

 
#define CHECK_KERCTX (  )     ;

Definition at line 947 of file hal.c.

#define CHECK_STACK_IN_IRQ   0

Definition at line 53 of file hal.c.

#define DEFINE_VECTORED_ISR ( name,
fun   ) 

Value:

__asm__ ( \
            SYMBOL_NAME_STR(name) ":\n\t" \
        SAVE_REG \
        "jsr "SYMBOL_NAME_STR(fun)"\n\t" \
        RSTR_REG);

Definition at line 848 of file hal.c.

#define do_div ( n,
base   ) 

Value:

({ \
        unsigned long __upper, __low, __high, __mod, __base; \
        __base = (base); \
        asm("":"=a" (__low), "=d" (__high):"A" (n)); \
        __upper = __high; \
        if (__high) { \
                __upper = __high % (__base); \
                __high = __high / (__base); \
        } \
        asm("divl %2":"=a" (__low), "=d" (__mod):"rm" (__base), "0" (__low), "1" (__upper)); \
        asm("":"=A" (n):"a" (__low),"d" (__high)); \
        __mod; \
})

Definition at line 166 of file rtai_hal.h.

#define do_div ( n,
base   ) 

Value:

({ \
        unsigned long __upper, __low, __high, __mod, __base; \
        __base = (base); \
        asm("":"=a" (__low), "=d" (__high):"A" (n)); \
        __upper = __high; \
        if (__high) { \
                __upper = __high % (__base); \
                __high = __high / (__base); \
        } \
        asm("divl %2":"=a" (__low), "=d" (__mod):"rm" (__base), "0" (__low), "1" (__upper)); \
        asm("":"=A" (n):"a" (__low),"d" (__high)); \
        __mod; \
})

Definition at line 166 of file rtai_hal.h.

Referenced by __rtai_generic_ulldiv(), and rtai_ulldiv().

#define DOMAIN_TO_STALL   (fusion_domain)

Definition at line 51 of file rtai_hal.h.

#define DOMAIN_TO_STALL   (fusion_domain)

Definition at line 54 of file rtai_hal.h.

#define DOMAIN_TO_STALL   (fusion_domain)

Definition at line 54 of file rtai_hal.h.

 
#define END_PIC (  ) 

Definition at line 266 of file hal.c.

#define FIRST_EXTERNAL_VECTOR   0x40

Definition at line 59 of file rtai_hal.h.

 
#define FREE_LINUX_IRQ_BROADCAST_TO_APIC_TIMERS (  )     ;

Definition at line 754 of file hal.c.

#define hal_lock_irq ( x,
y,
 ) 

Definition at line 269 of file hal.c.

Referenced by rt_disable_irq().

 
#define HAL_LOCK_LINUX (  )     do { sflags = rt_save_switch_to_real_time(cpuid); } while (0)

Definition at line 781 of file hal.c.

#define HAL_TICK_REGS   hal_tick_regs[cpuid]

Definition at line 778 of file hal.c.

#define hal_unlock_irq ( x,
 ) 

Definition at line 270 of file hal.c.

Referenced by _rt_enable_irq(), _rt_end_irq(), rt_ack_irq(), rt_enable_irq(), rt_eoi_irq(), and rt_startup_irq().

 
#define HAL_UNLOCK_LINUX (  )     do { rtai_cli(); rt_restore_switch_to_linux(sflags, cpuid); } while (0)

Definition at line 782 of file hal.c.

#define HINT_DIAG_MSG (  ) 

Definition at line 1035 of file hal.c.

Referenced by rtai_trap_fault().

#define INCLUDED_BY_HAL_C

Definition at line 47 of file hal.c.

#define INCLUDED_BY_HAL_C

Definition at line 51 of file hal.c.

#define INCLUDED_BY_HAL_C

Definition at line 250 of file hal.c.

#define LOCKED_LINUX_IN_IRQ_HANDLER

Definition at line 47 of file rtai_hal.h.

#define LOCKED_LINUX_IN_IRQ_HANDLER

Definition at line 50 of file rtai_hal.h.

#define LOCKED_LINUX_IN_IRQ_HANDLER

Definition at line 53 of file rtai_hal.h.

#define LOCKED_LINUX_IN_IRQ_HANDLER

Definition at line 53 of file rtai_hal.h.

 
#define REQUEST_LINUX_IRQ_BROADCAST_TO_APIC_TIMERS (  )     0

Definition at line 752 of file hal.c.

#define RSTR_REG

Value:

"btst   #5,%sp@(46)\n\t"                /* going user? (PT_SR=46)*/ \
       "bnes   8f\n\t"                         /* no, skip */ \
       "move   #0x2700,%sr\n\t"                /* disable intrs */ \
       "movel  sw_usp,%a0\n\t"                 /* get usp */ \
       "movel  %sp@(48),%a0@-\n\t"             /* copy exception program counter (PT_PC=48)*/ \
       "movel  %sp@(44),%a0@-\n\t"     /* copy exception format/vector/sr (PT_FORMATVEC=44)*/ \
       "moveml %sp@,%d1-%d5/%a0-%a2\n\t" \
       "lea    %sp@(32),%sp\n\t"               /* space for 8 regs */ \
       "movel  %sp@+,%d0\n\t" \
       "addql  #4,%sp\n\t"                     /* orig d0 */ \
       "addl   %sp@+,%sp\n\t"                  /* stkadj */ \
       "addql  #8,%sp\n\t"                     /* remove exception */ \
       "movel  %sp,sw_ksp\n\t"                 /* save ksp */ \
       "subql  #8,sw_usp\n\t"                  /* set exception */ \
       "movel  sw_usp,%sp\n\t"                 /* restore usp */ \
       "rte\n\t" \
       "8:\n\t" \
       "moveml %sp@,%d1-%d5/%a0-%a2\n\t" \
       "lea    %sp@(32),%sp\n\t"               /* space for 8 regs */ \
       "movel  %sp@+,%d0\n\t" \
       "addql  #4,%sp\n\t"                     /* orig d0 */ \
       "addl   %sp@+,%sp\n\t"                  /* stkadj */ \
       "rte"

Definition at line 823 of file hal.c.

#define rtai_critical_sync   NULL

Definition at line 855 of file hal.c.

#define RTAI_DEFAULT_STACKSZ   1024

Definition at line 920 of file rtai_hal.h.

#define RTAI_DEFAULT_STACKSZ   1024

Definition at line 635 of file rtai_hal.h.

#define RTAI_DEFAULT_STACKSZ   1024

Definition at line 1123 of file rtai_hal.h.

#define RTAI_DEFAULT_STACKSZ   1024

Definition at line 1123 of file rtai_hal.h.

#define RTAI_DEFAULT_TICK   100000

Definition at line 916 of file rtai_hal.h.

#define RTAI_DEFAULT_TICK   100000

Definition at line 631 of file rtai_hal.h.

#define RTAI_DEFAULT_TICK   100000

Definition at line 1119 of file rtai_hal.h.

#define RTAI_DEFAULT_TICK   100000

Definition at line 1119 of file rtai_hal.h.

#define RTAI_DUOSS

Definition at line 49 of file rtai_hal.h.

#define RTAI_DUOSS

Definition at line 49 of file rtai_hal.h.

#define RTAI_DUOSS

Definition at line 49 of file rtai_hal.h.

#define rtai_irq_desc ( irq   )     (irq_desc[irq].chip)

Definition at line 262 of file hal.c.

#define RTAI_NR_CPUS   1

Definition at line 57 of file rtai_hal.h.

#define RTAI_NR_CPUS   1

Definition at line 57 of file rtai_hal.h.

#define RTAI_NR_CPUS   1

Definition at line 63 of file rtai_hal.h.

#define RTAI_NR_CPUS   1

Definition at line 63 of file rtai_hal.h.

Referenced by __rtai_hal_init().

#define RTAI_NR_IRQS   IPIPE_NR_XIRQS

Definition at line 84 of file hal.c.

Referenced by __rtai_hal_init(), rt_free_linux_irq(), rt_release_irq(), rt_request_irq(), rt_request_linux_irq(), rt_set_irq_ack(), rt_set_irq_cookie(), rt_set_irq_retmode(), and rtai_hirq_dispatcher().

 
#define RTAI_SCHED_ISR_LOCK (  ) 

Value:

do { \
        if (!rt_scheduling[0].locked++) { \
            rt_scheduling[0].rqsted = 0; \
        } \
    } while (0)

Definition at line 757 of file hal.c.

 
#define RTAI_SCHED_ISR_UNLOCK (  ) 

Value:

do { \
        if (rt_scheduling[0].locked && !(--rt_scheduling[0].locked)) { \
            if (rt_scheduling[0].rqsted > 0 && rtai_isr_hook) { \
                rtai_isr_hook(0); \
                } \
        } \
    } while (0)

Definition at line 763 of file hal.c.

#define rtai_setup_oneshot_apic ( count,
vector   ) 

Definition at line 92 of file hal.c.

#define rtai_setup_periodic_apic ( count,
vector   ) 

Definition at line 90 of file hal.c.

#define RTAI_SYSCALL_MODE

Definition at line 45 of file rtai_hal.h.

#define RTAI_SYSCALL_MODE

Definition at line 46 of file rtai_hal.h.

#define RTAI_SYSCALL_MODE

Definition at line 46 of file rtai_hal.h.

#define RTAI_SYSCALL_MODE

Definition at line 46 of file rtai_hal.h.

Referenced by GENERIC_DELETE(), handle_lxrt_request(), lxrt_fun_call(), lxrt_Proxy_detach(), lxrt_spl_init(), lxrt_typed_mbx_init(), lxrt_typed_rwl_init(), lxrt_typed_sem_init(), and sched_sem_signal().

#define SAVE_REG

Value:

"move   #0x2700,%sr\n\t"                /* disable intrs */ \
       "btst   #5,%sp@(2)\n\t"                 /* from user? */ \
       "bnes   6f\n\t"                         /* no, skip */ \
       "movel  %sp,sw_usp\n\t"                 /* save user sp */ \
       "addql  #8,sw_usp\n\t"                  /* remove exception */ \
       "movel  sw_ksp,%sp\n\t"                 /* kernel sp */ \
       "subql  #8,%sp\n\t"                     /* room for exception */ \
       "clrl   %sp@-\n\t"                      /* stkadj */ \
       "movel  %d0,%sp@-\n\t"                  /* orig d0 */ \
       "movel  %d0,%sp@-\n\t"                  /* d0 */ \
       "lea    %sp@(-32),%sp\n\t"              /* space for 8 regs */ \
       "moveml %d1-%d5/%a0-%a2,%sp@\n\t" \
       "movel  sw_usp,%a0\n\t"                 /* get usp */ \
       "movel  %a0@-,%sp@(48)\n\t"             /* copy exception program counter (PT_PC=48)*/ \
       "movel  %a0@-,%sp@(44)\n\t"     /* copy exception format/vector/sr (PT_FORMATVEC=44)*/ \
       "bra    7f\n\t" \
       "6:\n\t" \
       "clrl   %sp@-\n\t"                      /* stkadj */ \
       "movel  %d0,%sp@-\n\t"                  /* orig d0 */ \
       "movel  %d0,%sp@-\n\t"                  /* d0 */ \
       "lea    %sp@(-32),%sp\n\t"              /* space for 8 regs */ \
       "moveml %d1-%d5/%a0-%a2,%sp@\n\t" \
       "7:\n\t" \
       "move   #0x2000,%sr\n\t"

Definition at line 797 of file hal.c.

#define STR (  )     __STR(x)

Definition at line 790 of file hal.c.

#define SYMBOL_NAME_STR (  )     #X

Definition at line 794 of file hal.c.

#define UNWRAPPED_CATCH_EVENT

Definition at line 48 of file rtai_hal.h.


Function Documentation

__asm__ ( "rtai_xchg_trap_handler:\n\t""move #  0x2700,
%sr\n\t""movel%a1 ,
%d0\n\t""movel%  d2,
%a1 @\n\t""rte"   
)

__asm__ ( "rtai_cmpxchg_trap_handler:\n\t""move #  0x2700,
%sr\n\t""movel%a1 ,
%d0\n\t""cmpl%  d0,
%d2\n\t""bnes 1f\n\t""movel%  d3,
%a1 @\n\t""1:\n\t""rte"   
)

Referenced by __cmpxchg_u32(), __rtai_lxrt(), atomic_add_return(), atomic_cmpxchg(), atomic_dec_and_test(), atomic_dec_return(), atomic_inc(), atomic_sub_return(), atomic_xchg(), ffnz(), rt_task_wait_period(), RTAI_DO_TRAP_SYS(), rtai_imuldiv(), rtai_llimd(), rtai_srq(), rtai_u64div32c(), rtai_ullmul(), and ullmul().

void __rtai_hal_exit ( void   ) 

Definition at line 1491 of file hal.c.

References hal_catch_event, hal_free_irq, HAL_NR_FAULTS, hal_root_domain, hal_unregister_domain, hal_virtualize_irq, printk(), rt_reset_irq_to_sym_mode(), rtai_domain, rtai_sysreq_virq, and rtai_uninstall_archdep().

Here is the call graph for this function:

int __rtai_hal_init ( void   ) 

Definition at line 1419 of file hal.c.

References hal_alloc_irq, hal_attr_struct, hal_catch_event, hal_domain_struct, hal_init_attr, HAL_NR_EVENTS, HAL_NR_FAULTS, hal_register_domain, hal_root_domain, HAL_TYPE, hal_virtualize_irq, ipipe_root_status, printk(), rtai_domain, rtai_domain_entry(), rtai_hirq_dispatcher(), rtai_install_archdep(), rtai_lsrq_dispatcher(), rtai_realtime_irq, rtai_sysreq_virq, and rtai_trap_fault().

Here is the call graph for this function:

static void _rt_enable_irq ( unsigned  irq  )  [inline, static]

Definition at line 355 of file hal.c.

References BEGIN_PIC, END_PIC, hal_root_domain, hal_unlock_irq, and rtai_irq_desc.

Referenced by rt_ack_irq(), and rt_enable_irq().

static void _rt_end_irq ( unsigned  irq  )  [inline, static]

Definition at line 472 of file hal.c.

References BEGIN_PIC, END_PIC, hal_root_domain, hal_unlock_irq, and rtai_irq_desc.

void ack_bad_irq ( unsigned int  irq  ) 

Definition at line 1414 of file hal.c.

References printk().

Here is the call graph for this function:

DEFINE_VECTORED_ISR ( rtai_uvec_handler  ,
rtai_syscall_dispatcher   
)

EXPORT_SYMBOL ( rt_scheduling   ) 

EXPORT_SYMBOL ( rtai_lxrt_dispatcher   ) 

EXPORT_SYMBOL ( rtai_catch_event   ) 

EXPORT_SYMBOL ( rtai_reset_gate_vector   ) 

EXPORT_SYMBOL ( rtai_set_gate_vector   ) 

EXPORT_SYMBOL ( ll2a   ) 

EXPORT_SYMBOL ( rt_sync_printk   ) 

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 ( rtai_broadcast_to_local_timers   ) 

EXPORT_SYMBOL ( rtai_calibrate_8254   ) 

EXPORT_SYMBOL ( rt_set_irq_ack   ) 

EXPORT_SYMBOL ( rt_set_ihook   ) 

EXPORT_SYMBOL ( rt_set_trap_handler   ) 

EXPORT_SYMBOL ( rdtsc   ) 

EXPORT_SYMBOL ( rt_free_timer   ) 

EXPORT_SYMBOL ( rt_request_timer   ) 

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 ( usr_rt_pend_linux_irq   ) 

EXPORT_SYMBOL ( rt_pend_linux_irq   ) 

EXPORT_SYMBOL ( rt_free_linux_irq   ) 

EXPORT_SYMBOL ( rt_request_linux_irq   ) 

EXPORT_SYMBOL ( rt_eoi_irq   ) 

EXPORT_SYMBOL ( rt_end_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   ) 

static __inline__ unsigned long ffnz ( unsigned long  word  )  [static]

Definition at line 67 of file rtai_hal.h.

References __asm__().

Referenced by __task_init(), rt_set_runnable_on_cpus(), and rtai_lsrq_dispatcher().

Here is the call graph for this function:

static int intercept_syscall_prologue ( unsigned long  event,
struct pt_regs *  regs 
) [static]

Definition at line 1180 of file hal.c.

References likely, rtai_lxrt_dispatcher, RTAI_SYSCALL_NR, rtai_usrq_dispatcher(), sched_intercept_syscall_prologue, and srq.

Here is the call graph for this function:

void* ll2a ( long long  ll,
char *  s 
)

Definition at line 1578 of file hal.c.

References rtai_ulldiv.

void mcf_settimericr ( int  timer,
int  level 
)

module_exit ( __rtai_hal_exit   ) 

module_init ( __rtai_hal_init   ) 

MODULE_LICENSE ( "GPL"   ) 

long long rdtsc (  ) 

Definition at line 937 of file hal.c.

References TIMER_FREQ, and tuned.

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 550 of file hal.c.

References _rt_enable_irq().

Here is the call graph for this function:

int rt_ack_tmr ( unsigned int  irq  ) 

Definition at line 220 of file hal.c.

Referenced by rt_request_timer().

int rt_ack_uart ( unsigned int  irq  ) 

Definition at line 230 of file hal.c.

int rt_assign_irq_to_cpu ( int  irq,
unsigned long  cpus_mask 
)

Definition at line 857 of file hal.c.

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 424 of file hal.c.

References BEGIN_PIC, END_PIC, hal_lock_irq, hal_root_domain, and rtai_irq_desc.

void rt_enable_irq ( unsigned  irq  ) 

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 392 of file hal.c.

References _rt_enable_irq().

Here is the call graph for this function:

void rt_end_irq ( unsigned  irq  ) 

Definition at line 555 of file hal.c.

References _rt_end_irq().

Here is the call graph for this function:

void rt_eoi_irq ( unsigned  irq  ) 

Definition at line 560 of file hal.c.

References BEGIN_PIC, END_PIC, hal_root_domain, hal_unlock_irq, and rtai_irq_desc.

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 631 of file hal.c.

References count, flags, rtai_linux_irq, RTAI_NR_IRQS, rtai_restore_flags, and rtai_save_flags_and_cli.

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 721 of file hal.c.

References rtai_sysreq_map.

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 923 of file hal.c.

References flags, rtai_restore_flags, rtai_save_flags_and_cli, and TRACE_RTAI_TIMER.

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 465 of file hal.c.

References rtai_irq_desc.

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 655 of file hal.c.

References flags, rtai_restore_flags, and rtai_save_flags_and_cli.

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 736 of file hal.c.

References flags, rtai_restore_flags, rtai_save_flags_and_cli, rtai_sysreq_pending, and rtai_sysreq_virq.

asmlinkage int rt_printk ( const char *  fmt,
  ... 
)

Definition at line 1519 of file hal.c.

References args.

int rt_release_irq ( unsigned  irq  ) 

Definition at line 198 of file hal.c.

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

Here is the call graph for this function:

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

Definition at line 176 of file hal.c.

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

Here is the call graph for this function:

int rt_request_linux_irq ( unsigned  irq,
void *  handler,
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 597 of file hal.c.

References count, flags, rtai_linux_irq, RTAI_NR_IRQS, rtai_restore_flags, and rtai_save_flags_and_cli.

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

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 690 of file hal.c.

References flags, rtai_restore_flags, rtai_save_flags_and_cli, rtai_sysreq_map, rtai_sysreq_table, and srq.

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

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).

Definition at line 879 of file hal.c.

References flags, imuldiv(), rdtsc, rt_ack_tmr(), rt_set_irq_ack(), rt_set_timer_delay, rt_times, rtai_restore_flags, rtai_save_flags_and_cli, rtai_tunables, and TRACE_RTAI_TIMER.

Here is the call graph for this function:

int rt_reset_irq_to_sym_mode ( int  irq  ) 

Definition at line 862 of file hal.c.

void(*)(int) rt_set_ihook (  ) 

Definition at line 1300 of file hal.c.

References rtai_isr_hook.

int rt_set_irq_ack ( unsigned  irq,
int(*)(unsigned int)  irq_ack 
)

Definition at line 236 of file hal.c.

References hal_root_domain, RTAI_NR_IRQS, and rtai_realtime_irq.

void rt_set_irq_cookie ( unsigned  irq,
void *  cookie 
)

Definition at line 245 of file hal.c.

References RTAI_NR_IRQS, and rtai_realtime_irq.

void rt_set_irq_retmode ( unsigned  irq,
int  retmode 
)

Definition at line 252 of file hal.c.

References RTAI_NR_IRQS, and rtai_realtime_irq.

RT_TRAP_HANDLER rt_set_trap_handler ( RT_TRAP_HANDLER  handler  ) 

Definition at line 942 of file hal.c.

References rtai_trap_handler.

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 343 of file hal.c.

References BEGIN_PIC, END_PIC, hal_clear_irq, hal_root_domain, and rtai_irq_desc.

unsigned rt_startup_irq ( unsigned  irq  ) 

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 299 of file hal.c.

References BEGIN_PIC, END_PIC, hal_root_domain, hal_unlock_irq, and rtai_irq_desc.

asmlinkage int rt_sync_printk ( const char *  fmt,
  ... 
)

Definition at line 1531 of file hal.c.

References args, hal_set_printk_async, hal_set_printk_sync, and rtai_domain.

void rt_unmask_irq ( unsigned  irq  ) 

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 515 of file hal.c.

References _rt_end_irq().

Here is the call graph for this function:

int rtai_8254_timer_handler ( struct pt_regs  regs  ) 

irqreturn_t rtai_broadcast_to_local_timers ( int  irq,
void *  dev_id,
struct pt_regs *  regs 
)

Definition at line 747 of file hal.c.

int rtai_calibrate_8254 ( void   ) 

Definition at line 1294 of file hal.c.

References rt_printk().

Here is the call graph for this function:

void rtai_cmpxchg_trap_handler ( void   ) 

Referenced by rtai_install_archdep().

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

Definition at line 154 of file hal.c.

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

Here is the call graph for this function:

void rtai_critical_exit ( unsigned long  flags  ) 

Definition at line 167 of file hal.c.

References atomic_inc, hal_critical_exit, and rtai_sync_count.

static int rtai_hirq_dispatcher ( unsigned  irq,
struct pt_regs *  regs 
) [static]

Definition at line 951 of file hal.c.

References CHECK_KERCTX, cpuid, HAL_LOCK_LINUX, hal_tick_irq, HAL_TICK_REGS, HAL_UNLOCK_LINUX, rtai_realtime_irq, RTAI_SCHED_ISR_LOCK, RTAI_SCHED_ISR_UNLOCK, and rtai_sti.

static long rtai_imuldiv ( long  i,
long  mult,
long  div 
) [inline, static]

Definition at line 103 of file rtai_hal.h.

References __asm__(), and dummy().

Here is the call graph for this function:

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

Definition at line 192 of file rtai_hal.h.

References __asm__(), and dummy().

Here is the call graph for this function:

static void rtai_install_archdep ( void   )  [static]

Definition at line 1258 of file hal.c.

References flags, hal_catch_event, hal_get_sysinfo, hal_root_domain, HAL_SYSCALL_PROLOGUE, hal_sysinfo_struct, intercept_syscall_prologue(), rtai_cmpxchg_trap_handler(), RTAI_CMPXCHG_TRAP_SYS_VECTOR, rtai_cmpxchg_trap_vec, rtai_cpufreq_arg, rtai_critical_enter(), rtai_critical_exit(), rtai_set_gate_vector(), RTAI_SYS_VECTOR, rtai_sysvec, rtai_tunables, rtai_uvec_handler(), rtai_xchg_trap_handler(), RTAI_XCHG_TRAP_SYS_VECTOR, and rtai_xchg_trap_vec.

Here is the call graph for this function:

static long long rtai_llimd ( long long  ll,
long  mult,
long  div 
) [inline, static]

Definition at line 118 of file rtai_hal.h.

References rtai_imuldiv.

static unsigned long long rtai_llimd ( unsigned long long  ll,
unsigned int  mult,
unsigned int  div 
) [inline, static]

Definition at line 112 of file rtai_hal.h.

References rtai_ulldiv.

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

Definition at line 207 of file rtai_hal.h.

References __asm__().

Here is the call graph for this function:

static void rtai_lsrq_dispatcher ( unsigned  virq  )  [static]

Definition at line 1141 of file hal.c.

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

Here is the call graph for this function:

RTAI_MODULE_PARM ( PrintFpuInit  ,
int   
)

RTAI_MODULE_PARM ( PrintFpuTrap  ,
int   
)

RTAI_MODULE_PARM ( IsolCpusMask  ,
ulong   
)

RTAI_MODULE_PARM ( rtai_cpufreq_arg  ,
ulong   
)

void rtai_reset_gate_vector ( unsigned  vector,
struct desc_struct  e 
)

Definition at line 1252 of file hal.c.

Referenced by __rtai_hal_exit(), rt_free_timer(), and rtai_uninstall_archdep().

struct desc_struct rtai_set_gate_vector ( unsigned  vector,
int  type,
int  dpl,
void *  handler 
)

Definition at line 1225 of file hal.c.

Referenced by __rtai_hal_init(), rt_request_timer(), and rtai_install_archdep().

void rtai_set_linux_task_priority ( struct task_struct *  task,
int  policy,
int  prio 
)

Definition at line 1309 of file hal.c.

References hal_set_linux_task_priority, and printk().

Here is the call graph for this function:

asmlinkage int rtai_syscall_dispatcher ( __volatile struct pt_regs  pt  ) 

Definition at line 1202 of file hal.c.

References cpuid, rtai_lxrt_dispatcher, rtai_usrq_dispatcher(), and usi_SRQ_call().

Here is the call graph for this function:

static int rtai_trap_fault ( unsigned  event,
void *  evdata 
) [static]

Definition at line 1043 of file hal.c.

References flags, HINT_DIAG_MSG, rt_printk(), rtai_save_flags_and_cli, rtai_trap_handler, TRACE_RTAI_TRAP_ENTRY, and TRACE_RTAI_TRAP_EXIT.

Here is the call graph for this function:

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

Definition at line 243 of file rtai_hal.h.

References __asm__().

Here is the call graph for this function:

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

Definition at line 181 of file rtai_hal.h.

References do_div.

static void rtai_uninstall_archdep ( void   )  [static]

Definition at line 1280 of file hal.c.

References flags, hal_catch_event, hal_root_domain, HAL_SYSCALL_PROLOGUE, RTAI_CMPXCHG_TRAP_SYS_VECTOR, rtai_cmpxchg_trap_vec, rtai_critical_enter(), rtai_critical_exit(), rtai_reset_gate_vector(), RTAI_SYS_VECTOR, rtai_sysvec, RTAI_XCHG_TRAP_SYS_VECTOR, and rtai_xchg_trap_vec.

Here is the call graph for this function:

static long long rtai_usrq_dispatcher ( unsigned long  srq,
unsigned long  label 
) [inline, static]

Definition at line 1159 of file hal.c.

References rtai_sysreq_map, rtai_sysreq_table, TRACE_RTAI_SRQ_ENTRY, and TRACE_RTAI_SRQ_EXIT.

void rtai_uvec_handler ( void   ) 

Referenced by rtai_install_archdep().

void rtai_xchg_trap_handler ( void   ) 

Referenced by rtai_install_archdep().

int usi_SRQ_call ( unsigned long  srq,
unsigned long  args,
long long *  result,
unsigned long  lsr 
) [inline]

Definition at line 1195 of file hal.c.

Referenced by rtai_syscall_dispatcher().

RTAI_SYSCALL_MODE void usr_rt_pend_linux_irq ( unsigned  irq  ) 

Definition at line 663 of file hal.c.

References flags, rtai_restore_flags, and rtai_save_flags_and_cli.


Variable Documentation

void* _ramvec

int { ... } count [inherited]

Definition at line 108 of file hal.c.

unsigned { ... } flags [inherited]

Definition at line 107 of file hal.c.

void* hal_irq_handler

unsigned long io_apic_irqs

unsigned long IsolCpusMask = 0

Definition at line 173 of file hal.c.

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

unsigned { ... } label [inherited]

Definition at line 114 of file hal.c.

volatile { ... } locked [inherited]

Definition at line 96 of file hal.c.

int PrintFpuInit = 0 [static]

Definition at line 1040 of file hal.c.

int PrintFpuTrap = 0 [static]

Definition at line 1038 of file hal.c.

volatile { ... } rqsted [inherited]

Definition at line 96 of file hal.c.

struct { ... } rt_scheduling[RTAI_NR_CPUS]

struct rt_times rt_smp_times[RTAI_NR_CPUS]

Definition at line 140 of file hal.c.

struct rt_times rt_times

Definition at line 138 of file hal.c.

struct desc_struct rtai_cmpxchg_trap_vec [static]

Definition at line 133 of file hal.c.

Referenced by rtai_install_archdep(), and rtai_uninstall_archdep().

volatile unsigned long rtai_cpu_lock[2]

Definition at line 152 of file hal.c.

volatile unsigned long rtai_cpu_realtime

Definition at line 150 of file hal.c.

unsigned long rtai_cpufreq_arg = CONFIG_CLOCK_FREQ [static]

Definition at line 81 of file hal.c.

struct hal_domain_struct rtai_domain

Definition at line 102 of file hal.c.

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

Definition at line 99 of file hal.c.

struct rtai_switch_data rtai_linux_context[RTAI_NR_CPUS]

Definition at line 142 of file hal.c.

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

spinlock_t rtai_lsrq_lock = SPIN_LOCK_UNLOCKED [static]

Definition at line 125 of file hal.c.

long long(*) rtai_lxrt_dispatcher(unsigned long, unsigned long)

Definition at line 1176 of file hal.c.

struct rtai_realtime_irq_s rtai_realtime_irq[RTAI_NR_IRQS]

Definition at line 104 of file hal.c.

atomic_t rtai_sync_count = ATOMIC_INIT(1) [static]

Definition at line 129 of file hal.c.

volatile int rtai_sync_level [static]

Definition at line 127 of file hal.c.

unsigned long rtai_sysreq_map = 1 [static]

Definition at line 119 of file hal.c.

unsigned long rtai_sysreq_pending [static]

Definition at line 121 of file hal.c.

unsigned long rtai_sysreq_running [static]

Definition at line 123 of file hal.c.

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

unsigned rtai_sysreq_virq [static]

Definition at line 117 of file hal.c.

struct desc_struct rtai_sysvec [static]

Definition at line 131 of file hal.c.

Referenced by rtai_install_archdep(), and rtai_uninstall_archdep().

RT_TRAP_HANDLER rtai_trap_handler [static]

Definition at line 136 of file hal.c.

struct calibration_data rtai_tunables

Definition at line 148 of file hal.c.

struct desc_struct rtai_xchg_trap_vec [static]

Definition at line 134 of file hal.c.

Referenced by rtai_install_archdep(), and rtai_uninstall_archdep().

int(*) sched_intercept_syscall_prologue(struct pt_regs *) [static]

Definition at line 1178 of file hal.c.

int timer_inuse = 0 [static]

Definition at line 218 of file hal.c.

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


Generated on Tue Feb 2 17:48:20 2010 for RTAI API by  doxygen 1.4.7