base/include/rtai_registry.h

Go to the documentation of this file.
00001 /** 00002 * @ingroup lxrt 00003 * @file 00004 * 00005 * @author Paolo Mantegazza 00006 * 00007 * @note Copyright &copy; 1999 Paolo Mantegazza <mantegazza@aero.polimi.it>, 00008 * extensions for user space modules are jointly copyrighted (2000) with: 00009 * Pierre Cloutier <pcloutier@poseidoncontrols.com>, 00010 * Steve Papacharalambous <stevep@zentropix.com>. 00011 * 00012 * This program is free software; you can redistribute it and/or 00013 * modify it under the terms of the GNU General Public License as 00014 * published by the Free Software Foundation; either version 2 of the 00015 * License, or (at your option) any later version. 00016 * 00017 * This program is distributed in the hope that it will be useful, 00018 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00019 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00020 * GNU General Public License for more details. 00021 * 00022 * You should have received a copy of the GNU General Public License 00023 * along with this program; if not, write to the Free Software 00024 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00025 */ 00026 00027 #ifndef _RTAI_REGISTRY_H 00028 #define _RTAI_REGISTRY_H 00029 00030 #include <rtai_nam2num.h> 00031 00032 struct task_struct; 00033 00034 struct rt_registry_entry { 00035 unsigned long name; // Numerical representation of resource name 00036 void *adr; // Physical rt memory address of resource 00037 struct task_struct *tsk; // Linux task owner of the resource 00038 int type; // Type of resource 00039 unsigned short count; // Usage registry 00040 unsigned short alink; 00041 unsigned short nlink; 00042 }; 00043 00044 #define MAX_SLOTS CONFIG_RTAI_SCHED_LXRT_NUMSLOTS // Max number of registered objects 00045 00046 #define IS_TASK 0 // Used to identify registered resources 00047 #define IS_SEM 1 00048 #define IS_RWL 2 00049 #define IS_SPL 3 00050 #define IS_MBX 4 00051 #define IS_PRX 5 00052 #define IS_BIT 6 00053 #define IS_TBX 7 00054 #define IS_HPCK 8 00055 00056 #ifdef __cplusplus 00057 extern "C" { 00058 #endif /* __cplusplus */ 00059 00060 unsigned long is_process_registered(struct task_struct *tsk); 00061 00062 int rt_register(unsigned long nam, 00063 void *adr, 00064 int typ, 00065 struct task_struct *tsk); 00066 00067 int rt_drg_on_name(unsigned long name); 00068 00069 int rt_drg_on_name_cnt(unsigned long name); 00070 00071 int rt_drg_on_adr(void *adr); 00072 00073 int rt_drg_on_adr_cnt(void *adr); 00074 00075 unsigned long rt_get_name(void *adr); 00076 00077 void *rt_get_adr(unsigned long name); 00078 00079 void *rt_get_adr_cnt(unsigned long name); 00080 00081 int rt_get_type(unsigned long name); 00082 00083 #ifdef CONFIG_PROC_FS 00084 int rt_get_registry_slot(int slot, struct rt_registry_entry *entry); 00085 #endif /* CONFIG_PROC_FS */ 00086 00087 #ifdef __cplusplus 00088 } 00089 #endif /* __cplusplus */ 00090 00091 #define exist(name) rt_get_adr(nam2num(name)) 00092 00093 #endif /* !_RTAI_REGISTRY_H */

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