1 .\"
2 .\" Mach Operating System
3 .\" Copyright (c) 1991,1990 Carnegie Mellon University
4 .\" All Rights Reserved.
5 .\"
6 .\" Permission to use, copy, modify and distribute this software and its
7 .\" documentation is hereby granted, provided that both the copyright
8 .\" notice and this permission notice appear in all copies of the
9 .\" software, derivative works or modified versions, and any portions
10 .\" thereof, and that both notices appear in supporting documentation.
11 .\"
12 .\" CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
13 .\" CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
14 .\" ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
15 .\"
16 .\" Carnegie Mellon requests users of this software to return to
17 .\"
18 .\" Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
19 .\" School of Computer Science
20 .\" Carnegie Mellon University
21 .\" Pittsburgh PA 15213-3890
22 .\"
23 .\" any improvements or extensions that they make and grant Carnegie Mellon
24 .\" the rights to redistribute these changes.
25 .\"
26 .\"
27 .\" HISTORY
28 .\" $Log: thread_get_state.man,v $
29 .\" Revision 2.2 93/03/18 15:15:44 mrt
30 .\" corrected types
31 .\" [93/03/12 16:54:08 lli]
32 .\"
33 .\" Revision 2.4 91/05/14 17:14:39 mrt
34 .\" Correcting copyright
35 .\"
36 .\" Revision 2.3 91/02/14 14:15:40 mrt
37 .\" Changed to new Mach copyright
38 .\" [91/02/12 18:16:31 mrt]
39 .\"
40 .\" Revision 2.2 90/08/07 18:46:38 rpd
41 .\" Created.
42 .\"
43 .TH thread_get_state 2 1/20/88
44 .CM 4
45 .SH NAME
46 .nf
47 thread_get_state \- return machine dependent state
48 thread_set_state \- set machine dependent state
49 .SH SYNOPSIS
50 .nf
51 .ft B
52 #include <mach.h>
53
54 .nf
55 .ft B
56 kern_return_t thread_get_state(target_thread, flavor, old_state,
57 old_stateCnt)
58 mach_port_t target_thread;
59 int flavor;
60 thread_state_t old_state; /* in and out */
61 mach_msg_type_number_t *old_stateCnt; /* in and out */
62
63
64 .fi
65 .ft P
66 .nf
67 .ft B
68 kern_return_t thread_set_state(target_thread, flavor, new_state,
69 new_stateCnt)
70 mach_port_t target_thread;
71 int flavor;
72 thread_state_t new_state;
73 mach_msg_type_number_t new_stateCnt;
74
75
76 .fi
77 .ft P
78 .SH ARGUMENTS
79 .TP 15
80 .B
81 target_thread
82 thread to get or set the state for.
83 .TP 15
84 .B
85 flavor
86 The type of state that is to be manipulated. Currently must
87 be one of the following values:
88 .B VAX_THREAD_STATE
89 ,
90 .B ROMP_THREAD_STATE
91 ,
92
93 .B SUN_THREAD_STATE_REGS
94 ,
95 .B SUN_THREAD_STATE_FPA
96 .TP 15
97 .B
98 new_state
99 an array of state information
100 .TP 15
101 .B
102 old_state
103 an array of state information
104 .TP 15
105 .B
106 new_stateCnt
107 the size of the state information array. Currently must
108 be one of the following values:
109 .B VAX_THREAD_STATE_COUNT
110 ,
111 .B ROMP_THREAD_STATE_COUNT
112 ,
113 .B SUN_THREAD_STATE_REGS_COUNT
114 ,
115 .B SUN_THREAD_STATE_FPA_COUNT
116 .TP 15
117 .B
118 old_stateCnt
119 same as
120 .B new_stateCnt
121
122 .SH DESCRIPTION
123
124 .B thread_get_state
125 returns the state component (e.g. the machine registers)
126 of
127 .B target_thread
128 as specified by
129 .B flavor
130 .
131 The
132 .B old_state
133 is an array of integers that is provided by the
134 caller and returned filled with the specified information.
135 .B old_stateCnt
136
137 is input set to the maximum number of integers in
138 .B old_state
139 and
140 returned equal to the actual
141 number of integers in
142 .B old_state
143 .
144
145 .B thread_set_state
146 sets the state component (e.g. the machine registers)
147 of
148 .B target_thread
149 as specified by
150 .B flavor
151 .
152 The
153 .B new_state
154 is an array of integers.
155 .B new_stateCnt
156 is the
157 number of elements in
158 .B new_state
159 . The entire set of registers
160 is reset. This will do unpredictable things if
161 .B target_thread
162 is not suspended.
163
164 .B target_thread
165 may not be
166 .B thread_self
167 for either of
168 these calls.
169
170 The definition of the state structures can be found in
171 <machine/thread_status.h>
172
173 .SH DIAGNOSTICS
174 .TP 25
175 KERN_SUCCESS
176 The state has been set or returned
177 .TP 25
178 MIG_ARRAY_TOO_LARGE
179 Returned state is too large for the
180 .B new_state
181 array.
182 .B new_state
183 is filled in as much
184 as possible and
185 .B new_stateCnt
186 is set to the
187 number of elements that would be returned if there were
188 enough room.
189 .TP 25
190 KERN_INVALID_ARGUMENT
191 .B target_thread
192 is not a thread or
193 is
194 .B thread_self
195 or
196 .B flavor
197 is unrecogized for this machine.
198
199 .SH SEE ALSO
200 .B task_info, thread_info
201
202
Cache object: c5a49bd184036f26b887bcd56953dcd0
|