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. These 47registers 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. Processes may be stopped with 67.Xr Pstop 3PROC . 68.Pp 69The 70.Sy prxregset_t 71structure is described in 72.Xr proc 4 . 73.Pp 74One may not set the register values of a process that is not an active 75process, e.g. a process handle that refers to a file or a core file. 76.Sh RETURN VALUES 77Upon successful completion, the 78.Fn Plwp_getxregs 79and 80.Fn Plwp_setxregs 81functions return 82.Sy 0 83and get or set the register state. Otherwise, 84.Sy -1 85is returned and 86.Sy errno 87is set to indicate the error. 88.Sh ERRORS 89For a full list of possible errors see the 90.Sy DIAGNOSTICS 91section in 92.Xr proc 4 . 93.Pp 94The 95.Fn Plwp_getxregs 96and 97.Fn Plwp_setxregs 98function will fail if: 99.Bl -tag -width Er 100.It Er ENODATA 101The process handle 102.Fa P 103does not have any extended register state information. 104.It Er EBUSY 105The process handle 106.Fa P 107refers to a live process and it is not stopped. 108.It Er ENOENT 109The process handle 110.Fa P 111refers to a live process and there is no thread with id 112.Fa lwpid . 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_getxregs 122and 123.Fn Plwp_setxregs 124functions are only available on 125.Sy SPARC 126platforms. 127.Sh INTERFACE STABILITY 128.Sy Uncommitted 129.Sh MT-LEVEL 130See 131.Sy LOCKING 132in 133.Xr libproc 3LIB . 134.Sh SEE ALSO 135.Xr libproc 3LIB , 136.Xr Plwp_getfpregs 3PROC , 137.Xr Plwp_getregs 3PROC , 138.Xr Plwp_setfpregs 3PROC , 139.Xr Plwp_setregs 3PROC , 140.Xr Pstop 3PROC , 141.Xr proc 4 142