shadow.h

00001 /*
00002  * Copyright (C) 2001,2002,2003 Philippe Gerum <rpm@xenomai.org>.
00003  *
00004  * RTAI/fusion is free software; you can redistribute it and/or modify
00005  * it under the terms of the GNU General Public License as published
00006  * by the Free Software Foundation; either version 2 of the License,
00007  * or (at your option) any later version.
00008  *
00009  * RTAI/fusion is distributed in the hope that it will be useful, but
00010  * WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with RTAI/fusion; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
00017  * 02111-1307, USA.
00018  */
00019 
00020 #ifndef _RTAI_NUCLEUS_SHADOW_H
00021 #define _RTAI_NUCLEUS_SHADOW_H
00022 
00023 #include <nucleus/asm/atomic.h>
00024 #include <nucleus/asm/syscall.h>
00025 #ifdef CONFIG_PROC_FS
00026 #include <linux/proc_fs.h>
00027 #endif /* CONFIG_PROC_FS */
00028 
00029 #define XENOMAI_MUX_NR 16
00030 
00031 /* Events sent to the interface callback */
00032 #define XNSHADOW_CLIENT_ATTACH  0
00033 #define XNSHADOW_CLIENT_DETACH  1
00034 
00035 #ifdef __cplusplus
00036 extern "C" {
00037 #endif
00038 
00039 struct xnthread;
00040 struct xnmutex;
00041 struct pt_regs;
00042 struct timespec;
00043 struct timeval;
00044 
00045 struct xnskentry {
00046 
00047     const char *name;
00048     unsigned magic;
00049     int nrcalls;
00050     atomic_counter_t refcnt;
00051     int (*eventcb)(int);
00052     xnsysent_t *systab;
00053 #ifdef CONFIG_PROC_FS
00054     struct proc_dir_entry *proc;
00055 #endif /* CONFIG_PROC_FS */
00056 };
00057 
00058 int xnshadow_mount(void);
00059 
00060 void xnshadow_cleanup(void);
00061 
00062 void xnshadow_grab_events(void);
00063 
00064 void xnshadow_release_events(void);
00065 
00066 int xnshadow_map(struct xnthread *thread,
00067                  xncompletion_t __user *u_completion);
00068 
00069 void xnshadow_unmap(struct xnthread *thread);
00070 
00071 void xnshadow_relax(int notify);
00072 
00073 void xnshadow_renice(struct xnthread *thread);
00074 
00075 void xnshadow_suspend(struct xnthread *thread);
00076 
00077 int xnshadow_wait_barrier(struct pt_regs *regs);
00078 
00079 void xnshadow_start(struct xnthread *thread);
00080 
00081 void xnshadow_signal_completion(xncompletion_t __user *u_completion,
00082                                 int err);
00083 
00084 void xnshadow_exit(void);
00085 
00086 int xnshadow_register_interface(const char *name,
00087                                 unsigned magic,
00088                                 int nrcalls,
00089                                 xnsysent_t *systab,
00090                                 int (*eventcb)(int event));
00091 
00092 int xnshadow_unregister_interface(int muxid);
00093 
00094 unsigned long long xnshadow_ts2ticks(const struct timespec *v);
00095 
00096 void xnshadow_ticks2ts(unsigned long long,
00097                        struct timespec *v);
00098 
00099 unsigned long long xnshadow_tv2ticks(const struct timeval *v);
00100 
00101 void xnshadow_ticks2tv(unsigned long long ticks,
00102                        struct timeval *v);
00103 
00104 void xnshadow_reset_shield(void);
00105 
00106 extern struct xnskentry muxtable[];
00107 
00108 #ifdef __cplusplus
00109 }
00110 #endif
00111 
00112 #endif /* !_RTAI_NUCLEUS_SHADOW_H */

Generated on Wed Jun 22 22:54:02 2005 for RTAI Fusion API by  doxygen 1.4.1