The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/mach/thread_info.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /* 
    2  * Mach Operating System
    3  * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
    4  * All Rights Reserved.
    5  * 
    6  * Permission to use, copy, modify and distribute this software and its
    7  * documentation is hereby granted, provided that both the copyright
    8  * notice and this permission notice appear in all copies of the
    9  * software, derivative works or modified versions, and any portions
   10  * thereof, and that both notices appear in supporting documentation.
   11  * 
   12  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
   13  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
   14  * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
   15  * 
   16  * Carnegie Mellon requests users of this software to return to
   17  * 
   18  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
   19  *  School of Computer Science
   20  *  Carnegie Mellon University
   21  *  Pittsburgh PA 15213-3890
   22  * 
   23  * any improvements or extensions that they make and grant Carnegie Mellon
   24  * the rights to redistribute these changes.
   25  */
   26 /*
   27  * HISTORY
   28  * $Log:        thread_info.h,v $
   29  * Revision 2.5  93/01/14  17:47:57  danner
   30  *      Cleanup.
   31  *      [92/06/10            pds]
   32  *      64bit cleanup.
   33  *      [92/12/01            af]
   34  * 
   35  * Revision 2.4  91/05/14  17:01:06  mrt
   36  *      Correcting copyright
   37  * 
   38  * Revision 2.3  91/02/05  17:36:34  mrt
   39  *      Changed to new Mach copyright
   40  *      [91/02/01  17:21:39  mrt]
   41  * 
   42  * Revision 2.2  90/06/02  15:00:08  rpd
   43  *      Updated for new scheduling info.
   44  *      [90/03/26  22:40:55  rpd]
   45  * 
   46  * Revision 2.1  89/08/03  16:06:07  rwd
   47  * Created.
   48  * 
   49  * Revision 2.4  89/02/25  18:41:18  gm0w
   50  *      Changes for cleanup.
   51  * 
   52  *  4-Mar-88  David Black (dlb) at Carnegie-Mellon University
   53  *      Added TH_USAGE_SCALE for cpu_usage field.
   54  *
   55  * 15-Jan-88  David Golub (dbg) at Carnegie-Mellon University
   56  *      Changed to generic interface (variable-length array) to allow
   57  *      for expansion.  Renamed to thread_info.
   58  *
   59  *  1-Jun-87  Avadis Tevanian (avie) at Carnegie-Mellon University
   60  *      Created.
   61  *
   62  */
   63 /*
   64  *      File:   mach/thread_info
   65  *
   66  *      Thread information structure and definitions.
   67  *
   68  *      The defintions in this file are exported to the user.  The kernel
   69  *      will translate its internal data structures to these structures
   70  *      as appropriate.
   71  *
   72  */
   73 
   74 #ifndef _MACH_THREAD_INFO_H_
   75 #define _MACH_THREAD_INFO_H_
   76 
   77 #include <mach/boolean.h>
   78 #include <mach/policy.h>
   79 #include <mach/time_value.h>
   80 
   81 /*
   82  *      Generic information structure to allow for expansion.
   83  */
   84 typedef integer_t       *thread_info_t;         /* varying array of ints */
   85 
   86 #define THREAD_INFO_MAX         (1024)  /* maximum array size */
   87 typedef integer_t       thread_info_data_t[THREAD_INFO_MAX];
   88 
   89 /*
   90  *      Currently defined information.
   91  */
   92 #define THREAD_BASIC_INFO       1               /* basic information */
   93 
   94 struct thread_basic_info {
   95         time_value_t    user_time;      /* user run time */
   96         time_value_t    system_time;    /* system run time */
   97         integer_t       cpu_usage;      /* scaled cpu usage percentage */
   98         integer_t       base_priority;  /* base scheduling priority */
   99         integer_t       cur_priority;   /* current scheduling priority */
  100         integer_t       run_state;      /* run state (see below) */
  101         integer_t       flags;          /* various flags (see below) */
  102         integer_t       suspend_count;  /* suspend count for thread */
  103         integer_t       sleep_time;     /* number of seconds that thread
  104                                            has been sleeping */
  105 };
  106 
  107 typedef struct thread_basic_info        thread_basic_info_data_t;
  108 typedef struct thread_basic_info        *thread_basic_info_t;
  109 #define THREAD_BASIC_INFO_COUNT \
  110                 (sizeof(thread_basic_info_data_t) / sizeof(natural_t))
  111 
  112 /*
  113  *      Scale factor for usage field.
  114  */
  115 
  116 #define TH_USAGE_SCALE  1000
  117 
  118 /*
  119  *      Thread run states (state field).
  120  */
  121 
  122 #define TH_STATE_RUNNING        1       /* thread is running normally */
  123 #define TH_STATE_STOPPED        2       /* thread is stopped */
  124 #define TH_STATE_WAITING        3       /* thread is waiting normally */
  125 #define TH_STATE_UNINTERRUPTIBLE 4      /* thread is in an uninterruptible
  126                                            wait */
  127 #define TH_STATE_HALTED         5       /* thread is halted at a
  128                                            clean point */
  129 
  130 /*
  131  *      Thread flags (flags field).
  132  */
  133 #define TH_FLAGS_SWAPPED        0x1     /* thread is swapped out */
  134 #define TH_FLAGS_IDLE           0x2     /* thread is an idle thread */
  135 
  136 #define THREAD_SCHED_INFO       2
  137 
  138 struct thread_sched_info {
  139         integer_t       policy;         /* scheduling policy */
  140         integer_t       data;           /* associated data */
  141         integer_t       base_priority;  /* base priority */
  142         integer_t       max_priority;   /* max priority */
  143         integer_t       cur_priority;   /* current priority */
  144 /*boolean_t*/integer_t  depressed;      /* depressed ? */
  145         integer_t       depress_priority; /* priority depressed from */
  146 };
  147 
  148 typedef struct thread_sched_info        thread_sched_info_data_t;
  149 typedef struct thread_sched_info        *thread_sched_info_t;
  150 #define THREAD_SCHED_INFO_COUNT \
  151                 (sizeof(thread_sched_info_data_t) / sizeof(natural_t))
  152 
  153 #endif  /* _MACH_THREAD_INFO_H_ */

Cache object: e47ead644081a89e353fd7236301466b


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.