Blame


1 1e05fdf9 2005-11-04 devnull #define setcontext(u) setmcontext(&(u)->uc_mcontext)
2 1e05fdf9 2005-11-04 devnull #define getcontext(u) getmcontext(&(u)->uc_mcontext)
3 b4b68641 2005-07-20 devnull typedef struct mcontext mcontext_t;
4 b4b68641 2005-07-20 devnull typedef struct ucontext ucontext_t;
5 1041ea6f 2005-07-19 devnull
6 1041ea6f 2005-07-19 devnull extern int swapcontext(ucontext_t*, ucontext_t*);
7 1041ea6f 2005-07-19 devnull extern void makecontext(ucontext_t*, void(*)(), int, ...);
8 c54b8b69 2006-01-27 devnull extern int getmcontext(mcontext_t*);
9 784d6550 2006-01-27 devnull extern void setmcontext(mcontext_t*);
10 1041ea6f 2005-07-19 devnull
11 1041ea6f 2005-07-19 devnull /*-
12 1041ea6f 2005-07-19 devnull * Copyright (c) 1999 Marcel Moolenaar
13 1041ea6f 2005-07-19 devnull * All rights reserved.
14 1041ea6f 2005-07-19 devnull *
15 1041ea6f 2005-07-19 devnull * Redistribution and use in source and binary forms, with or without
16 1041ea6f 2005-07-19 devnull * modification, are permitted provided that the following conditions
17 1041ea6f 2005-07-19 devnull * are met:
18 1041ea6f 2005-07-19 devnull * 1. Redistributions of source code must retain the above copyright
19 1041ea6f 2005-07-19 devnull * notice, this list of conditions and the following disclaimer
20 1041ea6f 2005-07-19 devnull * in this position and unchanged.
21 1041ea6f 2005-07-19 devnull * 2. Redistributions in binary form must reproduce the above copyright
22 1041ea6f 2005-07-19 devnull * notice, this list of conditions and the following disclaimer in the
23 1041ea6f 2005-07-19 devnull * documentation and/or other materials provided with the distribution.
24 1041ea6f 2005-07-19 devnull * 3. The name of the author may not be used to endorse or promote products
25 1041ea6f 2005-07-19 devnull * derived from this software without specific prior written permission.
26 1041ea6f 2005-07-19 devnull *
27 1041ea6f 2005-07-19 devnull * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
28 1041ea6f 2005-07-19 devnull * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
29 1041ea6f 2005-07-19 devnull * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
30 1041ea6f 2005-07-19 devnull * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
31 1041ea6f 2005-07-19 devnull * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
32 1041ea6f 2005-07-19 devnull * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
33 1041ea6f 2005-07-19 devnull * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
34 1041ea6f 2005-07-19 devnull * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
35 1041ea6f 2005-07-19 devnull * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
36 1041ea6f 2005-07-19 devnull * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 1041ea6f 2005-07-19 devnull *
38 1041ea6f 2005-07-19 devnull * $FreeBSD: src/sys/sys/ucontext.h,v 1.4 1999/10/11 20:33:17 luoqi Exp $
39 1041ea6f 2005-07-19 devnull */
40 1041ea6f 2005-07-19 devnull
41 1041ea6f 2005-07-19 devnull /* #include <machine/ucontext.h> */
42 1041ea6f 2005-07-19 devnull
43 1041ea6f 2005-07-19 devnull /*-
44 1041ea6f 2005-07-19 devnull * Copyright (c) 1999 Marcel Moolenaar
45 1041ea6f 2005-07-19 devnull * All rights reserved.
46 1041ea6f 2005-07-19 devnull *
47 1041ea6f 2005-07-19 devnull * Redistribution and use in source and binary forms, with or without
48 1041ea6f 2005-07-19 devnull * modification, are permitted provided that the following conditions
49 1041ea6f 2005-07-19 devnull * are met:
50 1041ea6f 2005-07-19 devnull * 1. Redistributions of source code must retain the above copyright
51 1041ea6f 2005-07-19 devnull * notice, this list of conditions and the following disclaimer
52 1041ea6f 2005-07-19 devnull * in this position and unchanged.
53 1041ea6f 2005-07-19 devnull * 2. Redistributions in binary form must reproduce the above copyright
54 1041ea6f 2005-07-19 devnull * notice, this list of conditions and the following disclaimer in the
55 1041ea6f 2005-07-19 devnull * documentation and/or other materials provided with the distribution.
56 1041ea6f 2005-07-19 devnull * 3. The name of the author may not be used to endorse or promote products
57 1041ea6f 2005-07-19 devnull * derived from this software without specific prior written permission.
58 1041ea6f 2005-07-19 devnull *
59 1041ea6f 2005-07-19 devnull * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
60 1041ea6f 2005-07-19 devnull * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
61 1041ea6f 2005-07-19 devnull * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
62 1041ea6f 2005-07-19 devnull * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
63 1041ea6f 2005-07-19 devnull * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
64 1041ea6f 2005-07-19 devnull * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
65 1041ea6f 2005-07-19 devnull * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
66 1041ea6f 2005-07-19 devnull * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
67 1041ea6f 2005-07-19 devnull * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
68 1041ea6f 2005-07-19 devnull * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
69 1041ea6f 2005-07-19 devnull *
70 1041ea6f 2005-07-19 devnull * $FreeBSD: src/sys/i386/include/ucontext.h,v 1.4 1999/10/11 20:33:09 luoqi Exp $
71 1041ea6f 2005-07-19 devnull */
72 1041ea6f 2005-07-19 devnull
73 b4b68641 2005-07-20 devnull struct mcontext {
74 1041ea6f 2005-07-19 devnull /*
75 1041ea6f 2005-07-19 devnull * The first 20 fields must match the definition of
76 1041ea6f 2005-07-19 devnull * sigcontext. So that we can support sigcontext
77 1041ea6f 2005-07-19 devnull * and ucontext_t at the same time.
78 1041ea6f 2005-07-19 devnull */
79 1041ea6f 2005-07-19 devnull int mc_onstack; /* XXX - sigcontext compat. */
80 1041ea6f 2005-07-19 devnull int mc_gs;
81 1041ea6f 2005-07-19 devnull int mc_fs;
82 1041ea6f 2005-07-19 devnull int mc_es;
83 1041ea6f 2005-07-19 devnull int mc_ds;
84 1041ea6f 2005-07-19 devnull int mc_edi;
85 1041ea6f 2005-07-19 devnull int mc_esi;
86 1041ea6f 2005-07-19 devnull int mc_ebp;
87 1041ea6f 2005-07-19 devnull int mc_isp;
88 1041ea6f 2005-07-19 devnull int mc_ebx;
89 1041ea6f 2005-07-19 devnull int mc_edx;
90 1041ea6f 2005-07-19 devnull int mc_ecx;
91 1041ea6f 2005-07-19 devnull int mc_eax;
92 1041ea6f 2005-07-19 devnull int mc_trapno;
93 1041ea6f 2005-07-19 devnull int mc_err;
94 1041ea6f 2005-07-19 devnull int mc_eip;
95 1041ea6f 2005-07-19 devnull int mc_cs;
96 1041ea6f 2005-07-19 devnull int mc_eflags;
97 1041ea6f 2005-07-19 devnull int mc_esp; /* machine state */
98 1041ea6f 2005-07-19 devnull int mc_ss;
99 1041ea6f 2005-07-19 devnull
100 1041ea6f 2005-07-19 devnull int mc_fpregs[28]; /* env87 + fpacc87 + u_long */
101 1041ea6f 2005-07-19 devnull int __spare__[17];
102 b4b68641 2005-07-20 devnull };
103 1041ea6f 2005-07-19 devnull
104 b4b68641 2005-07-20 devnull struct ucontext {
105 1041ea6f 2005-07-19 devnull /*
106 1041ea6f 2005-07-19 devnull * Keep the order of the first two fields. Also,
107 1041ea6f 2005-07-19 devnull * keep them the first two fields in the structure.
108 1041ea6f 2005-07-19 devnull * This way we can have a union with struct
109 1041ea6f 2005-07-19 devnull * sigcontext and ucontext_t. This allows us to
110 1041ea6f 2005-07-19 devnull * support them both at the same time.
111 1041ea6f 2005-07-19 devnull * note: the union is not defined, though.
112 1041ea6f 2005-07-19 devnull */
113 1041ea6f 2005-07-19 devnull sigset_t uc_sigmask;
114 1041ea6f 2005-07-19 devnull mcontext_t uc_mcontext;
115 1041ea6f 2005-07-19 devnull
116 1041ea6f 2005-07-19 devnull struct __ucontext *uc_link;
117 1041ea6f 2005-07-19 devnull stack_t uc_stack;
118 1041ea6f 2005-07-19 devnull int __spare__[8];
119 b4b68641 2005-07-20 devnull };
120 1041ea6f 2005-07-19 devnull
121 1041ea6f 2005-07-19 devnull