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