Blame


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