base/include/asm-m68knommu/rtai_vectors.h

Go to the documentation of this file.
00001 /*
00002  *   ARTI -- RTAI-compatible Adeos-based Real-Time Interface. Based on
00003  *   the original RTAI layer for x86.
00004  *
00005  *   Original RTAI/x86 layer implementation:
00006  *   Copyright (C) 2000 Paolo Mantegazza,
00007  *   Copyright (C) 2000 Steve Papacharalambous,
00008  *   Copyright (C) 2000 Stuart Hughes,
00009  *   and others.
00010  *
00011  *   RTAI/x86 rewrite over Adeos:
00012  *   Copyright (C) 2002 Philippe Gerum.
00013  *
00014  *   This program is free software; you can redistribute it and/or modify
00015  *   it under the terms of the GNU General Public License as published by
00016  *   the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139,
00017  *   USA; either version 2 of the License, or (at your option) any later
00018  *   version.
00019  *
00020  *   This program is distributed in the hope that it will be useful,
00021  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00022  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00023  *   GNU General Public License for more details.
00024  *
00025  *   You should have received a copy of the GNU General Public License
00026  *   along with this program; if not, write to the Free Software
00027  *   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00028  */
00029 
00030 #ifndef _RTAI_ASM_M68KNOMMU_VECTORS_H
00031 #define _RTAI_ASM_M68KNOMMU_VECTORS_H
00032 
00033 #define RTAI_SYS_VECTOR     43
00034 #define RTAI_CMPXCHG_TRAP_SYS_VECTOR     44
00035 #define RTAI_XCHG_TRAP_SYS_VECTOR     45
00036 
00037 #ifdef __KERNEL__
00038 
00039 #include <linux/version.h>
00040 
00041 #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,19)
00042 #include <asm/ipipe.h>
00043 #endif
00044 
00045 #include <rtai_hal_names.h>
00046 #include <rtai_config.h>
00047 
00048 #ifdef CONFIG_X86_LOCAL_APIC
00049 #define RTAI_APIC_HIGH_VECTOR  HAL_APIC_HIGH_VECTOR
00050 #define RTAI_APIC_LOW_VECTOR   HAL_APIC_LOW_VECTOR
00051 #else 
00052 #define RTAI_APIC_HIGH_VECTOR  0xff
00053 #define RTAI_APIC_LOW_VECTOR   0xff
00054 #endif
00055 
00056 #ifdef ipipe_apic_vector_irq /* LINUX_VERSION_CODE > KERNEL_VERSION(2,6,19) */
00057 #define RTAI_APIC_HIGH_IPI     ipipe_apic_vector_irq(RTAI_APIC_HIGH_VECTOR)
00058 #define RTAI_APIC_LOW_IPI      ipipe_apic_vector_irq(RTAI_APIC_LOW_VECTOR)
00059 #define RTAI_SYS_IRQ           ipipe_apic_vector_irq(RTAI_SYS_VECTOR)
00060 #define LOCAL_TIMER_IPI        ipipe_apic_vector_irq(LOCAL_TIMER_VECTOR)
00061 #else
00062 #define RTAI_APIC_HIGH_IPI     (RTAI_APIC_HIGH_VECTOR - FIRST_EXTERNAL_VECTOR)
00063 #define RTAI_APIC_LOW_IPI      (RTAI_APIC_LOW_VECTOR - FIRST_EXTERNAL_VECTOR)
00064 #define RTAI_SYS_IRQ           (RTAI_SYS_VECTOR - FIRST_EXTERNAL_VECTOR)
00065 #define LOCAL_TIMER_IPI        (LOCAL_TIMER_VECTOR - FIRST_EXTERNAL_VECTOR)
00066 #endif
00067 
00068 #if RTAI_APIC_HIGH_VECTOR == RTAI_SYS_VECTOR || RTAI_APIC_LOW_VECTOR == RTAI_SYS_VECTOR
00069 #error *** RTAI_SYS_VECTOR CONFLICTS WITH APIC VECTORS USED BY RTAI ***
00070 #endif
00071 
00072 #endif
00073 
00074 static inline void RTAI_DO_TRAP_SYS(long long *ret, int srq, unsigned long args)
00075 {
00076     register int __srq __asm__ ("%d0") = srq;
00077         register unsigned long __args __asm__ ("%d1") = args;
00078         register unsigned long __ret1 __asm__ ("%d2");
00079         register unsigned long __ret2 __asm__ ("%d3");
00080     __asm__ __volatile__ ( "trap #11\n\t" : "+d" (__ret1),"+d" (__ret2) : "d" (__srq), "d" (__args) : "memory" );
00081     *ret = __ret1 + ((long long)__ret2 << 32);
00082 }
00083 
00084 #endif /* !_RTAI_ASM_M68KNOMMU_VECTORS_H */

Generated on Tue Feb 2 17:46:05 2010 for RTAI API by  doxygen 1.4.7