00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
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;
00036 void *adr;
00037 struct task_struct *tsk;
00038 int type;
00039 unsigned short count;
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
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
00090
00091 #ifdef __cplusplus
00092 }
00093 #endif
00094
00095 #endif
00096
00097 #define exist(name) rt_get_adr(nam2num(name))
00098
00099 #endif