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-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-2  -  FREEBSD-11-1  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-4  -  FREEBSD-10-3  -  FREEBSD-10-2  -  FREEBSD-10-1  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-3  -  FREEBSD-9-2  -  FREEBSD-9-1  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-4  -  FREEBSD-8-3  -  FREEBSD-8-2  -  FREEBSD-8-1  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-4  -  FREEBSD-7-3  -  FREEBSD-7-2  -  FREEBSD-7-1  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-4  -  FREEBSD-6-3  -  FREEBSD-6-2  -  FREEBSD-6-1  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-5  -  FREEBSD-5-4  -  FREEBSD-5-3  -  FREEBSD-5-2  -  FREEBSD-5-1  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  linux-2.6  -  linux-2.4.22  -  MK83  -  MK84  -  PLAN9  -  DFBSD  -  NETBSD  -  NETBSD5  -  NETBSD4  -  NETBSD3  -  NETBSD20  -  OPENBSD  -  xnu-517  -  xnu-792  -  xnu-792.6.70  -  xnu-1228  -  xnu-1456.1.26  -  xnu-1699.24.8  -  xnu-2050.18.24  -  OPENSOLARIS  -  minix-3-1-1 
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  * Latch a shutdown code, so that when the domain later shuts down it
  103  * reports this code to the control tools.
  104  * @arg == as for SCHEDOP_shutdown.
  105  */
  106 #define SCHEDOP_shutdown_code 5
  107 
  108 /*
  109  * Setup, poke and destroy a domain watchdog timer.
  110  * @arg == pointer to sched_watchdog structure.
  111  * With id == 0, setup a domain watchdog timer to cause domain shutdown
  112  *               after timeout, returns watchdog id.
  113  * With id != 0 and timeout == 0, destroy domain watchdog timer.
  114  * With id != 0 and timeout != 0, poke watchdog timer and set new timeout.
  115  */
  116 #define SCHEDOP_watchdog    6
  117 struct sched_watchdog {
  118     uint32_t id;                /* watchdog ID */
  119     uint32_t timeout;           /* timeout */
  120 };
  121 typedef struct sched_watchdog sched_watchdog_t;
  122 DEFINE_XEN_GUEST_HANDLE(sched_watchdog_t);
  123 
  124 /*
  125  * Reason codes for SCHEDOP_shutdown. These may be interpreted by control
  126  * software to determine the appropriate action. For the most part, Xen does
  127  * not care about the shutdown code.
  128  */
  129 #define SHUTDOWN_poweroff   0  /* Domain exited normally. Clean up and kill. */
  130 #define SHUTDOWN_reboot     1  /* Clean up, kill, and then restart.          */
  131 #define SHUTDOWN_suspend    2  /* Clean up, save suspend info, kill.         */
  132 #define SHUTDOWN_crash      3  /* Tell controller we've crashed.             */
  133 #define SHUTDOWN_watchdog   4  /* Restart because watchdog time expired.     */
  134 
  135 #endif /* __XEN_PUBLIC_SCHED_H__ */
  136 
  137 /*
  138  * Local variables:
  139  * mode: C
  140  * c-set-style: "BSD"
  141  * c-basic-offset: 4
  142  * tab-width: 4
  143  * indent-tabs-mode: nil
  144  * End:
  145  */

Cache object: b4667e209220cc80ad8312de4e8dbef8


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