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/xen/interface/sched.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  * sched.h
    3  * 
    4  * Scheduler state interactions
    5  * 
    6  * Permission is hereby granted, free of charge, to any person obtaining a copy
    7  * of this software and associated documentation files (the "Software"), to
    8  * deal in the Software without restriction, including without limitation the
    9  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
   10  * sell copies of the Software, and to permit persons to whom the Software is
   11  * furnished to do so, subject to the following conditions:
   12  *
   13  * The above copyright notice and this permission notice shall be included in
   14  * all copies or substantial portions of the Software.
   15  *
   16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
   17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
   18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
   19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
   20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
   21  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
   22  * DEALINGS IN THE SOFTWARE.
   23  *
   24  * Copyright (c) 2005, Keir Fraser <keir@xensource.com>
   25  */
   26 
   27 #ifndef __XEN_PUBLIC_SCHED_H__
   28 #define __XEN_PUBLIC_SCHED_H__
   29 
   30 #include "event_channel.h"
   31 
   32 /*
   33  * The prototype for this hypercall is:
   34  *  long sched_op(int cmd, void *arg)
   35  * @cmd == SCHEDOP_??? (scheduler operation).
   36  * @arg == Operation-specific extra argument(s), as described below.
   37  * 
   38  * Versions of Xen prior to 3.0.2 provided only the following legacy version
   39  * of this hypercall, supporting only the commands yield, block and shutdown:
   40  *  long sched_op(int cmd, unsigned long arg)
   41  * @cmd == SCHEDOP_??? (scheduler operation).
   42  * @arg == 0               (SCHEDOP_yield and SCHEDOP_block)
   43  *      == SHUTDOWN_* code (SCHEDOP_shutdown)
   44  * This legacy version is available to new guests as sched_op_compat().
   45  */
   46 
   47 /*
   48  * Voluntarily yield the CPU.
   49  * @arg == NULL.
   50  */
   51 #define SCHEDOP_yield       0
   52 
   53 /*
   54  * Block execution of this VCPU until an event is received for processing.
   55  * If called with event upcalls masked, this operation will atomically
   56  * reenable event delivery and check for pending events before blocking the
   57  * VCPU. This avoids a "wakeup waiting" race.
   58  * @arg == NULL.
   59  */
   60 #define SCHEDOP_block       1
   61 
   62 /*
   63  * Halt execution of this domain (all VCPUs) and notify the system controller.
   64  * @arg == pointer to sched_shutdown structure.
   65  */
   66 #define SCHEDOP_shutdown    2
   67 struct sched_shutdown {
   68     unsigned int reason; /* SHUTDOWN_* */
   69 };
   70 typedef struct sched_shutdown sched_shutdown_t;
   71 DEFINE_XEN_GUEST_HANDLE(sched_shutdown_t);
   72 
   73 /*
   74  * Poll a set of event-channel ports. Return when one or more are pending. An
   75  * optional timeout may be specified.
   76  * @arg == pointer to sched_poll structure.
   77  */
   78 #define SCHEDOP_poll        3
   79 struct sched_poll {
   80     XEN_GUEST_HANDLE(evtchn_port_t) ports;
   81     unsigned int nr_ports;
   82     uint64_t timeout;
   83 };
   84 typedef struct sched_poll sched_poll_t;
   85 DEFINE_XEN_GUEST_HANDLE(sched_poll_t);
   86 
   87 /*
   88  * Declare a shutdown for another domain. The main use of this function is
   89  * in interpreting shutdown requests and reasons for fully-virtualized
   90  * domains.  A para-virtualized domain may use SCHEDOP_shutdown directly.
   91  * @arg == pointer to sched_remote_shutdown structure.
   92  */
   93 #define SCHEDOP_remote_shutdown        4
   94 struct sched_remote_shutdown {
   95     domid_t domain_id;         /* Remote domain ID */
   96     unsigned int reason;       /* SHUTDOWN_xxx reason */
   97 };
   98 typedef struct sched_remote_shutdown sched_remote_shutdown_t;
   99 DEFINE_XEN_GUEST_HANDLE(sched_remote_shutdown_t);
  100 
  101 /*
  102  * Reason codes for SCHEDOP_shutdown. These may be interpreted by control
  103  * software to determine the appropriate action. For the most part, Xen does
  104  * not care about the shutdown code.
  105  */
  106 #define SHUTDOWN_poweroff   0  /* Domain exited normally. Clean up and kill. */
  107 #define SHUTDOWN_reboot     1  /* Clean up, kill, and then restart.          */
  108 #define SHUTDOWN_suspend    2  /* Clean up, save suspend info, kill.         */
  109 #define SHUTDOWN_crash      3  /* Tell controller we've crashed.             */
  110 
  111 #endif /* __XEN_PUBLIC_SCHED_H__ */
  112 
  113 /*
  114  * Local variables:
  115  * mode: C
  116  * c-set-style: "BSD"
  117  * c-basic-offset: 4
  118  * tab-width: 4
  119  * indent-tabs-mode: nil
  120  * End:
  121  */

Cache object: 1d3c360f9268ec8dd9902bfa0c184446


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