win-pvdrivers

annotate common/include/public/sched.h @ 62:edd4a2ad5b44

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