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/mach_host.defs

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) 1993,1992,1991,1990,1989 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:        mach_host.defs,v $
   29  * Revision 2.11  93/11/17  17:39:23  dbg
   30  *      Added new scheduling policy interfaces:
   31  *        new                           replaces
   32  * 
   33  *        processor_set_policy_add      [ processor_set_policy_enable ]
   34  *        processor_set_policy_remove   [ processor_set_policy_disable ]
   35  *        processor_set_policy_limit    [ processor_set_max_priority ]
   36  *        thread_set_policy             [ thread_policy ]
   37  *        thread_set_policy_param       [ thread_priority ]
   38  *        thread_set_policy_limit       [ thread_max_priority ]
   39  *        task_set_default_policy       [ task_priority ]
   40  * 
   41  * Revision 2.10  92/03/10  16:26:54  jsb
   42  *      From durriya@ri.osf.org: added host_get_boot_info.
   43  *      [92/01/08  15:01:12  jsb]
   44  * 
   45  * Revision 2.9  92/02/19  16:07:19  elf
   46  *      Reenable thread_depress_abort.
   47  *      [92/01/20            rwd]
   48  * 
   49  * Revision 2.8  92/01/03  20:21:13  dbg
   50  *      Add 'CountInOut' tag to routines returning variable-length
   51  *      inline arrays.  Remove 'IsLong' tag from routines passing or
   52  *      returning variable-length arrays.  Old routines left under
   53  *      'xxx_' names.  REMOVE THESE SOON!
   54  *      [91/11/26            dbg]
   55  * 
   56  * Revision 2.7  91/07/31  17:53:39  dbg
   57  *      Add vm_wire and thread_wire.
   58  *      [91/07/30  17:10:17  dbg]
   59  * 
   60  * Revision 2.6  91/05/14  16:54:32  mrt
   61  *      Correcting copyright
   62  * 
   63  * Revision 2.5  91/02/05  17:33:20  mrt
   64  *      Changed to new Mach copyright
   65  *      [91/02/01  17:17:52  mrt]
   66  * 
   67  * Revision 2.4  90/09/09  14:33:08  rpd
   68  *      Restored processor_set_create's out arguments.
   69  *      [90/08/30            rpd]
   70  * 
   71  * Revision 2.3  90/08/07  18:00:21  rpd
   72  *      Removed thread_depress_abort.  Changed host_processor_sets
   73  *      to use unprivileged ports.
   74  *      [90/08/06            rpd]
   75  * 
   76  * Revision 2.2  90/06/02  14:58:17  rpd
   77  *      Created for new host/processor technology.
   78  *      [90/03/26  23:51:11  rpd]
   79  * 
   80  *      Remove KERNEL_SERVER define.  Cleanup.
   81  *      [89/08/02            dlb]
   82  *      Add IsLong specifiers to variable length arguments to info calls.
   83  *      [89/08/02            dlb]
   84  *      Add thread_depress_abort.
   85  *      [89/06/20            dlb]
   86  * 
   87  *      Add processor_set_{tasks,threads}, host_processor_sets,
   88  *      host_processor_set_priv.
   89  *      [89/06/08            dlb]
   90  * 
   91  *      Add priority and policy calls.
   92  *      [89/05/12            dlb]
   93  * 
   94  *      Move type definitions to mach_types.defs, delete kernel keyword.
   95  *      [89/01/25            dlb]
   96  * 
   97  *      Moved to mach/ from kern/
   98  *      [89/01/25            dlb]
   99  * 
  100  *      Split processor_set_default.  Add task_assign_default and
  101  *      thread_assign_default.
  102  *      [88/12/21            dlb]
  103  * 
  104  *      Minor cleanups, add host_kernel_version.
  105  *      [88/12/02            dlb]
  106  * 
  107  * Revision 2.4  89/12/22  15:54:26  rpd
  108  *      Under KERNEL_SERVER, pass the out arguments of
  109  *      processor_set_create as port_t's.  They really are
  110  *      the appropriate processor set types, but processor_set_create
  111  *      does the type conversions internally.  This isn't pretty.
  112  *      [89/12/15            dlb]
  113  * 
  114  * Revision 2.3  89/10/15  02:05:40  rpd
  115  *      Minor cleanups.
  116  * 
  117  * Revision 2.2  89/10/11  14:38:34  dlb
  118  *      Add IsLong specifiers to variable length arguments to info calls.
  119  *      Add thread_depress_abort.
  120  *      Add processor_set_{tasks,threads}, host_processor_sets,
  121  *             host_processor_set_priv.
  122  *      Add priority and policy calls.
  123  *      Split processor_set_default.  Add task_assign_default and
  124  *             thread_assign_default.
  125  *      Add host_kernel_version.
  126  * 
  127  * Revision 2.1  89/01/30  16:17:06  dlb
  128  * Created.
  129  * 
  130  */
  131 
  132 /*
  133  * File:        mach/mach_host.defs
  134  *
  135  * Abstract:
  136  *      Mach host operations support.  Includes processor allocation and
  137  *      control.  
  138  */
  139 
  140 #ifdef  KERNEL
  141 simport <kern/compat_xxx_defs.h>;       /* for obsolete routines */
  142 #endif  /* KERNEL */
  143 
  144 subsystem
  145 #if     KERNEL_SERVER
  146           KernelServer
  147 #endif  /* KERNEL_SERVER */
  148                        mach_host 2600;
  149 
  150 /*
  151  *      Basic types
  152  */
  153 
  154 #include <mach/std_types.defs>
  155 #include <mach/mach_types.defs>
  156 
  157 /*
  158  *      Get list of processors on this host.
  159  */
  160 
  161 routine host_processors(
  162                 host_priv       : host_priv_t;
  163         out     processor_list  : processor_array_t);
  164 
  165 /* obsolete */
  166 routine yyy_host_info(
  167                 host            : host_t;
  168                 flavor          : int;
  169         out     host_info_out   : host_info_t, IsLong);
  170 
  171 
  172 /* obsolete */
  173 routine yyy_processor_info(
  174                 processor       : processor_t;
  175                 flavor          : int;
  176         out     host            : host_t;
  177         out     processor_info_out: processor_info_t, IsLong);
  178 
  179 /*
  180  *      Start processor.
  181  */
  182 
  183 routine processor_start(
  184                 processor       : processor_t);
  185 
  186 /*
  187  *      Exit processor -- may not be restartable.
  188  */
  189 
  190 routine processor_exit(
  191                 processor       : processor_t);
  192 
  193 /* obsolete */
  194 routine yyy_processor_control(
  195                 processor       : processor_t;
  196                 processor_cmd   : processor_info_t, IsLong);
  197 
  198 /*
  199  *      Get default processor set for host.
  200  */
  201 routine processor_set_default(
  202                 host            : host_t;
  203         out     default_set     : processor_set_name_t);
  204 
  205 /*
  206  *      Get rights to default processor set for host.
  207  *      Replaced by host_processor_set_priv.
  208  */
  209 routine xxx_processor_set_default_priv(
  210                 host            : host_priv_t;
  211         out     default_set     : processor_set_t);
  212 
  213 /*
  214  *      Create new processor set.  Returns real port for manipulations,
  215  *      and name port for obtaining information.
  216  */
  217 routine processor_set_create(
  218                 host            : host_t;
  219         out     new_set         : processor_set_t;
  220         out     new_name        : processor_set_name_t);
  221 
  222 /*
  223  *      Destroy processor set.
  224  */
  225 routine processor_set_destroy(
  226                 set             : processor_set_t);
  227 
  228 /* obsolete */
  229 routine yyy_processor_set_info(
  230                 set_name        : processor_set_name_t;
  231                 flavor          : int;
  232         out     host            : host_t;
  233         out     info_out        : processor_set_info_t, IsLong);
  234 
  235 /*
  236  *      Assign processor to processor set.
  237  */
  238 routine processor_assign(
  239                 processor       : processor_t;
  240                 new_set         : processor_set_t;
  241                 wait            : boolean_t);
  242 
  243 /*
  244  *      Get current assignment for processor.
  245  */
  246 
  247 routine processor_get_assignment(
  248                 processor       : processor_t;
  249         out     assigned_set    : processor_set_name_t);
  250 
  251 /*
  252  *      Assign thread to processor set.
  253  */
  254 routine thread_assign(
  255                 thread          : thread_t;
  256                 new_set         : processor_set_t);
  257 
  258 /*
  259  *      Assign thread to default set.
  260  */
  261 routine thread_assign_default(
  262                 thread          : thread_t);
  263 
  264 /*
  265  *      Get current assignment for thread.
  266  */
  267 routine thread_get_assignment(
  268                 thread          : thread_t;
  269         out     assigned_set    : processor_set_name_t);
  270 
  271 /*
  272  *      Assign task to processor set.
  273  */
  274 routine task_assign(
  275                 task            : task_t;
  276                 new_set         : processor_set_t;
  277                 assign_threads  : boolean_t);
  278 /*
  279  *      Assign task to default set.
  280  */
  281 routine task_assign_default(
  282                 task            : task_t;
  283                 assign_threads  : boolean_t);
  284 
  285 /*
  286  *      Get current assignment for task.
  287  */
  288 routine task_get_assignment(
  289                 task            : task_t;
  290         out     assigned_set    : processor_set_name_t);
  291 
  292 /*
  293  *      Get string describing current kernel version.
  294  */
  295 routine host_kernel_version(
  296                 host            : host_t;
  297         out     kernel_version  : kernel_version_t);
  298 
  299 /*
  300  *      [ obsolete ]
  301  *      Set priority for thread.
  302  */
  303 routine thread_priority(
  304                 thread          : thread_t;
  305                 priority        : int;
  306                 set_max         : boolean_t);
  307 
  308 /*
  309  *      [ obsolete ]
  310  *      Set max priority for thread.
  311  */
  312 routine thread_max_priority(
  313                 thread          : thread_t;
  314                 processor_set   : processor_set_t;
  315                 max_priority    : int);
  316 
  317 /*
  318  *      [ obsolete ]
  319  *      Set task priority.
  320  */
  321 routine task_priority(
  322                 task            : task_t;
  323                 priority        : int;
  324                 change_threads  : boolean_t);
  325 
  326 /*
  327  *      [ obsolete ]
  328  *      Set max priority for processor_set.
  329  */
  330 routine processor_set_max_priority(
  331                 processor_set   : processor_set_t;
  332                 max_priority    : int;
  333                 change_threads  : boolean_t);
  334 
  335 /*
  336  *      [ obsolete ]
  337  *      Set policy for thread
  338  */
  339 routine thread_policy(
  340                 thread          : thread_t;
  341                 policy          : int;
  342                 data            : int);
  343 
  344 /*
  345  *      [ obsolete ]
  346  *      Enable policy for processor set
  347  */
  348 routine processor_set_policy_enable(
  349                 processor_set   : processor_set_t;
  350                 policy          : int);
  351 
  352 /*
  353  *      [ obsolete ]
  354  *      Disable policy for processor set
  355  */
  356 routine processor_set_policy_disable(
  357                 processor_set   : processor_set_t;
  358                 policy          : int;
  359                 change_threads  : boolean_t);
  360 
  361 /*
  362  *      List all tasks in processor set.
  363  */
  364 routine processor_set_tasks(
  365                 processor_set   : processor_set_t;
  366         out     task_list       : task_array_t);
  367 
  368 /*
  369  *      List all threads in processor set.
  370  */
  371 routine processor_set_threads(
  372                 processor_set   : processor_set_t;
  373         out     thread_list     : thread_array_t);
  374 
  375 /*
  376  *      List all processor sets on host.
  377  */
  378 routine host_processor_sets(
  379                 host            : host_t;
  380         out     processor_sets  : processor_set_name_array_t);
  381 
  382 /*
  383  *      Get control port for a processor set.
  384  */
  385 routine host_processor_set_priv(
  386                 host_priv       : host_priv_t;
  387                 set_name        : processor_set_name_t;
  388         out     set             : processor_set_t);
  389 
  390 /*
  391  *      Abort the priority depression for a thread.
  392  */
  393 routine thread_depress_abort(
  394                 thread          : thread_t);
  395 
  396 /*
  397  *      Set the time on this host.
  398  *      Only available to privileged users.
  399  */
  400 routine host_set_time(
  401                 host_priv       : host_priv_t;
  402                 new_time        : time_value_t);
  403 
  404 /*
  405  *      Arrange for the time on this host to be gradually changed
  406  *      by an adjustment value, and return the old value.
  407  *      Only available to privileged users.
  408  */
  409 routine host_adjust_time(
  410                 host_priv       : host_priv_t;
  411         in      new_adjustment  : time_value_t;
  412         out     old_adjustment  : time_value_t);
  413 
  414 /*
  415  *      Get the time on this host.
  416  *      Available to all.
  417  */
  418 routine host_get_time(
  419                 host            : host_t;
  420         out     current_time    : time_value_t);
  421 
  422 /*
  423  *      Reboot this host.
  424  *      Only available to privileged users.
  425  */
  426 routine host_reboot(
  427                 host_priv       : host_priv_t;
  428                 options         : int);
  429 
  430 /*
  431  *      Specify that the range of the virtual address space
  432  *      of the target task must not cause page faults for
  433  *      the indicated accesses.
  434  *
  435  *      [ To unwire the pages, specify VM_PROT_NONE. ]
  436  */
  437 routine vm_wire(
  438                 host_priv       : host_priv_t;
  439                 task            : vm_task_t;
  440                 address         : vm_address_t;
  441                 size            : vm_size_t;
  442                 access          : vm_prot_t);
  443 
  444 /*
  445  *      Specify that the target thread must always be able
  446  *      to run and to allocate memory.
  447  */
  448 routine thread_wire(
  449                 host_priv       : host_priv_t;
  450                 thread          : thread_t;
  451                 wired           : boolean_t);
  452 
  453 /*
  454  *      Return information about this host.
  455  */
  456 
  457 routine host_info(
  458                 host            : host_t;
  459                 flavor          : int;
  460         out     host_info_out   : host_info_t, CountInOut);
  461 
  462 
  463 /*
  464  *      Return information about this processor.
  465  */
  466 routine processor_info(
  467                 processor       : processor_t;
  468                 flavor          : int;
  469         out     host            : host_t;
  470         out     processor_info_out: processor_info_t, CountInOut);
  471 
  472 /*
  473  *      Get information about processor set.
  474  */
  475 routine processor_set_info(
  476                 set_name        : processor_set_name_t;
  477                 flavor          : int;
  478         out     host            : host_t;
  479         out     info_out        : processor_set_info_t, CountInOut);
  480 
  481 /*
  482  *      Do something machine-dependent to processor.
  483  */
  484 routine processor_control(
  485                 processor       : processor_t;
  486                 processor_cmd   : processor_info_t);
  487 
  488 /*
  489  *      Get boot configuration information from kernel.
  490  */
  491 routine host_get_boot_info(
  492                 host_priv       : host_priv_t;
  493         out     boot_info       : kernel_boot_info_t);
  494 
  495 /*
  496  *      Add a new scheduling policy to a processor set,
  497  *      and supply the limit values for the policy.
  498  */
  499 routine processor_set_policy_add(
  500                 pset            : processor_set_t;
  501                 policy          : int;
  502                 limit           : policy_param_t);
  503 
  504 /*
  505  *      Processor_set_policy_remove:
  506  *
  507  *      Remove a scheduling policy from a processor set.
  508  *      Threads running that policy are reset to
  509  *      timesharing, or to background if timesharing
  510  *      is not available on the processor set.
  511  *
  512  *      The background policy cannot be removed.
  513  */
  514 routine processor_set_policy_remove(
  515                 pset            : processor_set_t;
  516                 policy          : int);
  517 
  518 /*
  519  *      processor_set_policy_limit
  520  *
  521  *      Change the limit values for an existing scheduling policy
  522  *      on a processor set.  This affects newly created and assigned
  523  *      threads.  Optionally change existing ones.
  524  */
  525 routine processor_set_policy_limit(
  526                 pset            : processor_set_t;
  527                 policy          : int;
  528                 limit           : policy_param_t;
  529                 change_threads  : boolean_t);
  530 
  531 /*
  532  *      Thread_set_policy:
  533  *
  534  *      Set the scheduling policy for the thread,
  535  *      and provide the scheduling parameters.
  536  *      The thread's processor set control port
  537  *      must be supplied.
  538  *
  539  *      If no scheduling parameters are provided,
  540  *      the default values for the policy will be used.
  541  */
  542 routine thread_set_policy(
  543                 thread          : thread_t;
  544                 pset            : processor_set_t;
  545                 policy          : int;
  546                 param           : policy_param_t);
  547 
  548 /*
  549  *      Set scheduling parameters for a thread.
  550  *      The parameters must be valid for the current
  551  *      scheduling policy.
  552  */
  553 routine thread_set_policy_param(
  554                 thread          : thread_t;
  555                 set_limit       : boolean_t;
  556                 param           : policy_param_t);
  557 
  558 /*
  559  *      Set scheduling limits for a thread.
  560  *      The parameters must be valid for the current
  561  *      scheduling policy.
  562  */
  563 routine thread_set_policy_limit(
  564                 thread          : thread_t;
  565                 pset            : processor_set_t;
  566                 limit           : policy_param_t);
  567 
  568 /*
  569  *      Set default scheduling policy and parameters for a
  570  *      task, to be used when creating new threads in the
  571  *      task.  Optionally change the policy and parameters
  572  *      for all threads in the task.
  573  *
  574  *      The task's processor set control port must be supplied.
  575  */
  576 routine task_set_default_policy(
  577                 task            : task_t;
  578                 pset            : processor_set_t;
  579                 policy          : int;
  580                 param           : policy_param_t;
  581                 assign_threads  : boolean_t);

Cache object: 72728a2d2bef87065d39f1c2e3dde4d6


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