Xenomai API  2.6.5
shadow.h
1 /*
2  * Copyright (C) 2001,2002,2003 Philippe Gerum <[email protected]>.
3  *
4  * Xenomai is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published
6  * by the Free Software Foundation; either version 2 of the License,
7  * or (at your option) any later version.
8  *
9  * Xenomai is distributed in the hope that it will be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with Xenomai; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
17  * 02111-1307, USA.
18  */
19 
20 #ifndef _XENO_NUCLEUS_SHADOW_H
21 #define _XENO_NUCLEUS_SHADOW_H
22 
23 #include <asm/xenomai/atomic.h>
24 
25 #ifdef CONFIG_XENO_OPT_PERVASIVE
26 
27 #include <asm/xenomai/syscall.h>
28 
29 #define XENOMAI_MUX_NR 16
30 
31 /* Events sent to the interface callback */
32 #define XNSHADOW_CLIENT_ATTACH 0
33 #define XNSHADOW_CLIENT_DETACH 1
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
39 struct xnthread;
40 struct xnmutex;
41 struct pt_regs;
42 struct timespec;
43 struct timeval;
44 struct xntbase;
45 
46 struct xnskin_props {
47  const char *name;
48  unsigned magic;
49  int nrcalls;
50  void *(*eventcb)(int, void *);
51  xnsysent_t *systab;
52  struct xntbase **timebasep;
53  struct module *module;
54 };
55 
56 int xnshadow_mount(void);
57 
58 void xnshadow_cleanup(void);
59 
60 void xnshadow_grab_events(void);
61 
62 void xnshadow_release_events(void);
63 
64 int xnshadow_map(struct xnthread *curr,
65  xncompletion_t __user *u_completion,
66  unsigned long __user *u_mode_offset);
67 
68 void xnshadow_unmap(struct xnthread *thread);
69 
70 int xnshadow_harden(void);
71 
72 void xnshadow_relax(int notify, int reason);
73 
74 void xnshadow_renice(struct xnthread *thread);
75 
76 void xnshadow_suspend(struct xnthread *thread);
77 
78 int xnshadow_wait_barrier(struct pt_regs *regs);
79 
80 void xnshadow_start(struct xnthread *thread);
81 
82 void xnshadow_signal_completion(xncompletion_t __user *u_completion,
83  int err);
84 
85 void xnshadow_exit(void);
86 
87 int xnshadow_register_interface(struct xnskin_props *props);
88 
89 int xnshadow_unregister_interface(int muxid);
90 
91 void xnshadow_reset_shield(void);
92 
93 void xnshadow_send_sig(struct xnthread *thread,
94  int sig,
95  int arg,
96  int specific);
97 
98 void xnshadow_rpi_check(void);
99 
100 #ifdef RTHAL_HAVE_RETURN_EVENT
101 #define XNARCH_HAVE_MAYDAY 1
102 void xnshadow_call_mayday(struct xnthread *thread);
103 #else
104 static inline void xnshadow_call_mayday(struct xnthread *thread)
105 {
106  /* no luck, I-pipe too old. Nobody hears you screaming... */
107 }
108 #endif
109 
110 #ifdef __cplusplus
111 }
112 #endif
113 
114 #endif /* CONFIG_XENO_OPT_PERVASIVE */
115 
116 #if defined(CONFIG_XENO_OPT_PERVASIVE) && defined(CONFIG_XENO_OPT_VFILE)
117 void xnshadow_init_proc(void);
118 void xnshadow_cleanup_proc(void);
119 #else
120 static inline void xnshadow_init_proc(void) { }
121 static inline void xnshadow_cleanup_proc(void) { }
122 #endif /* CONFIG_XENO_OPT_PERVASIVE && CONFIG_XENO_OPT_VFILE */
123 
124 #endif /* !_XENO_NUCLEUS_SHADOW_H */
int xnshadow_map(struct xnthread *curr, xncompletion_t __user *u_completion, unsigned long __user *u_mode_offset)
Create a shadow thread context.
Definition: shadow.c:1274
int xnshadow_harden(void)
Migrate a Linux task to the Xenomai domain.
Definition: shadow.c:939
void xnshadow_relax(int notify, int reason)
Switch a shadow thread back to the Linux domain.
Definition: shadow.c:1109