00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 
00029 
00030 
00031 
00032 
00033 
00034 
00035 
00036 
00037 
00038 
00039 
#ifndef _RTAI_ASM_ARM_LXRT_H
00040 
#define _RTAI_ASM_ARM_LXRT_H
00041 
00042 
#include <asm/rtai_vectors.h>
00043 
00044 
00045 
00046 
00047 #define RTAI_SYSCALL_NR      ARM_ip     
00048 #define RTAI_SYSCALL_ARGS    ARM_r0     
00049 #define SET_LXRT_RETVAL_IN_SYSCALL(retval)   \
00050     (*(long long)&r->r0 = (retval))
00051 
00052 #define LINUX_SYSCALL_NR      ARM_ip
00053 #define LINUX_SYSCALL_REG1    ARM_r0
00054 #define LINUX_SYSCALL_REG2    ARM_r1
00055 #define LINUX_SYSCALL_REG3    ARM_r2
00056 #define LINUX_SYSCALL_REG4    ARM_r3
00057 #define LINUX_SYSCALL_REG5    ARM_r4
00058 #define LINUX_SYSCALL_REG6    ARM_r5
00059 #define LINUX_SYSCALL_RETREG  ARM_r0
00060 
00061 
00062 #define LOW  0
00063 #define HIGH 1
00064 
00065 
00066 #define USE_LINUX_TIMER         1
00067 #define TIMER_NAME          RTAI_TIMER_NAME
00068 #define TIMER_FREQ          RTAI_TIMER_FREQ
00069 #define TIMER_LATENCY           RTAI_TIMER_LATENCY
00070 #define TIMER_SETUP_TIME        RTAI_TIMER_SETUP_TIME
00071 #define ONESHOT_SPAN \
00072 
    (((long long)RTAI_TIMER_MAXVAL * RTAI_TSC_FREQ) / RTAI_TIMER_FREQ)
00073 #define update_linux_timer(cpuid)   __adeos_pend_uncond(RTAI_TIMER_IRQ, cpuid)
00074 
00075 
00076 #define IN_INTERCEPT_IRQ_ENABLE()   do {  } while (0)
00077 
00078 
union rtai_lxrt_t {
00079     
RTIME rt;
00080     
int i[2];
00081     void *
v[2];
00082 };
00083 
00084 
#ifdef __cplusplus
00085 
extern "C" {
00086 
#endif 
00087 
00088 
#ifdef __KERNEL__
00089 
00090 
#include <asm/system.h>
00091 
#include <asm/mmu_context.h>
00092 
00093 
00094 
00095 
extern inline void
00096 _lxrt_context_switch(
struct task_struct *prev, 
struct task_struct *next, 
int cpuid)
00097 {
00098     
struct mm_struct *oldmm = prev->active_mm;
00099 
00100     ADEOS_PARANOIA_ASSERT(adeos_hw_irqs_disabled());
00101     ADEOS_PARANOIA_ASSERT(next->active_mm);
00102 
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
00103 
    switch_mm(oldmm, next->active_mm, next, 
cpuid);
00104     
if (!next->mm)
00105     enter_lazy_tlb(oldmm, next, 
cpuid);
00106 
#else 
00107     switch_mm(oldmm, next->active_mm, next);
00108     
if (!next->mm)
00109         enter_lazy_tlb(oldmm, next);
00110 
#endif 
00111     switch_to(prev, next, prev);
00112     ADEOS_PARANOIA_ASSERT(adeos_hw_irqs_disabled());
00113 }
00114 
00115 
#else 
00116 
00117 
static inline union rtai_lxrt_t
00118 rtai_lxrt(short int dynx, short int lsize, int 
srq, void *arg)
00119 {
00120     
union rtai_lxrt_t retval;
00121     retval.
rt = 
RTAI_DO_SWI(
RTAI_SYS_VECTOR, 
ENCODE_LXRT_REQ(dynx, 
srq, lsize), arg);
00122     
return retval;
00123 }
00124 
00125 #define rtai_iopl()  do {  } while (0)
00126 
00127 
#endif 
00128 
00129 
#ifdef __cplusplus
00130 
}
00131 
#endif 
00132 
00133 
#endif