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 _xenomai_shadow_h 00047 #define _xenomai_shadow_h 00048 00049 #include <asm/rtai_xncall.h> 00050 00051 #define XNSHADOW_MAXRQ 16 00052 00053 #ifdef __cplusplus 00054 extern "C" { 00055 #endif 00056 00057 struct xnthread; 00058 struct xnmutex; 00059 struct pt_regs; 00060 struct timespec; 00061 struct timeval; 00062 00063 int xnshadow_init(void); 00064 00065 void xnshadow_cleanup(void); 00066 00067 void xnshadow_map(struct xnthread *thread, 00068 const char *name, 00069 int prio, 00070 pid_t syncpid, 00071 int *u_syncp, 00072 unsigned magic, 00073 struct xnmutex *imutex); 00074 00075 void xnshadow_unmap(struct xnthread *thread); 00076 00077 void xnshadow_relax(void); 00078 00079 void xnshadow_harden(struct xnmutex *imutex); 00080 00081 void xnshadow_renice(struct xnthread *thread); 00082 00083 void xnshadow_start(struct xnthread *thread, 00084 u_long mode, 00085 void (*uentry)(void *cookie), 00086 void *ucookie, 00087 int resched); 00088 00089 int xnshadow_register_skin(unsigned magic, 00090 int nrcalls, 00091 xnsysent_t *systab); 00092 00093 int xnshadow_unregister_skin(int muxid); 00094 00095 void xnshadow_exit(void); 00096 00097 static inline void xnshadow_schedule (void) { 00098 XENOMAI_SYSCALL0(__xn_sys_sched); 00099 } 00100 00101 unsigned long long xnshadow_ts2ticks(const struct timespec *v); 00102 00103 void xnshadow_ticks2ts(unsigned long long ticks, 00104 struct timespec *v); 00105 00106 unsigned long long xnshadow_tv2ticks(const struct timeval *v); 00107 00108 void xnshadow_ticks2tv(unsigned long long ticks, 00109 struct timeval *v); 00110 00111 #ifdef __cplusplus 00112 } 00113 #endif 00114 00115 #endif /* !_xenomai_shadow_h */