Print this page
patch sccs-keywords
patch remove-load-flag


  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  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  23  * Use is subject to license terms.
  24  */
  25 
  26 /*      Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T     */
  27 /*        All Rights Reserved   */
  28 
  29 
  30 #ifndef _SYS_DISP_H
  31 #define _SYS_DISP_H
  32 
  33 #pragma ident   "%Z%%M% %I%     %E% SMI"        /* SVr4.0 1.11  */
  34 
  35 #include <sys/priocntl.h>
  36 #include <sys/thread.h>
  37 #include <sys/class.h>
  38 
  39 #ifdef  __cplusplus
  40 extern "C" {
  41 #endif
  42 
  43 /*
  44  * The following is the format of a dispatcher queue entry.
  45  */
  46 typedef struct dispq {
  47         kthread_t       *dq_first;      /* first thread on queue or NULL */
  48         kthread_t       *dq_last;       /* last thread on queue or NULL */
  49         int             dq_sruncnt;     /* number of loaded, runnable */
  50                                         /*    threads on queue */
  51 } dispq_t;
  52 
  53 /*
  54  * Dispatch queue structure.


 126  *
 127  * idle_cpu() is invoked when a cpu goes idle, and has nothing to do.
 128  * disp_enq_thread() is invoked when a thread is placed on a run queue.
 129  */
 130 extern void     (*idle_cpu)();
 131 extern void     (*disp_enq_thread)(struct cpu *, int);
 132 
 133 
 134 extern int              dispdeq(kthread_t *);
 135 extern void             dispinit(void);
 136 extern void             disp_add(sclass_t *);
 137 extern int              intr_active(struct cpu *, int);
 138 extern int              servicing_interrupt(void);
 139 extern void             preempt(void);
 140 extern void             setbackdq(kthread_t *);
 141 extern void             setfrontdq(kthread_t *);
 142 extern void             swtch(void);
 143 extern void             swtch_to(kthread_t *);
 144 extern void             swtch_from_zombie(void)
 145                                 __NORETURN;
 146 extern void             dq_sruninc(kthread_t *);
 147 extern void             dq_srundec(kthread_t *);
 148 extern void             cpu_rechoose(kthread_t *);
 149 extern void             cpu_surrender(kthread_t *);
 150 extern void             kpreempt(int);
 151 extern struct cpu       *disp_lowpri_cpu(struct cpu *, struct lgrp_ld *, pri_t,
 152                             struct cpu *);
 153 extern int              disp_bound_threads(struct cpu *, int);
 154 extern int              disp_bound_anythreads(struct cpu *, int);
 155 extern int              disp_bound_partition(struct cpu *, int);
 156 extern void             disp_cpu_init(struct cpu *);
 157 extern void             disp_cpu_fini(struct cpu *);
 158 extern void             disp_cpu_inactive(struct cpu *);
 159 extern void             disp_adjust_unbound_pri(kthread_t *);
 160 extern void             resume(kthread_t *);
 161 extern void             resume_from_intr(kthread_t *);
 162 extern void             resume_from_zombie(kthread_t *)
 163                                 __NORETURN;
 164 extern void             disp_swapped_enq(kthread_t *);
 165 extern int              disp_anywork(void);
 166 
 167 #define KPREEMPT_SYNC           (-1)


  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  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  23  * Use is subject to license terms.
  24  */
  25 
  26 /*      Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T     */
  27 /*        All Rights Reserved   */
  28 
  29 
  30 #ifndef _SYS_DISP_H
  31 #define _SYS_DISP_H
  32 


  33 #include <sys/priocntl.h>
  34 #include <sys/thread.h>
  35 #include <sys/class.h>
  36 
  37 #ifdef  __cplusplus
  38 extern "C" {
  39 #endif
  40 
  41 /*
  42  * The following is the format of a dispatcher queue entry.
  43  */
  44 typedef struct dispq {
  45         kthread_t       *dq_first;      /* first thread on queue or NULL */
  46         kthread_t       *dq_last;       /* last thread on queue or NULL */
  47         int             dq_sruncnt;     /* number of loaded, runnable */
  48                                         /*    threads on queue */
  49 } dispq_t;
  50 
  51 /*
  52  * Dispatch queue structure.


 124  *
 125  * idle_cpu() is invoked when a cpu goes idle, and has nothing to do.
 126  * disp_enq_thread() is invoked when a thread is placed on a run queue.
 127  */
 128 extern void     (*idle_cpu)();
 129 extern void     (*disp_enq_thread)(struct cpu *, int);
 130 
 131 
 132 extern int              dispdeq(kthread_t *);
 133 extern void             dispinit(void);
 134 extern void             disp_add(sclass_t *);
 135 extern int              intr_active(struct cpu *, int);
 136 extern int              servicing_interrupt(void);
 137 extern void             preempt(void);
 138 extern void             setbackdq(kthread_t *);
 139 extern void             setfrontdq(kthread_t *);
 140 extern void             swtch(void);
 141 extern void             swtch_to(kthread_t *);
 142 extern void             swtch_from_zombie(void)
 143                                 __NORETURN;


 144 extern void             cpu_rechoose(kthread_t *);
 145 extern void             cpu_surrender(kthread_t *);
 146 extern void             kpreempt(int);
 147 extern struct cpu       *disp_lowpri_cpu(struct cpu *, struct lgrp_ld *, pri_t,
 148                             struct cpu *);
 149 extern int              disp_bound_threads(struct cpu *, int);
 150 extern int              disp_bound_anythreads(struct cpu *, int);
 151 extern int              disp_bound_partition(struct cpu *, int);
 152 extern void             disp_cpu_init(struct cpu *);
 153 extern void             disp_cpu_fini(struct cpu *);
 154 extern void             disp_cpu_inactive(struct cpu *);
 155 extern void             disp_adjust_unbound_pri(kthread_t *);
 156 extern void             resume(kthread_t *);
 157 extern void             resume_from_intr(kthread_t *);
 158 extern void             resume_from_zombie(kthread_t *)
 159                                 __NORETURN;
 160 extern void             disp_swapped_enq(kthread_t *);
 161 extern int              disp_anywork(void);
 162 
 163 #define KPREEMPT_SYNC           (-1)