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 __KERNEL__
00057 
00058 #include <rtai.h>
00059 
00060 #ifdef __cplusplus
00061 extern "C" {
00062 #endif /* __cplusplus */
00063 
00064 unsigned long is_process_registered(struct task_struct *tsk);
00065 
00066 int rt_register(unsigned long nam,
00067         void *adr,
00068         int typ,
00069         struct task_struct *tsk);
00070 
00071 int rt_drg_on_name(unsigned long name);
00072 
00073 int rt_drg_on_name_cnt(unsigned long name);
00074 
00075 int rt_drg_on_adr(void *adr);
00076 
00077 int rt_drg_on_adr_cnt(void *adr);
00078 
00079 RTAI_SYSCALL_MODE unsigned long rt_get_name(void *adr);
00080 
00081 RTAI_SYSCALL_MODE void *rt_get_adr(unsigned long name);
00082 
00083 void *rt_get_adr_cnt(unsigned long name);
00084 
00085 int rt_get_type(unsigned long name);
00086 
00087 #ifdef CONFIG_PROC_FS
00088 int rt_get_registry_slot(int slot, struct rt_registry_entry *entry);
00089 #endif /* CONFIG_PROC_FS */
00090 
00091 #ifdef __cplusplus
00092 }
00093 #endif /* __cplusplus */
00094 
00095 #endif
00096 
00097 #define exist(name)  rt_get_adr(nam2num(name))
00098 
00099 #endif /* !_RTAI_REGISTRY_H */

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