xref: /illumos-gate/usr/src/man/man3proc/Plwp_getasrs.3proc (revision 14b24e2b79293068c8e016a69ef1d872fb5e2fd5)
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_GETASRS 3PROC
16.Os
17.Sh NAME
18.Nm Plwp_getasrs ,
19.Nm Plwp_setasrs
20.Nd get and set SPARCv9 ancillary state registers
21.Sh SYNOPSIS
22.Lb libproc
23.In libproc.h
24.Ft int
25.Fo Plwp_getasrs
26.Fa "struct ps_prochandle *P"
27.Fa "lwpid_t lwpid"
28.Fa "asrset_t asrs"
29.Fc
30.Ft int
31.Fo Plwp_setasrs
32.Fa "struct ps_prochandle *P"
33.Fa "lwpid_t lwpid"
34.Fa "const asrset_t asrs"
35.Fc
36.Sh DESCRIPTION
37The
38.Fn Plwp_getasrs
39and
40.Fn Plwp_setasrs
41functions get and set the ancillary thread-specific register set of the
42thread
43.Fa lwpid
44in the process handle
45.Fa P .
46.Pp
47The ancillary state registers are only present on 64-bit
48.Sy SPARCv9
49processes.
50They contain information that is specific to the platform and are not included
51in the information obtained through functions such as
52.Xr Plwp_getregs 3PROC ,
53.Xr Plwp_getfpregs 3PROC ,
54and
55.Xr Plwp_getxregs 3PROC .
56.Pp
57The
58.Fn Plwp_getasrs
59function reads the ancillary registers into
60.Fa asrs ,
61while the
62.Fn Plwp_setasrs
63sets the thread's ancillary registers to the values provided by
64.Fa asrs .
65.Pp
66Processes should be stopped prior to obtaining the register state of
67individual threads.
68Processes may be stopped with
69.Xr Pstop 3PROC .
70.Pp
71The
72.Sy asrset_t
73structure is described in
74.Xr proc 4 .
75.Pp
76One may not set the register values of a process that is not an active
77process, e.g. a process handle that refers to a file or a core file.
78.Sh RETURN VALUES
79Upon successful completion, the
80.Fn Plwp_getasrs
81and
82.Fn Plwp_setasrs
83functions return
84.Sy 0
85and get or set the register state.
86Otherwise,
87.Sy -1
88is returned and
89.Sy errno
90is set to indicate the error.
91.Sh ERRORS
92For a full list of possible errors see the
93.Sy DIAGNOSTICS
94section in
95.Xr proc 4 .
96.Pp
97The
98.Fn Plwp_getasrs
99and
100.Fn Plwp_setasrs
101function will fail if:
102.Bl -tag -width Er
103.It Er ENODATA
104The process handle
105.Fa P
106does not have any ancillary register state information.
107.It Er EBUSY
108The process handle
109.Fa P
110refers to a live process and it is not stopped.
111.It Er ENOENT
112The process handle
113.Fa P
114refers to a live process and there is no thread with id
115.Fa lwpid
116or it is not a 64-bit SPARCv9 process.
117.It Er EINVAL
118The process handle
119.Fa P
120refers to a core file and there is no thread with id
121.Fa lwpid .
122.El
123.Sh ARCHITECTURE
124The
125.Fn Plwp_getasrs
126and
127.Fn Plwp_setasrs
128functions are only available on
12964-bit
130.Sy SPARCv9
131platforms.
132.Sh INTERFACE STABILITY
133.Sy Uncommitted
134.Sh MT-LEVEL
135See
136.Sy LOCKING
137in
138.Xr libproc 3LIB .
139.Sh SEE ALSO
140.Xr libproc 3LIB ,
141.Xr Plwp_getfpregs 3PROC ,
142.Xr Plwp_getregs 3PROC ,
143.Xr Plwp_setregs 3PROC ,
144.Xr Plwp_setregs 3PROC ,
145.Xr Pstop 3PROC ,
146.Xr proc 4
147