00001
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_struct {
00035 unsigned long name;
00036 void *adr;
00037 struct task_struct *tsk;
00038 int pid;
00039 int type;
00040 int count;
00041 };
00042
00043 #define MAX_SLOTS CONFIG_RTAI_SCHED_LXRT_NUMSLOTS // Max number of registered objects
00044
00045 #define IS_TASK 0 // Used to identify registered resources
00046 #define IS_SEM 1
00047 #define IS_RWL 2
00048 #define IS_SPL 3
00049 #define IS_MBX 4
00050 #define IS_PRX 5
00051 #define IS_BIT 6
00052 #define IS_TBX 7
00053 #define IS_HPCK 8
00054
00055 #ifdef __cplusplus
00056 extern "C" {
00057 #endif
00058
00059 unsigned long is_process_registered(struct task_struct *tsk);
00060
00061 int rt_register(unsigned long nam,
00062 void *adr,
00063 int typ,
00064 struct task_struct *tsk);
00065
00066 int rt_drg_on_name(unsigned long name);
00067
00068 int rt_drg_on_name_cnt(unsigned long name);
00069
00070 int rt_drg_on_adr(void *adr);
00071
00072 int rt_drg_on_adr_cnt(void *adr);
00073
00074 unsigned long rt_get_name(void *adr);
00075
00076 void *rt_get_adr(unsigned long name);
00077
00078 void *rt_get_adr_cnt(unsigned long name);
00079
00080 int rt_get_type(unsigned long name);
00081
00082 #ifdef CONFIG_PROC_FS
00083 int rt_get_registry_slot(int slot,
00084 struct rt_registry_entry_struct *entry);
00085 #endif
00086
00087 #ifdef __cplusplus
00088 }
00089 #endif
00090
00091 #define exist(name) rt_get_adr(nam2num(name))
00092
00093 #endif