Print this page
13902 Fix for 13717 may break 8-disk raidz2
13915 installctx() blocking allocate causes problems
Portions contributed by: Jerry Jelinek <gjelinek@gmail.com>
Change-Id: I934d69946cec42630fc541fa8c7385b862b69ca2


   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright (c) 1988, 2010, Oracle and/or its affiliates. All rights reserved.
  24  * Copyright 2018 Joyent, Inc.
  25  * Copyright 2020 Oxide Computer Company
  26  */
  27 
  28 /*      Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T     */
  29 /*        All Rights Reserved   */
  30 
  31 #ifndef _SYS_PROC_H
  32 #define _SYS_PROC_H
  33 
  34 #include <sys/time.h>
  35 #include <sys/thread.h>
  36 #include <sys/cred.h>
  37 #include <sys/user.h>
  38 #include <sys/watchpoint.h>
  39 #include <sys/timer.h>
  40 #if defined(__x86)
  41 #include <sys/tss.h>
  42 #include <sys/segments.h>
  43 #endif
  44 #include <sys/utrap.h>


 701 extern void     set_proc_ast(proc_t *p);
 702 extern void     set_all_proc_sys(void);
 703 extern void     set_all_zone_usr_proc_sys(zoneid_t);
 704 
 705 /* thread function prototypes */
 706 
 707 extern  kthread_t       *thread_create(
 708         caddr_t         stk,
 709         size_t          stksize,
 710         void            (*proc)(),
 711         void            *arg,
 712         size_t          len,
 713         proc_t          *pp,
 714         int             state,
 715         pri_t           pri);
 716 extern  void    thread_exit(void) __NORETURN;
 717 extern  void    thread_free(kthread_t *);
 718 extern  void    thread_rele(kthread_t *);
 719 extern  void    thread_join(kt_did_t);
 720 extern  int     reaper(void);

 721 extern  void    installctx(kthread_t *, void *, void (*)(), void (*)(),
 722     void (*)(), void (*)(), void (*)(), void (*)());
 723 extern  int     removectx(kthread_t *, void *, void (*)(), void (*)(),
 724     void (*)(), void (*)(), void (*)(), void (*)());
 725 extern  void    savectx(kthread_t *);
 726 extern  void    restorectx(kthread_t *);
 727 extern  void    forkctx(kthread_t *, kthread_t *);
 728 extern  void    lwp_createctx(kthread_t *, kthread_t *);
 729 extern  void    exitctx(kthread_t *);
 730 extern  void    freectx(kthread_t *, int);
 731 extern  void    installpctx(proc_t *, void *, void (*)(), void (*)(),
 732     void (*)(), void (*)(), void (*)());
 733 extern  int     removepctx(proc_t *, void *, void (*)(), void (*)(),
 734     void (*)(), void (*)(), void (*)());
 735 extern  void    savepctx(proc_t *);
 736 extern  void    restorepctx(proc_t *);
 737 extern  void    forkpctx(proc_t *, proc_t *);
 738 extern  void    exitpctx(proc_t *);
 739 extern  void    freepctx(proc_t *, int);
 740 extern  kthread_t *thread_unpin(void);
 741 extern  void    thread_init(void);
 742 extern  void    thread_load(kthread_t *, void (*)(), caddr_t, size_t);




   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright (c) 1988, 2010, Oracle and/or its affiliates. All rights reserved.
  24  * Copyright 2021 Joyent, Inc.
  25  * Copyright 2020 Oxide Computer Company
  26  */
  27 
  28 /*      Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T     */
  29 /*        All Rights Reserved   */
  30 
  31 #ifndef _SYS_PROC_H
  32 #define _SYS_PROC_H
  33 
  34 #include <sys/time.h>
  35 #include <sys/thread.h>
  36 #include <sys/cred.h>
  37 #include <sys/user.h>
  38 #include <sys/watchpoint.h>
  39 #include <sys/timer.h>
  40 #if defined(__x86)
  41 #include <sys/tss.h>
  42 #include <sys/segments.h>
  43 #endif
  44 #include <sys/utrap.h>


 701 extern void     set_proc_ast(proc_t *p);
 702 extern void     set_all_proc_sys(void);
 703 extern void     set_all_zone_usr_proc_sys(zoneid_t);
 704 
 705 /* thread function prototypes */
 706 
 707 extern  kthread_t       *thread_create(
 708         caddr_t         stk,
 709         size_t          stksize,
 710         void            (*proc)(),
 711         void            *arg,
 712         size_t          len,
 713         proc_t          *pp,
 714         int             state,
 715         pri_t           pri);
 716 extern  void    thread_exit(void) __NORETURN;
 717 extern  void    thread_free(kthread_t *);
 718 extern  void    thread_rele(kthread_t *);
 719 extern  void    thread_join(kt_did_t);
 720 extern  int     reaper(void);
 721 extern  struct ctxop *installctx_preallocate(void);
 722 extern  void    installctx(kthread_t *, void *, void (*)(), void (*)(),
 723     void (*)(), void (*)(), void (*)(), void (*)(), struct ctxop *);
 724 extern  int     removectx(kthread_t *, void *, void (*)(), void (*)(),
 725     void (*)(), void (*)(), void (*)(), void (*)());
 726 extern  void    savectx(kthread_t *);
 727 extern  void    restorectx(kthread_t *);
 728 extern  void    forkctx(kthread_t *, kthread_t *);
 729 extern  void    lwp_createctx(kthread_t *, kthread_t *);
 730 extern  void    exitctx(kthread_t *);
 731 extern  void    freectx(kthread_t *, int);
 732 extern  void    installpctx(proc_t *, void *, void (*)(), void (*)(),
 733     void (*)(), void (*)(), void (*)());
 734 extern  int     removepctx(proc_t *, void *, void (*)(), void (*)(),
 735     void (*)(), void (*)(), void (*)());
 736 extern  void    savepctx(proc_t *);
 737 extern  void    restorepctx(proc_t *);
 738 extern  void    forkpctx(proc_t *, proc_t *);
 739 extern  void    exitpctx(proc_t *);
 740 extern  void    freepctx(proc_t *, int);
 741 extern  kthread_t *thread_unpin(void);
 742 extern  void    thread_init(void);
 743 extern  void    thread_load(kthread_t *, void (*)(), caddr_t, size_t);