Blame


1 0c7c441e 2006-02-10 devnull /* Copyright (C) 2001 Free Software Foundation, Inc.
2 0c7c441e 2006-02-10 devnull This file is part of the GNU C Library.
3 0c7c441e 2006-02-10 devnull Contributed by Jakub Jelinek <jakub@redhat.com>.
4 0c7c441e 2006-02-10 devnull
5 0c7c441e 2006-02-10 devnull The GNU C Library is free software; you can redistribute it and/or
6 0c7c441e 2006-02-10 devnull modify it under the terms of the GNU Lesser General Public
7 0c7c441e 2006-02-10 devnull License as published by the Free Software Foundation; either
8 0c7c441e 2006-02-10 devnull version 2.1 of the License, or (at your option) any later version.
9 0c7c441e 2006-02-10 devnull
10 0c7c441e 2006-02-10 devnull The GNU C Library is distributed in the hope that it will be useful,
11 0c7c441e 2006-02-10 devnull but WITHOUT ANY WARRANTY; without even the implied warranty of
12 0c7c441e 2006-02-10 devnull MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 0c7c441e 2006-02-10 devnull Lesser General Public License for more details.
14 0c7c441e 2006-02-10 devnull
15 0c7c441e 2006-02-10 devnull You should have received a copy of the GNU Lesser General Public
16 0c7c441e 2006-02-10 devnull License along with the GNU C Library; if not, write to the Free
17 0c7c441e 2006-02-10 devnull Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
18 0c7c441e 2006-02-10 devnull 02111-1307 USA. */
19 0c7c441e 2006-02-10 devnull
20 0c7c441e 2006-02-10 devnull /* Constants shared between setcontext() and getcontext(). Don't
21 0c7c441e 2006-02-10 devnull install this header file. */
22 0c7c441e 2006-02-10 devnull
23 07b075d5 2006-02-16 devnull
24 0c7c441e 2006-02-10 devnull #define UC_LINK 0
25 0c7c441e 2006-02-10 devnull #define __UC_SIGMASK 16
26 0c7c441e 2006-02-10 devnull #define UC_M_PC 40
27 0c7c441e 2006-02-10 devnull #define UC_M_NPC 48
28 0c7c441e 2006-02-10 devnull #define UC_SIGMASK 536
29 0c7c441e 2006-02-10 devnull #define SIGMASK_WORDS 16
30 0c7c441e 2006-02-10 devnull
31 0c7c441e 2006-02-10 devnull /* Copyright (C) 1997, 2001 Free Software Foundation, Inc.
32 0c7c441e 2006-02-10 devnull This file is part of the GNU C Library.
33 0c7c441e 2006-02-10 devnull Contributed by Richard Henderson (rth@tamu.edu).
34 0c7c441e 2006-02-10 devnull
35 0c7c441e 2006-02-10 devnull The GNU C Library is free software; you can redistribute it and/or
36 0c7c441e 2006-02-10 devnull modify it under the terms of the GNU Lesser General Public
37 0c7c441e 2006-02-10 devnull License as published by the Free Software Foundation; either
38 0c7c441e 2006-02-10 devnull version 2.1 of the License, or (at your option) any later version.
39 0c7c441e 2006-02-10 devnull
40 0c7c441e 2006-02-10 devnull The GNU C Library is distributed in the hope that it will be useful,
41 0c7c441e 2006-02-10 devnull but WITHOUT ANY WARRANTY; without even the implied warranty of
42 0c7c441e 2006-02-10 devnull MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
43 0c7c441e 2006-02-10 devnull Lesser General Public License for more details.
44 0c7c441e 2006-02-10 devnull
45 0c7c441e 2006-02-10 devnull You should have received a copy of the GNU Lesser General Public
46 0c7c441e 2006-02-10 devnull License along with the GNU C Library; if not, write to the Free
47 0c7c441e 2006-02-10 devnull Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
48 0c7c441e 2006-02-10 devnull 02111-1307 USA. */
49 0c7c441e 2006-02-10 devnull
50 229086e7 2006-02-16 devnull #define ENTRY(x) x:
51 07b075d5 2006-02-16 devnull #define END(x)
52 07b075d5 2006-02-16 devnull
53 0c7c441e 2006-02-10 devnull /*#include "ucontext_i.h" (up above) */
54 0c7c441e 2006-02-10 devnull
55 0c7c441e 2006-02-10 devnull /* int getcontext(ucontext_t *); */
56 0c7c441e 2006-02-10 devnull
57 07b075d5 2006-02-16 devnull ENTRY(getcontext)
58 0c7c441e 2006-02-10 devnull
59 0c7c441e 2006-02-10 devnull ldx [%o0 + UC_LINK], %o1 /* Preserve uc_link field, the
60 0c7c441e 2006-02-10 devnull trap clears it. */
61 0c7c441e 2006-02-10 devnull ta 0x6e
62 0c7c441e 2006-02-10 devnull 1:
63 0c7c441e 2006-02-10 devnull ldx [%o0 + UC_M_PC], %o2
64 0c7c441e 2006-02-10 devnull ldx [%o0 + UC_M_NPC], %o3
65 0c7c441e 2006-02-10 devnull ldx [%o0 + __UC_SIGMASK], %o4
66 0c7c441e 2006-02-10 devnull stx %o1, [%o0 + UC_LINK]
67 0c7c441e 2006-02-10 devnull add %o2, 2f - 1b, %o2
68 0c7c441e 2006-02-10 devnull stx %o2, [%o0 + UC_M_PC]
69 0c7c441e 2006-02-10 devnull add %o3, 2f - 1b, %o3
70 0c7c441e 2006-02-10 devnull stx %o3, [%o0 + UC_M_NPC]
71 0c7c441e 2006-02-10 devnull #if SIGMASK_WORDS == 16
72 0c7c441e 2006-02-10 devnull stx %o4, [%o0 + UC_SIGMASK]
73 0c7c441e 2006-02-10 devnull stx %g0, [%o0 + UC_SIGMASK + 8]
74 0c7c441e 2006-02-10 devnull stx %g0, [%o0 + UC_SIGMASK + 16]
75 0c7c441e 2006-02-10 devnull stx %g0, [%o0 + UC_SIGMASK + 24]
76 0c7c441e 2006-02-10 devnull stx %g0, [%o0 + UC_SIGMASK + 32]
77 0c7c441e 2006-02-10 devnull stx %g0, [%o0 + UC_SIGMASK + 40]
78 0c7c441e 2006-02-10 devnull stx %g0, [%o0 + UC_SIGMASK + 48]
79 0c7c441e 2006-02-10 devnull stx %g0, [%o0 + UC_SIGMASK + 56]
80 0c7c441e 2006-02-10 devnull stx %g0, [%o0 + UC_SIGMASK + 64]
81 0c7c441e 2006-02-10 devnull stx %g0, [%o0 + UC_SIGMASK + 72]
82 0c7c441e 2006-02-10 devnull stx %g0, [%o0 + UC_SIGMASK + 80]
83 0c7c441e 2006-02-10 devnull stx %g0, [%o0 + UC_SIGMASK + 88]
84 0c7c441e 2006-02-10 devnull stx %g0, [%o0 + UC_SIGMASK + 96]
85 0c7c441e 2006-02-10 devnull stx %g0, [%o0 + UC_SIGMASK + 104]
86 0c7c441e 2006-02-10 devnull stx %g0, [%o0 + UC_SIGMASK + 112]
87 0c7c441e 2006-02-10 devnull stx %g0, [%o0 + UC_SIGMASK + 120]
88 0c7c441e 2006-02-10 devnull #else
89 07b075d5 2006-02-16 devnull # error Adjust getcontext
90 0c7c441e 2006-02-10 devnull #endif
91 0c7c441e 2006-02-10 devnull 2:
92 0c7c441e 2006-02-10 devnull retl
93 0c7c441e 2006-02-10 devnull clr %o0
94 0c7c441e 2006-02-10 devnull
95 07b075d5 2006-02-16 devnull END(getcontext)
96 0c7c441e 2006-02-10 devnull
97 0c7c441e 2006-02-10 devnull /* Copyright (C) 1997, 2001 Free Software Foundation, Inc.
98 0c7c441e 2006-02-10 devnull This file is part of the GNU C Library.
99 0c7c441e 2006-02-10 devnull Contributed by Richard Henderson (rth@tamu.edu).
100 0c7c441e 2006-02-10 devnull
101 0c7c441e 2006-02-10 devnull The GNU C Library is free software; you can redistribute it and/or
102 0c7c441e 2006-02-10 devnull modify it under the terms of the GNU Lesser General Public
103 0c7c441e 2006-02-10 devnull License as published by the Free Software Foundation; either
104 0c7c441e 2006-02-10 devnull version 2.1 of the License, or (at your option) any later version.
105 0c7c441e 2006-02-10 devnull
106 0c7c441e 2006-02-10 devnull The GNU C Library is distributed in the hope that it will be useful,
107 0c7c441e 2006-02-10 devnull but WITHOUT ANY WARRANTY; without even the implied warranty of
108 0c7c441e 2006-02-10 devnull MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
109 0c7c441e 2006-02-10 devnull Lesser General Public License for more details.
110 0c7c441e 2006-02-10 devnull
111 0c7c441e 2006-02-10 devnull You should have received a copy of the GNU Lesser General Public
112 0c7c441e 2006-02-10 devnull License along with the GNU C Library; if not, write to the Free
113 0c7c441e 2006-02-10 devnull Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
114 0c7c441e 2006-02-10 devnull 02111-1307 USA. */
115 0c7c441e 2006-02-10 devnull
116 0c7c441e 2006-02-10 devnull /*
117 0c7c441e 2006-02-10 devnull #include <sysdep.h>
118 0c7c441e 2006-02-10 devnull #include "ucontext_i.h"
119 0c7c441e 2006-02-10 devnull */
120 0c7c441e 2006-02-10 devnull
121 0c7c441e 2006-02-10 devnull /* int setcontext(ucontext_t *ctx); */
122 0c7c441e 2006-02-10 devnull .weak setcontext
123 0c7c441e 2006-02-10 devnull ENTRY(setcontext)
124 0c7c441e 2006-02-10 devnull
125 0c7c441e 2006-02-10 devnull mov 1, %o1
126 0c7c441e 2006-02-10 devnull
127 0c7c441e 2006-02-10 devnull /* int __setcontext(ucontext_t *ctx, int restoremask); */
128 0c7c441e 2006-02-10 devnull ENTRY(__setcontext)
129 0c7c441e 2006-02-10 devnull
130 0c7c441e 2006-02-10 devnull ldx [%o0 + UC_SIGMASK], %o2
131 0c7c441e 2006-02-10 devnull stx %o2, [%o0 + __UC_SIGMASK]
132 0c7c441e 2006-02-10 devnull ta 0x6f
133 0c7c441e 2006-02-10 devnull
134 0c7c441e 2006-02-10 devnull END(__setcontext)
135 05eb37f2 2006-02-14 devnull