• Main Page
  • Related Pages
  • Modules
  • Data Structures
  • Files
  • Examples
  • File List
  • Globals

ksrc/skins/rtdm/internal.h

00001 /*
00002  * Copyright (C) 2005-2007 Jan Kiszka <jan.kiszka@web.de>.
00003  * Copyright (C) 2005 Joerg Langenberg <joerg.langenberg@gmx.net>.
00004  *
00005  * Xenomai is free software; you can redistribute it and/or modify it
00006  * under the terms of the GNU General Public License as published by
00007  * the Free Software Foundation; either version 2 of the License, or
00008  * (at your option) any later version.
00009  *
00010  * Xenomai is distributed in the hope that it will be useful, but
00011  * WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  * General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with Xenomai; if not, write to the Free Software Foundation,
00017  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00018  */
00019 
00020 #ifndef _RTDM_INTERNAL_H
00021 #define _RTDM_INTERNAL_H
00022 
00023 #include <nucleus/pod.h>
00024 #include <nucleus/ppd.h>
00025 #include <rtdm/rtdm_driver.h>
00026 
00027 #include <linux/list.h>
00028 #include <linux/sem.h>
00029 
00030 #ifndef CONFIG_XENO_OPT_DEBUG_RTDM_APPL
00031 #define CONFIG_XENO_OPT_DEBUG_RTDM_APPL 0
00032 #endif
00033 
00034 #define RTDM_FD_MAX                     CONFIG_XENO_OPT_RTDM_FILDES
00035 
00036 #define DEF_DEVNAME_HASHTAB_SIZE        256     /* entries in name hash table */
00037 #define DEF_PROTO_HASHTAB_SIZE          256     /* entries in protocol hash table */
00038 
00039 struct rtdm_fildes {
00040         struct rtdm_dev_context *context;
00041 };
00042 
00043 struct rtdm_process {
00044 #ifdef CONFIG_XENO_OPT_VFILE
00045         char name[32];
00046         pid_t pid;
00047 #endif /* CONFIG_XENO_OPT_VFILE */
00048 
00049         xnshadow_ppd_t ppd;
00050 };
00051 
00052 DECLARE_EXTERN_XNLOCK(rt_fildes_lock);
00053 DECLARE_EXTERN_XNLOCK(rt_dev_lock);
00054 
00055 extern int __rtdm_muxid;
00056 extern struct rtdm_fildes fildes_table[];
00057 extern int open_fildes;
00058 extern struct semaphore nrt_dev_lock;
00059 extern unsigned int devname_hashtab_size;
00060 extern unsigned int protocol_hashtab_size;
00061 extern struct list_head *rtdm_named_devices;
00062 extern struct list_head *rtdm_protocol_devices;
00063 
00064 #ifdef MODULE
00065 #define rtdm_initialised 1
00066 #else /* !MODULE */
00067 extern int rtdm_initialised;
00068 #endif /* MODULE */
00069 
00070 void cleanup_owned_contexts(void *user_info);
00071 int rtdm_no_support(void);
00072 struct rtdm_device *get_named_device(const char *name);
00073 struct rtdm_device *get_protocol_device(int protocol_family, int socket_type);
00074 
00075 static inline void rtdm_dereference_device(struct rtdm_device *device)
00076 {
00077         atomic_dec(&device->reserved.refcount);
00078 }
00079 
00080 int __init rtdm_dev_init(void);
00081 void rtdm_dev_cleanup(void);
00082 
00083 #ifdef CONFIG_XENO_OPT_VFILE
00084 int rtdm_proc_init(void);
00085 void rtdm_proc_cleanup(void);
00086 int rtdm_proc_register_device(struct rtdm_device *device);
00087 void rtdm_proc_unregister_device(struct rtdm_device *device);
00088 #else
00089 static inline int rtdm_proc_init(void)
00090 {
00091         return 0;
00092 }
00093 void rtdm_proc_cleanup(void)
00094 {
00095 }
00096 static int rtdm_proc_register_device(struct rtdm_device *device)
00097 {
00098         return 0;
00099 }
00100 static void rtdm_proc_unregister_device(struct rtdm_device *device)
00101 {
00102 }
00103 #endif
00104 
00105 void rtdm_apc_handler(void *cookie);
00106 
00107 #endif /* _RTDM_INTERNAL_H */

Generated on Wed Jan 23 2013 13:24:02 for Xenomai API by  doxygen 1.7.1