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 #include <asm/xenomai/syscall.h>
00025
00026 #ifdef CONFIG_XENO_OPT_PERVASIVE
00027
00028 #define XENOMAI_MUX_NR 16
00029
00030
00031 #define XNSHADOW_CLIENT_ATTACH 0
00032 #define XNSHADOW_CLIENT_DETACH 1
00033
00034 #ifdef __cplusplus
00035 extern "C" {
00036 #endif
00037
00038 struct xnthread;
00039 struct xnmutex;
00040 struct pt_regs;
00041 struct timespec;
00042 struct timeval;
00043 struct xntbase;
00044 union xnsiginfo;
00045
00046 struct xnskin_props {
00047 const char *name;
00048 unsigned magic;
00049 int nrcalls;
00050 void *(*eventcb)(int, void *);
00051 int (*sig_unqueue)(struct xnthread *thread, union xnsiginfo __user *si);
00052 xnsysent_t *systab;
00053 struct xntbase **timebasep;
00054 struct module *module;
00055 };
00056
00057 struct xnskin_slot {
00058 struct xnskin_props *props;
00059 atomic_counter_t refcnt;
00060 };
00061
00062 int xnshadow_mount(void);
00063
00064 void xnshadow_cleanup(void);
00065
00066 void xnshadow_grab_events(void);
00067
00068 void xnshadow_release_events(void);
00069
00070 int xnshadow_map(struct xnthread *thread,
00071 xncompletion_t __user *u_completion,
00072 unsigned long __user *u_mode);
00073
00074 void xnshadow_unmap(struct xnthread *thread);
00075
00076 int xnshadow_harden(void);
00077
00078 void xnshadow_relax(int notify, int reason);
00079
00080 void xnshadow_renice(struct xnthread *thread);
00081
00082 void xnshadow_suspend(struct xnthread *thread);
00083
00084 int xnshadow_wait_barrier(struct pt_regs *regs);
00085
00086 void xnshadow_start(struct xnthread *thread);
00087
00088 void xnshadow_signal_completion(xncompletion_t __user *u_completion,
00089 int err);
00090
00091 void xnshadow_exit(void);
00092
00093 int xnshadow_register_interface(struct xnskin_props *props);
00094
00095 int xnshadow_unregister_interface(int muxid);
00096
00097 void xnshadow_reset_shield(void);
00098
00099 void xnshadow_send_sig(struct xnthread *thread,
00100 int sig,
00101 int arg,
00102 int specific);
00103
00104 void xnshadow_rpi_check(void);
00105
00106 extern struct xnskin_slot muxtable[];
00107
00108 int xnshadow_mark_sig(struct xnthread *thread, unsigned muxid);
00109
00110 void xnshadow_clear_sig(struct xnthread *thread, unsigned muxid);
00111
00112 #ifdef __cplusplus
00113 }
00114 #endif
00115
00116 #endif
00117
00118 #if defined(CONFIG_XENO_OPT_PERVASIVE) && defined(CONFIG_PROC_FS)
00119 void xnshadow_init_proc(void);
00120 void xnshadow_cleanup_proc(void);
00121 void xnshadow_declare_proc(struct xnskin_slot *iface);
00122 void xnshadow_remove_proc(const char *iface);
00123 #else
00124 static inline void xnshadow_init_proc(void) { }
00125 static inline void xnshadow_cleanup_proc(void) { }
00126 #define xnshadow_declare_proc(iface) do { (void)iface; } while(0)
00127 #define xnshadow_remove_proc(iface) do { (void)name; } while(0)
00128 #endif
00129
00130 #endif