shadow.h

00001 /*
00002  * Copyright (C) 2001,2002,2003 Philippe Gerum <rpm@xenomai.org>.
00003  *
00004  * Xenomai is free software; you can redistribute it and/or modify it
00005  * under the terms of the GNU General Public License as published by
00006  * the Free Software Foundation; either version 2 of the License, or
00007  * (at your option) any later version.
00008  *
00009  * Xenomai 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 Xenomai; if not, write to the Free Software Foundation,
00016  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00017  *
00018  * As a special exception, the RTAI project gives permission
00019  * for additional uses of the text contained in its release of
00020  * Xenomai.
00021  *
00022  * The exception is that, if you link the Xenomai libraries with other
00023  * files to produce an executable, this does not by itself cause the
00024  * resulting executable to be covered by the GNU General Public License.
00025  * Your use of that executable is in no way restricted on account of
00026  * linking the Xenomai libraries code into it.
00027  *
00028  * This exception does not however invalidate any other reasons why
00029  * the executable file might be covered by the GNU General Public
00030  * License.
00031  *
00032  * This exception applies only to the code released by the
00033  * RTAI project under the name Xenomai.  If you copy code from other
00034  * RTAI project releases into a copy of Xenomai, as the General Public
00035  * License permits, the exception does not apply to the code that you
00036  * add in this way.  To avoid misleading anyone as to the status of
00037  * such modified files, you must delete this exception notice from
00038  * them.
00039  *
00040  * If you write modifications of your own for Xenomai, it is your
00041  * choice whether to permit this exception to apply to your
00042  * modifications. If you do not wish that, delete this exception
00043  * notice.
00044  */
00045 
00046 #ifndef _RTAI_NUCLEUS_SHADOW_H
00047 #define _RTAI_NUCLEUS_SHADOW_H
00048 
00049 #include <nucleus/asm/syscall.h>
00050 #include <nucleus/asm/atomic.h>
00051 
00052 #define XENOMAI_MUX_NR 16
00053 
00054 #define XNSHADOW_MAXRQ 16
00055 
00056 /* Events sent to the interface callback */
00057 #define XNSHADOW_CLIENT_ATTACH  0
00058 #define XNSHADOW_CLIENT_DETACH  1
00059 
00060 #ifdef __cplusplus
00061 extern "C" {
00062 #endif
00063 
00064 struct xnthread;
00065 struct xnmutex;
00066 struct pt_regs;
00067 struct timespec;
00068 struct timeval;
00069 
00070 struct xnskentry {
00071 
00072     const char *name;
00073     unsigned magic;
00074     int nrcalls;
00075     atomic_counter_t refcnt;
00076     int (*eventcb)(int);
00077     xnsysent_t *systab;
00078 };
00079 
00080 int xnshadow_mount(void);
00081 
00082 void xnshadow_cleanup(void);
00083 
00084 void xnshadow_grab_events(void);
00085 
00086 void xnshadow_release_events(void);
00087 
00088 void xnshadow_map(struct xnthread *thread,
00089                   pid_t syncpid,
00090                   int __user *u_syncp);
00091 
00092 void xnshadow_unmap(struct xnthread *thread);
00093 
00094 void xnshadow_relax(void);
00095 
00096 void xnshadow_harden(void);
00097 
00098 void xnshadow_renice(struct xnthread *thread);
00099 
00100 int xnshadow_wait_barrier(struct pt_regs *regs);
00101 
00102 void xnshadow_start(struct xnthread *thread,
00103                     void (*uentry)(void *cookie),
00104                     void *ucookie);
00105 
00106 void xnshadow_sync_post(pid_t syncpid,
00107                         int *u_syncp,
00108                         int err);
00109 
00110 void xnshadow_exit(void);
00111 
00112 int xnshadow_register_skin(const char *name,
00113                            unsigned magic,
00114                            int nrcalls,
00115                            xnsysent_t *systab,
00116                            int (*eventcb)(int event));
00117 
00118 int xnshadow_unregister_skin(int muxid);
00119 
00120 unsigned long long xnshadow_ts2ticks(const struct timespec *v);
00121 
00122 void xnshadow_ticks2ts(unsigned long long,
00123                        struct timespec *v);
00124 
00125 unsigned long long xnshadow_tv2ticks(const struct timeval *v);
00126 
00127 void xnshadow_ticks2tv(unsigned long long ticks,
00128                        struct timeval *v);
00129 
00130 extern struct xnskentry muxtable[];
00131 
00132 #ifdef __cplusplus
00133 }
00134 #endif
00135 
00136 #endif /* !_RTAI_NUCLEUS_SHADOW_H */

Generated on Mon Dec 13 09:49:49 2004 for RTAI API by  doxygen 1.3.9.1