xref: /illumos-gate/usr/src/man/man3proc/Plwp_getasrs.3proc (revision 447b1e1fca22e4de5e04623965fbb1460857930c)
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. They contain information that is specific to the platform and
50are not included in the information obtained through functions such as
51.Xr Plwp_getregs 3PROC ,
52.Xr Plwp_getfpregs 3PROC ,
53and
54.Xr Plwp_getxregs 3PROC .
55.Pp
56The Plwp_getasrs
57function reads the ancillary registers into
58.Fa asrs ,
59while the
60.Fn Plwp_setasrs
61sets the thread's ancillary registers to the values provided by
62.Fa asrs .
63.Pp
64Processes should be stopped prior to obtaining the register state of
65individual threads. Processes may be stopped with
66.Xr Pstop 3PROC .
67.Pp
68The
69.Sy asrset_t
70structure is described in
71.Xr proc 4 .
72.Pp
73One may not set the register values of a process that is not an active
74process, e.g. a process handle that refers to a file or a core file.
75.Sh RETURN VALUES
76Upon successful completion, the
77.Fn Plwp_getasrs
78and
79.Fn Plwp_setasrs
80functions return
81.Sy 0
82and get or set the register state. Otherwise,
83.Sy -1
84is returned and
85.Sy errno
86is set to indicate the error.
87.Sh ERRORS
88For a full list of possible errors see the
89.Sy DIAGNOSTICS
90section in
91.Xr proc 4 .
92.Pp
93The
94.Fn Plwp_getasrs
95and
96.Fn Plwp_setasrs
97function will fail if:
98.Bl -tag -width Er
99.It Er ENODATA
100The process handle
101.Fa P
102does not have any ancillary register state information.
103.It Er EBUSY
104The process handle
105.Fa P
106refers to a live process and it is not stopped.
107.It Er ENOENT
108The process handle
109.Fa P
110refers to a live process and there is no thread with id
111.Fa lwpid
112or it is not a 64-bit SPARCv9 process.
113.It Er EINVAL
114The process handle
115.Fa P
116refers to a core file and there is no thread with id
117.Fa lwpid .
118.El
119.Sh ARCHITECTURE
120The
121.Fn Plwp_getasrs
122and
123.Fn Plwp_setasrs
124functions are only available on
12564-bit
126.Sy SPARCv9
127platforms.
128.Sh INTERFACE STABILITY
129.Sy Uncommitted
130.Sh MT-LEVEL
131See
132.Sy LOCKING
133in
134.Xr libproc 3LIB .
135.Sh SEE ALSO
136.Xr libproc 3LIB ,
137.Xr Plwp_getfpregs 3PROC ,
138.Xr Plwp_getregs 3PROC ,
139.Xr Plwp_setregs 3PROC ,
140.Xr Plwp_setregs 3PROC ,
141.Xr Pstop 3PROC ,
142.Xr proc 4
143