# rtai_arch.h

    00001 /* rtai/include/asm-arm/arch-sa1100/rtai_arch.h
    00002 -------------------------------------------------------------
    00003 DON´T include directly - it's included through asm-arm/rtai.h
    00004 -------------------------------------------------------------
    00005 COPYRIGHT (C) 2002 Guennadi Liakhovetski, DSA GmbH (gl@dsa-ac.de)
    00006 COPYRIGHT (C) 2002 Wolfgang Müller (wolfgang.mueller@dsa-ac.de)
    00007 Copyright (c) 2001 Alex Züpke, SYSGO RTS GmbH (azu@sysgo.de)
    00008
    00009 This program is free software; you can redistribute it and/or modify
    00010 it under the terms of version 2 of the GNU General Public License as
    00011 published by the Free Software Foundation.
    00012
    00013 This program is distributed in the hope that it will be useful,
    00014 but WITHOUT ANY WARRANTY; without even the implied warranty of
    00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    00016 GNU General Public License for more details.
    00017
    00018 You should have received a copy of the GNU General Public License
    00019 along with this program; if not, write to the Free Software
    00020 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    00021 */
    00022 /*
    00023 --------------------------------------------------------------------------
    00024 Acknowledgements
    00025 - Paolo Mantegazza      (mantegazza@aero.polimi.it)
    00026         creator of RTAI
    00027 */
    00028
    00029 #ifndef _ASM_ARCH_RTAI_ARCH_H_
    00030 #define _ASM_ARCH_RTAI_ARCH_H_
    00031
    00032 #define FREQ_SYS_CLK       3686400
    00033 #define LATENCY_MATCH_REG     2000
    00034 #define SETUP_TIME_MATCH_REG   600
    00035 #define LATENCY_TICKS    (LATENCY_MATCH_REG/(1000000000/FREQ_SYS_CLK))
    00036 #define SETUP_TIME_TICKS (SETUP_TIME_MATCH_REG/(1000000000/FREQ_SYS_CLK))
    00037
    00038 #define TIMER_8254_IRQ          IRQ_OST0
    00039
    00040 #define ARCH_MUX_IRQ            IRQ_GPIO11_27
    00041
    00042 #include <asm/arch/irq.h>
    00043 void rtai_sa1100_GPIO11_27_demux( int irq, void *dev_id, struct pt_regs *regs );
    00044
    00045 static inline void arch_mount_rtai( void )
    00046 {
    00047         /* Let's take care about our "special" IRQ11 */
    00048 //      free_irq( IRQ_GPIO11_27 );
    00049         rt_request_global_irq_ext( IRQ_GPIO11_27, rtai_sa1100_GPIO11_27_demux, NULL );
    00050 }
    00051
    00052 static inline void arch_umount_rtai( void )
    00053 {
    00054         rt_free_global_irq( IRQ_GPIO11_27 );
    00055 //      request_irq( IRQ_GPIO11_27, sa1100_GPIO11_27_demux, SA_INTERRUPT, "GPIO 11-27", NULL );
    00056 }
    00057
    00058 /* Check, if this is a demultiplexed irq */
    00059 #define isdemuxirq(irq) (irq >= IRQ_GPIO11)
    00060
    00061 #endif