base/include/asm/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_I386_VECTORS_H
00031 #define _RTAI_ASM_I386_VECTORS_H
00032 
00033 #define RTAI_SYS_VECTOR     0xF6
00034 
00035 #ifdef __KERNEL__
00036 
00037 #include <linux/version.h>
00038 
00039 #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,19)
00040 #include <asm/ipipe.h>
00041 #endif
00042 
00043 #include <rtai_hal_names.h>
00044 #include <rtai_config.h>
00045 
00046 #ifdef CONFIG_X86_LOCAL_APIC
00047 #define RTAI_APIC_HIGH_VECTOR  HAL_APIC_HIGH_VECTOR
00048 #define RTAI_APIC_LOW_VECTOR   HAL_APIC_LOW_VECTOR
00049 #else 
00050 #define RTAI_APIC_HIGH_VECTOR  0xff
00051 #define RTAI_APIC_LOW_VECTOR   0xff
00052 #endif
00053 
00054 #ifdef ipipe_apic_vector_irq /* LINUX_VERSION_CODE > KERNEL_VERSION(2,6,19) */
00055 #define RTAI_APIC_HIGH_IPI     ipipe_apic_vector_irq(RTAI_APIC_HIGH_VECTOR)
00056 #define RTAI_APIC_LOW_IPI      ipipe_apic_vector_irq(RTAI_APIC_LOW_VECTOR)
00057 #define RTAI_SYS_IRQ           ipipe_apic_vector_irq(RTAI_SYS_VECTOR)
00058 #define LOCAL_TIMER_IPI        ipipe_apic_vector_irq(LOCAL_TIMER_VECTOR)
00059 #else
00060 #define RTAI_APIC_HIGH_IPI     (RTAI_APIC_HIGH_VECTOR - FIRST_EXTERNAL_VECTOR)
00061 #define RTAI_APIC_LOW_IPI      (RTAI_APIC_LOW_VECTOR - FIRST_EXTERNAL_VECTOR)
00062 #define RTAI_SYS_IRQ           (RTAI_SYS_VECTOR - FIRST_EXTERNAL_VECTOR)
00063 #define LOCAL_TIMER_IPI        (LOCAL_TIMER_VECTOR - FIRST_EXTERNAL_VECTOR)
00064 #endif
00065 
00066 #if RTAI_APIC_HIGH_VECTOR == RTAI_SYS_VECTOR || RTAI_APIC_LOW_VECTOR == RTAI_SYS_VECTOR
00067 #error *** RTAI_SYS_VECTOR CONFLICTS WITH APIC VECTORS USED BY RTAI ***
00068 #endif
00069 
00070 #endif
00071 
00072 #define __rtai_stringize0(_s_) #_s_
00073 #define __rtai_stringize(_s_)  __rtai_stringize0(_s_)
00074 #define __rtai_trap_call(_t_)  _t_
00075 #define __rtai_do_trap0(_t_)   __rtai_stringize(int $ _t_)
00076 #define __rtai_do_trap(_t_)    __rtai_do_trap0(__rtai_trap_call(_t_))
00077 
00078 #define RTAI_DO_TRAP(v, r, a1, a2)  do { __asm__ __volatile__ ( __rtai_do_trap(v): : "a" (a1), "c" (a2), "d" (&r): "memory"); } while (0)
00079 
00080 #endif /* !_RTAI_ASM_I386_VECTORS_H */

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