base/include/asm-ppc/rtai_lxrt.h

Go to the documentation of this file.
00001 /* 00002 * Copyright (C) 1999-2003 Paolo Mantegazza <mantegazza@aero.polimi.it> 00003 * 2000 Pierre Cloutier <pcloutier@poseidoncontrols.com> 00004 2002 Steve Papacharalambous <stevep@zentropix.com> 00005 * 00006 * This library is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU Lesser General Public 00008 * License as published by the Free Software Foundation; either 00009 * version 2 of the License, or (at your option) any later version. 00010 * 00011 * This library is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 * Lesser General Public License for more details. 00015 00016 * You should have received a copy of the GNU Lesser General Public 00017 * License along with this library; if not, write to the Free Software 00018 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. 00019 */ 00020 00021 #ifndef _RTAI_ASM_PPC_LXRT_H 00022 #define _RTAI_ASM_PPC_LXRT_H 00023 00024 #include <asm/rtai_vectors.h> 00025 00026 #define LOW 1 00027 #define HIGH 0 00028 00029 #define LINUX_SYSCALL_NR gpr[0] 00030 #define LINUX_SYSCALL_REG1 gpr[1] 00031 #define LINUX_SYSCALL_REG2 gpr[2] 00032 #define LINUX_SYSCALL_REG3 gpr[3] 00033 #define LINUX_SYSCALL_REG4 gpr[4] 00034 #define LINUX_SYSCALL_REG5 gpr[5] 00035 #define LINUX_SYSCALL_REG6 gpr[6] 00036 #define LINUX_SYSCALL_RETREG gpr[0] 00037 00038 #ifdef __KERNEL__ 00039 00040 #include <asm/segment.h> 00041 #include <asm/mmu_context.h> 00042 00043 #include <linux/interrupt.h> 00044 00045 #define USE_LINUX_TIMER 00046 #define TIMER_NAME "8254-PIT" 00047 #define TIMER_FREQ RTAI_FREQ_8254 00048 #define TIMER_LATENCY RTAI_LATENCY_8254 00049 #define TIMER_SETUP_TIME RTAI_SETUP_TIME_8254 00050 #define ONESHOT_SPAN (0x7FFF*(CPU_FREQ/TIMER_FREQ)) 00051 #define update_linux_timer(cpuid) adeos_pend_uncond(TIMER_8254_IRQ, cpuid) 00052 00053 #define IN_INTERCEPT_IRQ_ENABLE() do { /* nop */ } while (0) 00054 00055 #define RTAI_SYSCALL_NR gpr[0] 00056 00057 static inline void _lxrt_context_switch (struct task_struct *prev, struct task_struct *next, int cpuid) 00058 { 00059 struct mm_struct *oldmm = prev->active_mm; 00060 00061 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) 00062 switch_mm(oldmm,next->active_mm,next,cpuid); 00063 00064 if (!next->mm) 00065 enter_lazy_tlb(oldmm,next,cpuid); 00066 #else /* >= 2.6.0 */ 00067 switch_mm(oldmm,next->active_mm,next); 00068 00069 if (!next->mm) enter_lazy_tlb(oldmm,next); 00070 #endif /* < 2.6.0 */ 00071 00072 switch_to(prev, next, prev); 00073 barrier(); 00074 } 00075 00076 #else /* !__KERNEL__ */ 00077 00078 union rtai_lxrt_t { RTIME rt; int i[2]; void *v[2]; }; 00079 00080 static inline union rtai_lxrt_t rtai_lxrt(short dynx, short lsize, unsigned long srq, void *arg) 00081 { 00082 /* LXRT is not yet available on PPC. */ 00083 union rtai_lxrt_t retval; 00084 retval.i[0] = -1; 00085 retval.i[1] = -1; 00086 return retval; 00087 } 00088 00089 #define rtai_iopl() do { /* nop */ } while (0) 00090 00091 #endif /* !__KERNEL__ */ 00092 00093 #endif /* !_RTAI_ASM_PPC_LXRT_H */

Generated on Thu Nov 20 11:49:48 2008 for RTAI API by doxygen 1.3.8