00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _XENO_NUCLEUS_SHADOW_H
00021 #define _XENO_NUCLEUS_SHADOW_H
00022
00023 #include <asm/xenomai/atomic.h>
00024
00025 #ifdef CONFIG_XENO_OPT_PERVASIVE
00026
00027 #include <asm/xenomai/syscall.h>
00028
00029 #define XENOMAI_MUX_NR 16
00030
00031
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 struct xntbase;
00045 union xnsiginfo;
00046
00047 struct xnskin_props {
00048 const char *name;
00049 unsigned magic;
00050 int nrcalls;
00051 void *(*eventcb)(int, void *);
00052 int (*sig_unqueue)(struct xnthread *thread, union xnsiginfo __user *si);
00053 xnsysent_t *systab;
00054 struct xntbase **timebasep;
00055 struct module *module;
00056 };
00057
00058 struct xnskin_slot {
00059 struct xnskin_props *props;
00060 atomic_counter_t refcnt;
00061 };
00062
00063 int xnshadow_mount(void);
00064
00065 void xnshadow_cleanup(void);
00066
00067 void xnshadow_grab_events(void);
00068
00069 void xnshadow_release_events(void);
00070
00071 int xnshadow_map(struct xnthread *thread,
00072 xncompletion_t __user *u_completion,
00073 unsigned long __user *u_mode);
00074
00075 void xnshadow_unmap(struct xnthread *thread);
00076
00077 int xnshadow_harden(void);
00078
00079 void xnshadow_relax(int notify, int reason);
00080
00081 void xnshadow_renice(struct xnthread *thread);
00082
00083 void xnshadow_suspend(struct xnthread *thread);
00084
00085 int xnshadow_wait_barrier(struct pt_regs *regs);
00086
00087 void xnshadow_start(struct xnthread *thread);
00088
00089 void xnshadow_signal_completion(xncompletion_t __user *u_completion,
00090 int err);
00091
00092 void xnshadow_exit(void);
00093
00094 int xnshadow_register_interface(struct xnskin_props *props);
00095
00096 int xnshadow_unregister_interface(int muxid);
00097
00098 void xnshadow_reset_shield(void);
00099
00100 void xnshadow_send_sig(struct xnthread *thread,
00101 int sig,
00102 int arg,
00103 int specific);
00104
00105 void xnshadow_rpi_check(void);
00106
00107 extern struct xnskin_slot muxtable[];
00108
00109 int xnshadow_mark_sig(struct xnthread *thread, unsigned muxid);
00110
00111 void xnshadow_clear_sig(struct xnthread *thread, unsigned muxid);
00112
00113 #ifdef RTHAL_HAVE_RETURN_EVENT
00114 #define XNARCH_HAVE_MAYDAY 1
00115 void xnshadow_call_mayday(struct xnthread *thread, int sigtype);
00116 #else
00117 static inline void xnshadow_call_mayday(struct xnthread *thread,
00118 int sigtype)
00119 {
00120
00121 }
00122 #endif
00123
00124 #ifdef __cplusplus
00125 }
00126 #endif
00127
00128 #endif
00129
00130 #if defined(CONFIG_XENO_OPT_PERVASIVE) && defined(CONFIG_PROC_FS)
00131 void xnshadow_init_proc(void);
00132 void xnshadow_cleanup_proc(void);
00133 void xnshadow_declare_proc(struct xnskin_slot *iface);
00134 void xnshadow_remove_proc(const char *iface);
00135 #else
00136 static inline void xnshadow_init_proc(void) { }
00137 static inline void xnshadow_cleanup_proc(void) { }
00138 #define xnshadow_declare_proc(iface) do { (void)iface; } while(0)
00139 #define xnshadow_remove_proc(iface) do { (void)name; } while(0)
00140 #endif
00141
00142 #endif