base/include/rtai_wrappers.h

Go to the documentation of this file.
00001 /* 00002 * Copyright (C) 2004 Philippe Gerum <rpm@xenomai.org> 00003 * 00004 * This program is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU General Public License as 00006 * published by the Free Software Foundation; either version 2 of the 00007 * License, or (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00017 */ 00018 00019 #ifndef _RTAI_WRAPPERS_H 00020 #define _RTAI_WRAPPERS_H 00021 00022 #ifdef __KERNEL__ 00023 00024 #include <linux/version.h> 00025 #include <linux/config.h> 00026 #ifndef __cplusplus 00027 #include <linux/module.h> 00028 #endif /* !__cplusplus */ 00029 00030 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) 00031 00032 #define PID_MAX_LIMIT PID_MAX 00033 #define num_online_cpus() smp_num_cpus 00034 #define mm_remap_page_range(vma,from,to,size,prot) remap_page_range(from,to,size,prot) 00035 #define __user 00036 00037 #define set_tsk_need_resched(t) do { \ 00038 (t)->need_resched = 1; \ 00039 } while(0) 00040 00041 #define clear_tsk_need_resched(t) do { \ 00042 (t)->need_resched = 0; \ 00043 } while(0) 00044 00045 #define set_need_resched() set_tsk_need_resched(current) 00046 00047 #define LIST_POISON1 NULL 00048 #define LIST_POISON2 NULL 00049 00050 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,23) || __cplusplus 00051 typedef void irqreturn_t; 00052 #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,4,23) || __cplusplus */ 00053 00054 #define get_tsk_addr_limit(t) ((t)->addr_limit.seg) 00055 00056 #define task_cpu(t) ((t)->processor) 00057 00058 #define self_daemonize(name) do { \ 00059 strcpy(current->comm,"gatekeeper"); \ 00060 daemonize(); \ 00061 } while(0) 00062 00063 #define get_thread_ptr(t) (t) 00064 00065 #define RTAI_LINUX_IRQ_HANDLED /* i.e. "void" return */ 00066 00067 #else /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) */ 00068 00069 #define mm_remap_page_range(vma,from,to,size,prot) remap_page_range(vma,from,to,size,prot) 00070 00071 #define get_tsk_addr_limit(t) ((t)->thread_info->addr_limit.seg) 00072 00073 #define self_daemonize(name) daemonize(name) 00074 00075 #define get_thread_ptr(t) ((t)->thread_info) 00076 00077 #define RTAI_LINUX_IRQ_HANDLED IRQ_HANDLED 00078 00079 #ifndef MODULE_LICENSE 00080 #define MODULE_LICENSE(s) /* For really old 2.4 kernels. */ 00081 #endif /* !MODULE_LICENSE */ 00082 00083 #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) */ 00084 00085 #if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,7) 00086 #define CPUMASK_T(name) (name) 00087 #define CPUMASK(name) (name) 00088 #else /* LINUX_VERSION_CODE > KERNEL_VERSION(2,6,7) */ 00089 #define CPUMASK_T(name) ((cpumask_t){ { name } }) 00090 #define CPUMASK(name) (name.bits[0]) 00091 #endif /* LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,7) */ 00092 00093 #endif /* __KERNEL__ */ 00094 00095 #endif /* !_RTAI_WRAPPERS_H */

Generated on Thu Nov 20 11:49:50 2008 for RTAI API by doxygen 1.3.8