Print this page
| Split |
Close |
| Expand all |
| Collapse all |
--- old/usr/src/man/man3proc/Plwp_getregs.3proc
+++ new/usr/src/man/man3proc/Plwp_getregs.3proc
1 1 .\"
2 2 .\" This file and its contents are supplied under the terms of the
3 3 .\" Common Development and Distribution License ("CDDL"), version 1.0.
4 4 .\" You may only use this file in accordance with the terms of version
5 5 .\" 1.0 of the CDDL.
6 6 .\"
7 7 .\" A full copy of the text of the CDDL should have accompanied this
8 8 .\" source. A copy of the CDDL is also available via the Internet at
9 9 .\" http://www.illumos.org/license/CDDL.
10 10 .\"
11 11 .\"
12 12 .\" Copyright 2015 Joyent, Inc.
13 13 .\" Copyright 2023 Oxide Computer Company
14 14 .\"
15 15 .Dd January 19, 2023
16 16 .Dt PLWP_GETREGS 3PROC
17 17 .Os
18 18 .Sh NAME
19 19 .Nm Plwp_getfpregs ,
20 20 .Nm Plwp_setfpregs ,
21 21 .Nm Plwp_getregs ,
22 22 .Nm Plwp_setregs ,
23 23 .Nm Lgetfpregs ,
24 24 .Nm Lsetfpregs ,
25 25 .Nm Lgetregs ,
26 26 .Nm Lsetregs
27 27 .Nd get and set thread registers
28 28 .Sh LIBRARY
29 29 .Lb libproc
30 30 .Sh SYNOPSIS
31 31 .In libproc.h
32 32 .Ft int
33 33 .Fo Plwp_getfpregs
34 34 .Fa "struct ps_prochandle *P"
35 35 .Fa "lwpid_t lwpid"
36 36 .Fa "prfpregset_t *fpregs"
37 37 .Fc
38 38 .Ft int
39 39 .Fo Plwp_setfpregs
40 40 .Fa "struct ps_prochandle *P"
41 41 .Fa "lwpid_t lwpid"
42 42 .Fa "const prfpregset_t fpregs"
43 43 .Fc
44 44 .Ft int
45 45 .Fo Plwp_getregs
46 46 .Fa "struct ps_prochandle *P"
47 47 .Fa "lwpid_t lwpid"
48 48 .Fa "prgregset_t gregs"
49 49 .Fc
50 50 .Ft int
51 51 .Fo Plwp_setregs
52 52 .Fa "struct ps_prochandle *P"
53 53 .Fa "lwpid_t lwpid"
54 54 .Fa "const prgregset_t gregs"
55 55 .Fc
56 56 .Ft int
57 57 .Fo Lgetfpregs
58 58 .Fa "struct ps_lwphandle *L"
59 59 .Fa "prfpregset_t *fpregs"
60 60 .Fc
61 61 .Ft int
62 62 .Fo Lsetfpregs
63 63 .Fa "struct ps_lwphandle *L"
64 64 .Fa "const prfpregset_t *fpregs"
65 65 .Fc
66 66 .Ft int
67 67 .Fo Lgetregs
68 68 .Fa "struct ps_lwphandle *L"
69 69 .Fa "prgregset_t gregs"
70 70 .Fc
71 71 .Ft int
72 72 .Fo Lsetregs
73 73 .Fa "struct ps_lwphandle *L"
74 74 .Fa "const prgregset_t gregs"
75 75 .Fc
76 76 .Sh DESCRIPTION
77 77 The
78 78 .Fn Plwp_getregs ,
79 79 .Fn Plwp_setregs ,
80 80 .Fn Plwp_getfpregs ,
81 81 and
82 82 .Fn Plwp_setfpregs
83 83 functions allow one to get and set the general purpose and floating
84 84 point registers from the thread
85 85 .Fa lwpid
86 86 in the process handle
87 87 .Fa P .
88 88 .Pp
89 89 The
90 90 .Fn Plwp_getfpregs
91 91 function updates the structure pointed to by
92 92 .Fa fpregs
93 93 with the state and values of the floating point registers of the thread
94 94 specified by
95 95 .Fa lwpid .
96 96 .Pp
97 97 The
98 98 .Fn Plwp_setfpregs
99 99 function updates the floating point registers of the thread specified by
100 100 .Fa lwpid
101 101 to the register state contained in
102 102 .Fa fpregs .
103 103 .Pp
104 104 The
105 105 .Fn Plwp_getregs
106 106 function updates the structure pointed to by
107 107 .Fa gregs
108 108 with the state and values of the general purpose registers of the thread
109 109 specified by
110 110 .Fa lwpid.
111 111 .Pp
112 112 The
113 113 .Fn Plwp_setregs
114 114 function updates the general purpose registers of the thread specified
115 115 by
116 116 .Fa lwpid
117 117 to the register state contained in
118 118 .Fa gregs .
119 119 .Pp
120 120 Processes must be stopped before obtaining the register state of
121 121 individual threads.
122 122 Processes may be stopped with
123 123 .Xr Pstop 3PROC .
124 124 The structures used for registers are described in
125 125 .Xr proc 5
126 126 and their definitions may be found in
127 127 .In procfs.h .
128 128 The definitions of these structures varies based on the architecture of
129 129 the system and the running process.
130 130 .Pp
131 131 One may not set the register values of a process that is not an active
132 132 process, e.g. a process handle that refers to a file or a core file.
133 133 .Pp
134 134 The
135 135 .Fn Lgetfpregs ,
136 136 .Fn Lsetfpregs ,
137 137 .Fn Lgetregs ,
138 138 and
139 139 .Fn Lsetregs
140 140 functions behave in a same way as the corresponding process-handle
141 141 specific functions, with the following differences:
142 142 .Bl -dash
143 143 .It
144 144 Rather than take a specified thread id via
145 145 .Fa lwpid ,
146 146 they operate on the thread that the thread-handle,
147 147 .Fa L ,
148 148 refers to.
149 149 .It
150 150 The process-handle functions will require that the entire process is
151 151 stopped before performing a set operation.
152 152 In these cases, only the specific thread identified by the handle
153 153 .Fa L
154 154 must be stopped through a call to
155 155 .Xr Lstop 3PROC
156 156 or similar.
157 157 Note, a suspended thread
158 158 .Po
159 159 .Xr thr_suspend 3C
160 160 .Pc
161 161 is not considered stopped for these purposes.
162 162 .El
163 163 .Sh RETURN VALUES
164 164 Upon successful completion, the
165 165 .Fn Plwp_getregs ,
166 166 .Fn Plwp_setregs ,
167 167 .Fn Plwp_getfpregs ,
168 168 .Fn Plwp_setfpregs ,
169 169 .Fn Lgetfpregs ,
170 170 .Fn Lsetfpregs ,
171 171 .Fn Lgetregs ,
172 172 and
173 173 .Fn Lsetregs
174 174 functions return
175 175 .Sy 0
176 176 and obtain or set the register state.
177 177 Otherwise,
178 178 .Sy -1
179 179 is returned,
180 180 .Va errno
181 181 is set to indicate the error, and the register state is not updated nor
182 182 are the data pointers changed.
183 183 .Sh ERRORS
184 184 The implementations of these functions may use standard system and
185 185 library calls that can fail.
186 186 For a full list of possible errors also see the
187 187 .Sy DIAGNOSTICS
188 188 section in
189 189 .Xr proc 5 .
190 190 .Pp
191 191 The
192 192 .Fn Plwp_getregs ,
193 193 .Fn Plwp_setregs ,
194 194 .Fn Plwp_getfpregs ,
195 195 and
196 196 .Fn Plwp_setfpregs
197 197 will fail if:
198 198 .Bl -tag -width Er
199 199 .It Er EBUSY
200 200 The process handle
201 201 .Fa P
202 202 is not currently stopped.
203 203 .It Er ENOENT
204 204 There is no thread in
205 205 .Fa P
206 206 with id
207 207 .Fa lwpid .
208 208 .El
209 209 The
210 210 .Fn Lgetfpregs ,
211 211 .Fn Lsetfpregs ,
212 212 .Fn Lgetregs ,
213 213 and
214 214 .Fn Lsetregs
215 215 will fail if:
216 216 .Bl -tag -width Er
217 217 .It Er EBUSY
218 218 The thread handle
219 219 .Fa L
220 220 is not currently stopped.
221 221 .El
222 222 .Sh INTERFACE STABILITY
223 223 .Sy Uncommitted
224 224 .Sh MT-LEVEL
225 225 See
226 226 .Sy LOCKING
227 227 in
228 228 .Xr libproc 3LIB .
229 229 .Sh SEE ALSO
230 230 .Xr libproc 3LIB ,
231 231 .Xr proc 5
|
↓ open down ↓ |
231 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX