Print this page
| Split |
Close |
| Expand all |
| Collapse all |
--- old/usr/src/man/man3proc/Plwp_getregs.3proc.man.txt
+++ new/usr/src/man/man3proc/Plwp_getregs.3proc.man.txt
1 1 PLWP_GETREGS(3PROC) Process Control Library Functions PLWP_GETREGS(3PROC)
2 2
3 3 NAME
4 4 Plwp_getfpregs, Plwp_setfpregs, Plwp_getregs, Plwp_setregs, Lgetfpregs,
5 5 Lsetfpregs, Lgetregs, Lsetregs - get and set thread registers
6 6
7 7 LIBRARY
8 8 Process Control Library (libproc, -lproc)
9 9
10 10 SYNOPSIS
11 11 #include <libproc.h>
12 12
13 13 int
14 14 Plwp_getfpregs(struct ps_prochandle *P, lwpid_t lwpid,
15 15 prfpregset_t *fpregs);
16 16
17 17 int
18 18 Plwp_setfpregs(struct ps_prochandle *P, lwpid_t lwpid,
19 19 const prfpregset_t fpregs);
20 20
21 21 int
22 22 Plwp_getregs(struct ps_prochandle *P, lwpid_t lwpid, prgregset_t gregs);
23 23
24 24 int
25 25 Plwp_setregs(struct ps_prochandle *P, lwpid_t lwpid,
26 26 const prgregset_t gregs);
27 27
28 28 int
29 29 Lgetfpregs(struct ps_lwphandle *L, prfpregset_t *fpregs);
30 30
31 31 int
32 32 Lsetfpregs(struct ps_lwphandle *L, const prfpregset_t *fpregs);
33 33
34 34 int
35 35 Lgetregs(struct ps_lwphandle *L, prgregset_t gregs);
36 36
37 37 int
38 38 Lsetregs(struct ps_lwphandle *L, const prgregset_t gregs);
39 39
40 40 DESCRIPTION
41 41 The Plwp_getregs(), Plwp_setregs(), Plwp_getfpregs(), and
42 42 Plwp_setfpregs() functions allow one to get and set the general purpose
43 43 and floating point registers from the thread lwpid in the process handle
44 44 P.
45 45
46 46 The Plwp_getfpregs() function updates the structure pointed to by fpregs
47 47 with the state and values of the floating point registers of the thread
48 48 specified by lwpid.
49 49
50 50 The Plwp_setfpregs() function updates the floating point registers of the
51 51 thread specified by lwpid to the register state contained in fpregs.
52 52
53 53 The Plwp_getregs() function updates the structure pointed to by gregs
54 54 with the state and values of the general purpose registers of the thread
55 55 specified by lwpid.
56 56
57 57 The Plwp_setregs() function updates the general purpose registers of the
58 58 thread specified by lwpid to the register state contained in gregs.
59 59
60 60 Processes must be stopped before obtaining the register state of
61 61 individual threads. Processes may be stopped with Pstop(3PROC). The
62 62 structures used for registers are described in proc(5) and their
63 63 definitions may be found in <procfs.h>. The definitions of these
64 64 structures varies based on the architecture of the system and the running
65 65 process.
66 66
67 67 One may not set the register values of a process that is not an active
68 68 process, e.g. a process handle that refers to a file or a core file.
69 69
70 70 The Lgetfpregs(), Lsetfpregs(), Lgetregs(), and Lsetregs() functions
71 71 behave in a same way as the corresponding process-handle specific
72 72 functions, with the following differences:
73 73
74 74 - Rather than take a specified thread id via lwpid, they operate on the
75 75 thread that the thread-handle, L, refers to.
76 76
77 77 - The process-handle functions will require that the entire process is
78 78 stopped before performing a set operation. In these cases, only the
79 79 specific thread identified by the handle L must be stopped through a
80 80 call to Lstop(3PROC) or similar. Note, a suspended thread
81 81 (thr_suspend(3C)) is not considered stopped for these purposes.
82 82
83 83 RETURN VALUES
84 84 Upon successful completion, the Plwp_getregs(), Plwp_setregs(),
85 85 Plwp_getfpregs(), Plwp_setfpregs(), Lgetfpregs(), Lsetfpregs(),
86 86 Lgetregs(), and Lsetregs() functions return 0 and obtain or set the
87 87 register state. Otherwise, -1 is returned, errno is set to indicate the
88 88 error, and the register state is not updated nor are the data pointers
89 89 changed.
90 90
91 91 ERRORS
92 92 The implementations of these functions may use standard system and
93 93 library calls that can fail. For a full list of possible errors also see
94 94 the DIAGNOSTICS section in proc(5).
95 95
96 96 The Plwp_getregs(), Plwp_setregs(), Plwp_getfpregs(), and
97 97 Plwp_setfpregs() will fail if:
98 98
99 99 EBUSY The process handle P is not currently stopped.
100 100
101 101 ENOENT There is no thread in P with id lwpid.
102 102 The Lgetfpregs(), Lsetfpregs(), Lgetregs(), and Lsetregs() will fail if:
103 103
104 104 EBUSY The thread handle L is not currently stopped.
105 105
106 106 INTERFACE STABILITY
107 107 Uncommitted
108 108
109 109 MT-LEVEL
110 110 See LOCKING in libproc(3LIB).
111 111
112 112 SEE ALSO
113 113 libproc(3LIB), proc(5)
114 114
115 115 illumos January 19, 2023 illumos
|
↓ open down ↓ |
115 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX