00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
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 { } 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
00067 switch_mm(oldmm,next->active_mm,next);
00068
00069
if (!next->mm) enter_lazy_tlb(oldmm,next);
00070
#endif
00071
00072 switch_to(prev, next, prev);
00073 barrier();
00074 }
00075
00076
#else
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
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 { } while (0)
00090
00091
#endif
00092
00093
#endif