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 #ifdef CONFIG_PROC_FS
00026 #include <linux/proc_fs.h>
00027 #endif
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
00045 struct xnskentry {
00046
00047 const char *name;
00048 unsigned magic;
00049 int nrcalls;
00050 atomic_counter_t refcnt;
00051 void *(*eventcb)(int, void *);
00052 xnsysent_t *systab;
00053 #ifdef CONFIG_PROC_FS
00054 struct proc_dir_entry *proc;
00055 #endif
00056 struct module *module;
00057 };
00058
00059 int xnshadow_mount(void);
00060
00061 void xnshadow_cleanup(void);
00062
00063 void xnshadow_grab_events(void);
00064
00065 void xnshadow_release_events(void);
00066
00067 int xnshadow_map(struct xnthread *thread,
00068 xncompletion_t __user *u_completion);
00069
00070 void xnshadow_unmap(struct xnthread *thread);
00071
00072 int xnshadow_harden(void);
00073
00074 void xnshadow_relax(int notify);
00075
00076 void xnshadow_renice(struct xnthread *thread);
00077
00078 void xnshadow_suspend(struct xnthread *thread);
00079
00080 int xnshadow_wait_barrier(struct pt_regs *regs);
00081
00082 void xnshadow_start(struct xnthread *thread);
00083
00084 void xnshadow_signal_completion(xncompletion_t __user *u_completion,
00085 int err);
00086
00087 void xnshadow_exit(void);
00088
00089 int xnshadow_register_interface(const char *name,
00090 unsigned magic,
00091 int nrcalls,
00092 xnsysent_t *systab,
00093 void *(*eventcb)(int event, void *data),
00094 struct module *module);
00095
00096 int xnshadow_unregister_interface(int muxid);
00097
00098 unsigned long long xnshadow_ts2ticks(const struct timespec *v);
00099
00100 void xnshadow_ticks2ts(unsigned long long,
00101 struct timespec *v);
00102
00103 unsigned long long xnshadow_tv2ticks(const struct timeval *v);
00104
00105 void xnshadow_ticks2tv(unsigned long long ticks,
00106 struct timeval *v);
00107
00108 void xnshadow_reset_shield(void);
00109
00110 void xnshadow_send_sig(struct xnthread *thread,
00111 int sig,
00112 int specific);
00113
00114 extern struct xnskentry muxtable[];
00115
00116 #ifdef __cplusplus
00117 }
00118 #endif
00119
00120 #endif