# rtai_shm.h

    00001 /*
    00002 COPYRIGHT (C) 2000  Paolo Mantegazza (mantegazza@aero.polimi.it)
    00003
    00004 Port to ARM Copyright (c) 2001 Alex Züpke, SYSGO RTS GmbH (azu@sysgo.de)
    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
    00022 #ifndef RTAI_SHM_ASM_H
    00023 #define RTAI_SHM_ASM_H
    00024
    00025 #undef __SHM_USE_VECTOR // until we implement it for arm...
    00026 #define RTAI_SHM_VECTOR      0xFD
    00027
    00028 #ifndef __KERNEL__
    00029
    00030 #define RTAI_SRQ_MAGIC  "0x404404"
    00031
    00032 #ifdef __SHM_USE_VECTOR
    00033 static inline long long rtai_shmrq(unsigned long srq, unsigned long whatever)
    00034 {
    00035         long long retval;
    00036         register unsigned long __sc_0 __asm__ ("r0") = srq | (RTAI_SHM_VECTOR << 24);
    00037         register unsigned long __sc_1 __asm__ ("r1") = whatever;
    00038
    00039         __asm__ __volatile__ (
    00040         "swi\t" RTAI_SRQ_MAGIC "\n\t"
    00041                 : "=&r" (__sc_0), "=&r" (__sc_1)
    00042                 : "0" (__sc_0), "1" (__sc_1)
    00043                 : "r0", "r1");
    00044         ((unsigned long *)&retval)[0] = __sc_0;
    00045         ((unsigned long *)&retval)[1] = __sc_1;
    00046         return retval;
    00047 }
    00048 #endif
    00049
    00050 #else
    00051
    00052 #define RTAI_SHM_HANDLER shm_handler
    00053
    00054 #define DEFINE_SHM_HANDLER
    00055
    00056 #endif
    00057
    00058 #endif