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/compat/mach/mach_thread.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 /*      $NetBSD: mach_thread.h,v 1.19 2008/04/28 20:23:44 martin Exp $ */
    2 
    3 /*-
    4  * Copyright (c) 2002-2003 The NetBSD Foundation, Inc.
    5  * All rights reserved.
    6  *
    7  * This code is derived from software contributed to The NetBSD Foundation
    8  * by Emmanuel Dreyfus
    9  *
   10  * Redistribution and use in source and binary forms, with or without
   11  * modification, are permitted provided that the following conditions
   12  * are met:
   13  * 1. Redistributions of source code must retain the above copyright
   14  *    notice, this list of conditions and the following disclaimer.
   15  * 2. Redistributions in binary form must reproduce the above copyright
   16  *    notice, this list of conditions and the following disclaimer in the
   17  *    documentation and/or other materials provided with the distribution.
   18  *
   19  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
   20  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
   21  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
   22  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
   23  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
   24  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
   25  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
   26  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
   27  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
   28  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
   29  * POSSIBILITY OF SUCH DAMAGE.
   30  */
   31 
   32 #ifndef _MACH_THREAD_H_
   33 #define _MACH_THREAD_H_
   34 
   35 #include <sys/types.h>
   36 #include <sys/param.h>
   37 #include <sys/signal.h>
   38 #include <sys/proc.h>
   39 
   40 #include <compat/mach/mach_types.h>
   41 #include <compat/mach/mach_message.h>
   42 
   43 /* For mach_create_thread_child() */
   44 struct mach_create_thread_child_args {
   45         struct lwp *mctc_lwp;
   46         struct lwp *mctc_oldlwp;
   47         mach_natural_t *mctc_state;
   48         int mctc_flavor;
   49         int mctc_child_done;
   50 };
   51 
   52 /* For mach_sys_syscall_thread_switch() */
   53 #define MACH_SWITCH_OPTION_NONE 0
   54 #define MACH_SWITCH_OPTION_DEPRESS      1
   55 #define MACH_SWITCH_OPTION_WAIT 2
   56 #define MACH_SWITCH_OPTION_IDLE 3
   57 
   58 /* For mach_thread_info */
   59 #define MACH_THREAD_BASIC_INFO 3
   60 struct mach_thread_basic_info {
   61         mach_time_value_t       user_time;
   62         mach_time_value_t       system_time;
   63         mach_integer_t  cpu_usage;
   64         mach_policy_t   policy;
   65         mach_integer_t  run_state;
   66         mach_integer_t  flags;
   67         mach_integer_t  suspend_count;
   68         mach_integer_t  sleep_time;
   69 };
   70 #define MACH_TH_STATE_RUNNING           1
   71 #define MACH_TH_STATE_STOPPED           2
   72 #define MACH_TH_STATE_WAITING           3
   73 #define MACH_TH_STATE_UNINTERRUPTIBLE   4
   74 #define MACH_TH_STATE_HALTED            5
   75 
   76 #define MACH_TH_FLAGS_SWAPPED   1
   77 #define MACH_TH_FLAGS_IDLE      2
   78 
   79 #define MACH_THREAD_SCHED_TIMESHARE_INFO 10
   80 struct mach_policy_timeshare_info {
   81         mach_integer_t max_priority;
   82         mach_integer_t base_priority;
   83         mach_integer_t cur_priority;
   84         mach_boolean_t depressed;
   85         mach_integer_t depress_priority;
   86 };
   87 
   88 #define MACH_THREAD_SCHED_RR_INFO       11
   89 #define MACH_THREAD_SCHED_FIFO_INFO     12
   90 
   91 /* For mach_policy_t */
   92 #define MACH_THREAD_STANDARD_POLICY     1
   93 #define MACH_THREAD_TIME_CONSTRAINT_POLICY 2
   94 #define MACH_THREAD_PRECEDENCE_POLICY   3
   95 
   96 /* thread_policy */
   97 
   98 typedef struct {
   99         mach_msg_header_t req_msgh;
  100         mach_ndr_record_t req_ndr;
  101         mach_policy_t req_policy;
  102         mach_msg_type_number_t req_count;
  103         mach_integer_t req_base[0];
  104         mach_boolean_t req_setlimit;
  105 } mach_thread_policy_request_t;
  106 
  107 typedef struct {
  108         mach_msg_header_t rep_msgh;
  109         mach_ndr_record_t rep_ndr;
  110         mach_kern_return_t rep_retval;
  111         mach_msg_trailer_t rep_trailer;
  112 } mach_thread_policy_reply_t;
  113 
  114 /* mach_thread_create_running */
  115 
  116 typedef struct {
  117         mach_msg_header_t req_msgh;
  118         mach_ndr_record_t req_ndr;
  119         mach_thread_state_flavor_t req_flavor;
  120         mach_msg_type_number_t req_count;
  121         mach_natural_t req_state[0];
  122 } mach_thread_create_running_request_t;
  123 
  124 typedef struct {
  125         mach_msg_header_t rep_msgh;
  126         mach_msg_body_t rep_body;
  127         mach_msg_port_descriptor_t rep_child_act;
  128         mach_msg_trailer_t rep_trailer;
  129 } mach_thread_create_running_reply_t;
  130 
  131 /* mach_thread_info */
  132 
  133 typedef struct {
  134         mach_msg_header_t req_msgh;
  135         mach_ndr_record_t req_ndr;
  136         mach_thread_flavor_t req_flavor;
  137         mach_msg_type_number_t req_count;
  138 } mach_thread_info_request_t;
  139 
  140 typedef struct {
  141         mach_msg_header_t rep_msgh;
  142         mach_ndr_record_t rep_ndr;
  143         mach_kern_return_t rep_retval;
  144         mach_msg_type_number_t rep_count;
  145         mach_integer_t rep_out[12];
  146         mach_msg_trailer_t rep_trailer;
  147 } mach_thread_info_reply_t;
  148 
  149 /* thread_get_state */
  150 
  151 typedef struct {
  152         mach_msg_header_t req_msgh;
  153         mach_ndr_record_t req_ndr;
  154         mach_thread_state_flavor_t req_flavor;
  155         mach_msg_type_number_t req_count;
  156 } mach_thread_get_state_request_t;
  157 
  158 typedef struct {
  159         mach_msg_header_t rep_msgh;
  160         mach_ndr_record_t rep_ndr;
  161         mach_kern_return_t rep_retval;
  162         mach_msg_type_number_t rep_count;
  163         mach_integer_t rep_state[144];
  164         mach_msg_trailer_t rep_trailer;
  165 } mach_thread_get_state_reply_t;
  166 
  167 /* mach_thread_set_state */
  168 
  169 typedef struct {
  170         mach_msg_header_t req_msgh;
  171         mach_ndr_record_t req_ndr;
  172         mach_thread_state_flavor_t req_flavor;
  173         mach_msg_type_number_t req_count;
  174         mach_integer_t req_state[0];
  175 } mach_thread_set_state_request_t;
  176 
  177 typedef struct {
  178         mach_msg_header_t rep_msgh;
  179         mach_ndr_record_t rep_ndr;
  180         mach_kern_return_t rep_retval;
  181         mach_msg_trailer_t rep_trailer;
  182 } mach_thread_set_state_reply_t;
  183 
  184 /* thread_suspend */
  185 
  186 typedef struct {
  187         mach_msg_header_t req_msgh;
  188 } mach_thread_suspend_request_t;
  189 
  190 typedef struct {
  191         mach_msg_header_t rep_msgh;
  192         mach_ndr_record_t rep_ndr;
  193         mach_kern_return_t rep_retval;
  194         mach_msg_trailer_t rep_trailer;
  195 } mach_thread_suspend_reply_t;
  196 
  197 /* thread_resume */
  198 
  199 typedef struct {
  200         mach_msg_header_t req_msgh;
  201 } mach_thread_resume_request_t;
  202 
  203 typedef struct {
  204         mach_msg_header_t rep_msgh;
  205         mach_ndr_record_t rep_ndr;
  206         mach_kern_return_t rep_retval;
  207         mach_msg_trailer_t rep_trailer;
  208 } mach_thread_resume_reply_t;
  209 
  210 /* thread_abort */
  211 
  212 typedef struct {
  213         mach_msg_header_t req_msgh;
  214 } mach_thread_abort_request_t;
  215 
  216 typedef struct {
  217         mach_msg_header_t rep_msgh;
  218         mach_ndr_record_t rep_ndr;
  219         mach_kern_return_t rep_retval;
  220         mach_msg_trailer_t rep_trailer;
  221 } mach_thread_abort_reply_t;
  222 
  223 /* thread_set_policy */
  224 
  225 typedef struct {
  226         mach_msg_header_t req_msgh;
  227         mach_msg_body_t req_body;
  228         mach_msg_port_descriptor_t req_pset;
  229         mach_ndr_record_t req_ndr;
  230         mach_policy_t req_policy;
  231         mach_msg_type_number_t req_base_count;
  232         mach_integer_t req_base[0];
  233         mach_msg_type_number_t req_limit_count;
  234         mach_integer_t req_limit[0];
  235 } mach_thread_set_policy_request_t;
  236 
  237 typedef struct {
  238         mach_msg_header_t rep_msgh;
  239         mach_ndr_record_t rep_ndr;
  240         mach_kern_return_t rep_retval;
  241         mach_msg_trailer_t rep_trailer;
  242 } mach_thread_set_policy_reply_t;
  243 
  244 /* These are machine dependent functions */
  245 int mach_thread_get_state_machdep(struct lwp *, int, void *, int *);
  246 int mach_thread_set_state_machdep(struct lwp *, int, void *);
  247 void mach_create_thread_child(void *);
  248 
  249 #endif /* _MACH_THREAD_H_ */

Cache object: eeb5dba2b4d37bbae405fbd34c8a8205


[ 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.