rtai-core/include/asm-mips/rtai_srq.h

00001 /*
00002 COPYRIGHT (C) 2000  Paolo Mantegazza (mantegazza@aero.polimi.it)
00003 COPYRIGHT (C) 2001  Steve Papacharalambous (stevep@lineo.com)
00004 
00005 This library is free software; you can redistribute it and/or
00006 modify it under the terms of the GNU Lesser General Public
00007 License as published by the Free Software Foundation; either
00008 version 2 of the License, or (at your option) any later version.
00009 
00010 This library is distributed in the hope that it will be useful,
00011 but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013 Lesser General Public License for more details.
00014 
00015 You should have received a copy of the GNU Lesser General Public
00016 License along with this library; if not, write to the Free Software
00017 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
00018 */
00019 
00020 /*
00021  * MIPS port - Steve Papacharalambous (stevep@lineo.com)
00022  */
00023 
00024 
00025 
00026 #ifndef _RTAI_MIPS_SRQ_H_
00027 #define _RTAI_MIPS_SRQ_H_
00028 
00029 #define RTAI_SYS_VECTOR 0xfe000000
00030 
00031 // the following function is adapted from Linux MIPS unistd.h 
00032 static inline long long rtai_srq(unsigned long srq, unsigned long whatever)
00033 {
00034         long long retval;
00035         unsigned long __rv_0;
00036         unsigned long __rv_1;
00037 
00038         __asm__ __volatile__
00039                 ("move\t$4,%3\n\t"
00040                  "li\t$2,%2\n\t"
00041                  "ori\t$2,$2,RTAI_SYS_VECTOR\n\t"
00042                  "syscall\n\t"
00043                  "move\t%0,$2\n\t"
00044                  "move\t%1,$3\n\t"
00045                 : "=r" (__rv_0), "=r" (__rv_1)
00046                 : "r" (srq), "r" (whatever)
00047                 : "$2", "$3", "$4", "$5", "$6", "$7", "$8", \
00048                   "$9", "$10", "$11", "$12", "$13", "$14", \
00049                   "$15", "$24");
00050         ((unsigned long *)&retval)[0] = __rv_0;
00051         ((unsigned long *)&retval)[1] = __rv_1;
00052         return retval;
00053 }  /* End function - rtai_srq */
00054 
00055 static inline int rtai_open_srq(unsigned int label)
00056 {
00057         return (int)rtai_srq(0, label);
00058 }
00059 #endif /* _RTAI_MIPS_SRQ_H_ */
00060 

Generated on Sat Jul 24 19:36:02 2004 for RTAI API by doxygen 1.3.4