base/include/asm-arm/rtai_fpu.h

Go to the documentation of this file.
00001 /*
00002  * FPU support.
00003  *
00004  * Original RTAI/x86 layer implementation:
00005  *   Copyright (c) 2000 Paolo Mantegazza (mantegazza@aero.polimi.it)
00006  *   Copyright (c) 2000 Steve Papacharalambous (stevep@zentropix.com)
00007  *   Copyright (c) 2000 Stuart Hughes
00008  *   and others.
00009  *
00010  * RTAI/x86 rewrite over Adeos:
00011  *   Copyright (c) 2002 Philippe Gerum (rpm@xenomai.org)
00012  *
00013  * Original RTAI/ARM RTHAL implementation:
00014  *   Copyright (c) 2000 Pierre Cloutier (pcloutier@poseidoncontrols.com)
00015  *   Copyright (c) 2001 Alex Züpke, SYSGO RTS GmbH (azu@sysgo.de)
00016  *   Copyright (c) 2002 Guennadi Liakhovetski DSA GmbH (gl@dsa-ac.de)
00017  *   Copyright (c) 2002 Steve Papacharalambous (stevep@zentropix.com)
00018  *   Copyright (c) 2002 Wolfgang Müller (wolfgang.mueller@dsa-ac.de)
00019  *   Copyright (c) 2003 Bernard Haible, Marconi Communications
00020  *   Copyright (c) 2003 Thomas Gleixner (tglx@linutronix.de)
00021  *   Copyright (c) 2003 Philippe Gerum (rpm@xenomai.org)
00022  *
00023  * RTAI/ARM over Adeos rewrite:
00024  *   Copyright (c) 2004-2005 Michael Neuhauser, Firmix Software GmbH (mike@firmix.at)
00025  *
00026  * RTAI/ARM over Adeos rewrite for PXA255_2.6.7:
00027  *   Copyright (c) 2005 Stefano Gafforelli (stefano.gafforelli@tiscali.it)
00028  *   Copyright (c) 2005 Luca Pizzi (lucapizzi@hotmail.com)
00029  *
00030  * This program is free software; you can redistribute it and/or modify it under
00031  * the terms of the GNU General Public License as published by the Free Software
00032  * Foundation, Inc., 675 Mass Ave, Cambridge MA 02139, USA; either version 2 of
00033  * the License, or (at your option) any later version.
00034  *
00035  * This program is distributed in the hope that it will be useful, but WITHOUT
00036  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00037  * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
00038  * details.
00039  *
00040  * You should have received a copy of the GNU General Public License along with
00041  * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
00042  * Place - Suite 330, Boston, MA 02111-1307, USA.
00043  */
00044 #ifndef _RTAI_ASM_ARM_FPU_H
00045 #define _RTAI_ASM_ARM_FPU_H
00046 
00047 #ifdef CONFIG_RTAI_FPU_SUPPORT
00048 #error "Sorry, there is no FPU support in RTAI for ARM (you don't need it for soft-float or FPU-emulation)"
00049 #endif
00050 
00051 /* All the work is done by the soft-float library or the kernel FPU emulator. */
00052 
00053 #define enable_fpu()
00054 #define save_fpcr_and_enable_fpu(fpcr)
00055 #define restore_fpcr(fpcr)
00056 #define init_hard_fpenv()
00057 #define init_fpenv(fpenv)
00058 #define save_fpenv(fpenv)
00059 #define restore_fpenv(fpenv)
00060 #define init_hard_fpu(lnxtsk)
00061 #define init_fpu(lnxtsk)
00062 #define restore_fpu(lnxtsk)
00063 
00064 typedef struct arm_fpu_env { unsigned long fpu_reg[1]; } FPU_ENV;
00065 
00066 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
00067 
00068 #define set_lnxtsk_uses_fpu(lnxtsk) \
00069     do { (lnxtsk)->used_math = 1; } while(0)
00070 #define clear_lnxtsk_uses_fpu(lnxtsk) \
00071     do { (lnxtsk)->used_math = 0; } while(0)
00072 #define lnxtsk_uses_fpu(lnxtsk)  ((lnxtsk)->used_math)
00073 
00074 #define set_lnxtsk_using_fpu(lnxtsk) \
00075     do { (lnxtsk)->flags |= PF_USEDFPU; } while(0)
00076 
00077 #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) */
00078 
00079 
00080 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) && LINUX_VERSION_CODE < KERNEL_VERSION(2,6,11)
00081 
00082 #define set_lnxtsk_uses_fpu(lnxtsk) \
00083     do { (lnxtsk)->used_math = 1; } while(0)
00084 #define clear_lnxtsk_uses_fpu(lnxtsk) \
00085     do { (lnxtsk)->used_math = 0; } while(0)
00086 #define lnxtsk_uses_fpu(lnxtsk)  ((lnxtsk)->used_math)
00087 
00088 #define set_lnxtsk_using_fpu(lnxtsk) \
00089     do { (lnxtsk)->thread_info->status |= TS_USEDFPU; } while(0)
00090 
00091 #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) && LINUX_VERSION_CODE < KERNEL_VERSION(2,6,11) */
00092 
00093 
00094 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,11)
00095 
00096 #define set_lnxtsk_uses_fpu(lnxtsk) \
00097     do { set_stopped_child_used_math(lnxtsk); } while(0)
00098 #define clear_lnxtsk_uses_fpu(lnxtsk) \
00099     do { clear_stopped_child_used_math(lnxtsk); } while(0)
00100 #define lnxtsk_uses_fpu(lnxtsk)  (tsk_used_math(lnxtsk))
00101 
00102 #define set_lnxtsk_using_fpu(lnxtsk) \
00103     do { (lnxtsk)->thread_info->status |= TS_USEDFPU; } while(0)
00104 
00105 #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,11) */
00106 
00107 #endif /* _RTAI_ASM_ARM_FPU_H */

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