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
        
*** 1,10 ****
  PLWP_GETREGS(3PROC)    Process Control Library Functions   PLWP_GETREGS(3PROC)
  
  NAME
!      Plwp_getfpregs, Plwp_setfpregs, Plwp_getregs, Plwp_setregs - get and set
!      thread registers
  
  LIBRARY
       Process Control Library (libproc, -lproc)
  
  SYNOPSIS
--- 1,10 ----
  PLWP_GETREGS(3PROC)    Process Control Library Functions   PLWP_GETREGS(3PROC)
  
  NAME
!      Plwp_getfpregs, Plwp_setfpregs, Plwp_getregs, Plwp_setregs, Lgetfpregs,
!      Lsetfpregs, Lgetregs, Lsetregs - get and set thread registers
  
  LIBRARY
       Process Control Library (libproc, -lproc)
  
  SYNOPSIS
*** 23,32 ****
--- 23,44 ----
  
       int
       Plwp_setregs(struct ps_prochandle *P, lwpid_t lwpid,
           const prgregset_t gregs);
  
+      int
+      Lgetfpregs(struct ps_lwphandle *L, prfpregset_t *fpregs);
+ 
+      int
+      Lsetfpregs(struct ps_lwphandle *L, const prfpregset_t *fpregs);
+ 
+      int
+      Lgetregs(struct ps_lwphandle *L, prgregset_t gregs);
+ 
+      int
+      Lsetregs(struct ps_lwphandle *L, const prgregset_t gregs);
+ 
  DESCRIPTION
       The Plwp_getregs(), Plwp_setregs(), Plwp_getfpregs(), and
       Plwp_setfpregs() functions allow one to get and set the general purpose
       and floating point registers from the thread lwpid in the process handle
       P.
*** 53,85 ****
       process.
  
       One may not set the register values of a process that is not an active
       process, e.g. a process handle that refers to a file or a core file.
  
  RETURN VALUES
       Upon successful completion, the Plwp_getregs(), Plwp_setregs(),
!      Plwp_getfpregs(), and Plwp_setfpregs() functions return 0 and obtain or
!      set the register state.  Otherwise, -1 is returned, errno is set to
!      indicate the error, and the register state is not updated nor are the
!      data pointers changed.
  
  ERRORS
!      For a full list of possible errors also see the DIAGNOSTICS section in
!      proc(5).
  
       The Plwp_getregs(), Plwp_setregs(), Plwp_getfpregs(), and
       Plwp_setfpregs() will fail if:
  
       EBUSY              The process handle P is not currently stopped.
  
       ENOENT             There is no thread in P with id lwpid.
  
  INTERFACE STABILITY
       Uncommitted
  
  MT-LEVEL
       See LOCKING in libproc(3LIB).
  
  SEE ALSO
       libproc(3LIB), proc(5)
  
! illumos                           May 2, 2020                          illumos
--- 65,115 ----
       process.
  
       One may not set the register values of a process that is not an active
       process, e.g. a process handle that refers to a file or a core file.
  
+      The Lgetfpregs(), Lsetfpregs(), Lgetregs(), and Lsetregs() functions
+      behave in a same way as the corresponding process-handle specific
+      functions, with the following differences:
+ 
+      -   Rather than take a specified thread id via lwpid, they operate on the
+          thread that the thread-handle, L, refers to.
+ 
+      -   The process-handle functions will require that the entire process is
+          stopped before performing a set operation.  In these cases, only the
+          specific thread identified by the handle L must be stopped through a
+          call to Lstop(3PROC) or similar.  Note, a suspended thread
+          (thr_suspend(3C)) is not considered stopped for these purposes.
+ 
  RETURN VALUES
       Upon successful completion, the Plwp_getregs(), Plwp_setregs(),
!      Plwp_getfpregs(), Plwp_setfpregs(), Lgetfpregs(), Lsetfpregs(),
!      Lgetregs(), and Lsetregs() functions return 0 and obtain or set the
!      register state.  Otherwise, -1 is returned, errno is set to indicate the
!      error, and the register state is not updated nor are the data pointers
!      changed.
  
  ERRORS
!      The implementations of these functions may use standard system and
!      library calls that can fail.  For a full list of possible errors also see
!      the DIAGNOSTICS section in proc(5).
  
       The Plwp_getregs(), Plwp_setregs(), Plwp_getfpregs(), and
       Plwp_setfpregs() will fail if:
  
       EBUSY              The process handle P is not currently stopped.
  
       ENOENT             There is no thread in P with id lwpid.
+      The Lgetfpregs(), Lsetfpregs(), Lgetregs(), and Lsetregs() will fail if:
  
+      EBUSY              The thread handle L is not currently stopped.
+ 
  INTERFACE STABILITY
       Uncommitted
  
  MT-LEVEL
       See LOCKING in libproc(3LIB).
  
  SEE ALSO
       libproc(3LIB), proc(5)
  
! illumos                        January 19, 2023                        illumos