Print this page
15254 %ymm registers not restored after signal handler
15367 x86 getfpregs() summons corrupting %xmm ghosts
15333 want x86 /proc xregs support (libc_db, libproc, mdb, etc.)
15336 want libc functions for extended ucontext_t
15334 want ps_lwphandle-specific reg routines
15328 FPU_CW_INIT mistreats reserved bit
15335 i86pc fpu_subr.c isn't really platform-specific
15332 setcontext(2) isn't actually noreturn
15331 need <sys/stdalign.h>
Change-Id: I7060aa86042dfb989f77fc3323c065ea2eafa9ad
Conflicts:
usr/src/uts/common/fs/proc/prcontrol.c
usr/src/uts/intel/os/archdep.c
usr/src/uts/intel/sys/ucontext.h
usr/src/uts/intel/syscall/getcontext.c
| 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 - Plwp_getfpregs, Plwp_setfpregs, Plwp_getregs, Plwp_setregs - get and set
5 - thread registers
4 + Plwp_getfpregs, Plwp_setfpregs, Plwp_getregs, Plwp_setregs, Lgetfpregs,
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
|
↓ open down ↓ |
2 lines elided |
↑ open up ↑ |
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 + int
29 + Lgetfpregs(struct ps_lwphandle *L, prfpregset_t *fpregs);
30 +
31 + int
32 + Lsetfpregs(struct ps_lwphandle *L, const prfpregset_t *fpregs);
33 +
34 + int
35 + Lgetregs(struct ps_lwphandle *L, prgregset_t gregs);
36 +
37 + int
38 + Lsetregs(struct ps_lwphandle *L, const prgregset_t gregs);
39 +
28 40 DESCRIPTION
29 41 The Plwp_getregs(), Plwp_setregs(), Plwp_getfpregs(), and
30 42 Plwp_setfpregs() functions allow one to get and set the general purpose
31 43 and floating point registers from the thread lwpid in the process handle
32 44 P.
33 45
34 46 The Plwp_getfpregs() function updates the structure pointed to by fpregs
35 47 with the state and values of the floating point registers of the thread
36 48 specified by lwpid.
37 49
38 50 The Plwp_setfpregs() function updates the floating point registers of the
39 51 thread specified by lwpid to the register state contained in fpregs.
40 52
41 53 The Plwp_getregs() function updates the structure pointed to by gregs
42 54 with the state and values of the general purpose registers of the thread
43 55 specified by lwpid.
44 56
45 57 The Plwp_setregs() function updates the general purpose registers of the
46 58 thread specified by lwpid to the register state contained in gregs.
47 59
|
↓ open down ↓ |
10 lines elided |
↑ open up ↑ |
48 60 Processes must be stopped before obtaining the register state of
49 61 individual threads. Processes may be stopped with Pstop(3PROC). The
50 62 structures used for registers are described in proc(5) and their
51 63 definitions may be found in <procfs.h>. The definitions of these
52 64 structures varies based on the architecture of the system and the running
53 65 process.
54 66
55 67 One may not set the register values of a process that is not an active
56 68 process, e.g. a process handle that refers to a file or a core file.
57 69
70 + The Lgetfpregs(), Lsetfpregs(), Lgetregs(), and Lsetregs() functions
71 + behave in a same way as the corresponding process-handle specific
72 + functions, with the following differences:
73 +
74 + - Rather than take a specified thread id via lwpid, they operate on the
75 + thread that the thread-handle, L, refers to.
76 +
77 + - The process-handle functions will require that the entire process is
78 + stopped before performing a set operation. In these cases, only the
79 + specific thread identified by the handle L must be stopped through a
80 + call to Lstop(3PROC) or similar. Note, a suspended thread
81 + (thr_suspend(3C)) is not considered stopped for these purposes.
82 +
58 83 RETURN VALUES
59 84 Upon successful completion, the Plwp_getregs(), Plwp_setregs(),
60 - Plwp_getfpregs(), and Plwp_setfpregs() functions return 0 and obtain or
61 - set the register state. Otherwise, -1 is returned, errno is set to
62 - indicate the error, and the register state is not updated nor are the
63 - data pointers changed.
85 + Plwp_getfpregs(), Plwp_setfpregs(), Lgetfpregs(), Lsetfpregs(),
86 + Lgetregs(), and Lsetregs() functions return 0 and obtain or set the
87 + register state. Otherwise, -1 is returned, errno is set to indicate the
88 + error, and the register state is not updated nor are the data pointers
89 + changed.
64 90
65 91 ERRORS
66 - For a full list of possible errors also see the DIAGNOSTICS section in
67 - proc(5).
92 + The implementations of these functions may use standard system and
93 + library calls that can fail. For a full list of possible errors also see
94 + the DIAGNOSTICS section in proc(5).
68 95
69 96 The Plwp_getregs(), Plwp_setregs(), Plwp_getfpregs(), and
70 97 Plwp_setfpregs() will fail if:
71 98
72 99 EBUSY The process handle P is not currently stopped.
73 100
74 101 ENOENT There is no thread in P with id lwpid.
102 + The Lgetfpregs(), Lsetfpregs(), Lgetregs(), and Lsetregs() will fail if:
75 103
104 + EBUSY The thread handle L is not currently stopped.
105 +
76 106 INTERFACE STABILITY
77 107 Uncommitted
78 108
79 109 MT-LEVEL
80 110 See LOCKING in libproc(3LIB).
81 111
82 112 SEE ALSO
83 113 libproc(3LIB), proc(5)
84 114
85 -illumos May 2, 2020 illumos
115 +illumos January 19, 2023 illumos
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX