xref: /illumos-gate/usr/src/man/man3proc/Plwp_getxregs.3proc (revision 4585130b259133a26efae68275dbe56b08366deb)
1.\"
2.\" This file and its contents are supplied under the terms of the
3.\" Common Development and Distribution License ("CDDL"), version 1.0.
4.\" You may only use this file in accordance with the terms of version
5.\" 1.0 of the CDDL.
6.\"
7.\" A full copy of the text of the CDDL should have accompanied this
8.\" source.  A copy of the CDDL is also available via the Internet at
9.\" http://www.illumos.org/license/CDDL.
10.\"
11.\"
12.\" Copyright 2015 Joyent, Inc.
13.\"
14.Dd May 11, 2016
15.Dt PLWP_GETXREGS 3PROC
16.Os
17.Sh NAME
18.Nm Plwp_getxregs ,
19.Nm Plwp_setxregs
20.Nd get and set extended register state
21.Sh SYNOPSIS
22.Lb libproc
23.In libproc.h
24.Ft int
25.Fo Plwp_getxregs
26.Fa "struct ps_prochandle *P"
27.Fa "lwpid_t lwpid"
28.Fa "prxregset_t *xregs"
29.Fc
30.Ft int
31.Fo Plwp_setxregs
32.Fa "struct ps_prochandle *P"
33.Fa "lwpid_t lwpid"
34.Fa "const prxregset_t *xregs"
35.Fc
36.Sh DESCRIPTION
37The
38.Fn Plwp_getxregs
39and
40.Fn Plwp_setxregs
41functions get and set the extended register state of the thread
42.Fa lwpid
43in the process handle
44.Fa P .
45.Pp
46The extended register state is defined by the architecture.
47These registers may refer to optional registers that have become common on the
48platform, but are not part of the standard ABI and thus not covered by
49functions such as
50.Xr Plwp_getregs 3PROC
51and
52.Xr Plwp_getfpregs 3PROC .
53.Pp
54The
55.Fn Plwp_getxregs
56function gets the extended register state information and places it into
57.Fa xregs .
58Where as the
59.Fn Plwp_setxregs
60function sets the extended register state information in
61.Fa xregs
62for the process handle
63.Fa P .
64.Pp
65Processes must be stopped prior to obtaining the register state of
66individual threads.
67Processes may be stopped with
68.Xr Pstop 3PROC .
69.Pp
70The
71.Sy prxregset_t
72structure is described in
73.Xr proc 4 .
74.Pp
75One may not set the register values of a process that is not an active
76process, e.g. a process handle that refers to a file or a core file.
77.Sh RETURN VALUES
78Upon successful completion, the
79.Fn Plwp_getxregs
80and
81.Fn Plwp_setxregs
82functions return
83.Sy 0
84and get or set the register state.
85Otherwise,
86.Sy -1
87is returned and
88.Sy errno
89is set to indicate the error.
90.Sh ERRORS
91For a full list of possible errors see the
92.Sy DIAGNOSTICS
93section in
94.Xr proc 4 .
95.Pp
96The
97.Fn Plwp_getxregs
98and
99.Fn Plwp_setxregs
100function will fail if:
101.Bl -tag -width Er
102.It Er ENODATA
103The process handle
104.Fa P
105does not have any extended register state information.
106.It Er EBUSY
107The process handle
108.Fa P
109refers to a live process and it is not stopped.
110.It Er ENOENT
111The process handle
112.Fa P
113refers to a live process and there is no thread with id
114.Fa lwpid .
115.It Er EINVAL
116The process handle
117.Fa P
118refers to a core file and there is no thread with id
119.Fa lwpid .
120.El
121.Sh ARCHITECTURE
122The
123.Fn Plwp_getxregs
124and
125.Fn Plwp_setxregs
126functions are only available on
127.Sy SPARC
128platforms.
129.Sh INTERFACE STABILITY
130.Sy Uncommitted
131.Sh MT-LEVEL
132See
133.Sy LOCKING
134in
135.Xr libproc 3LIB .
136.Sh SEE ALSO
137.Xr libproc 3LIB ,
138.Xr Plwp_getfpregs 3PROC ,
139.Xr Plwp_getregs 3PROC ,
140.Xr Plwp_setfpregs 3PROC ,
141.Xr Plwp_setregs 3PROC ,
142.Xr Pstop 3PROC ,
143.Xr proc 4
144