ia64/xen-unstable

view xen/include/public/sched.h @ 9563:9bee4875a848

Rename sched_op->sched_op_compat and sched_op_new->sched_op
after Christian's interface cleanup.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Sat Apr 01 11:08:50 2006 +0100 (2006-04-01)
parents f85bb99187bf
children b128f55ca05c
line source
1 /******************************************************************************
2 * sched.h
3 *
4 * Scheduler state interactions
5 *
6 * Copyright (c) 2005, Keir Fraser <keir@xensource.com>
7 */
9 #ifndef __XEN_PUBLIC_SCHED_H__
10 #define __XEN_PUBLIC_SCHED_H__
12 #include "event_channel.h"
14 /*
15 * The prototype for this hypercall is:
16 * long sched_op(int cmd, void *arg)
17 * @cmd == SCHEDOP_??? (scheduler operation).
18 * @arg == Operation-specific extra argument(s), as described below.
19 *
20 * Versions of Xen prior to 3.0.2 provided only the following legacy version
21 * of this hypercall, supporting only the commands yield, block and shutdown:
22 * long sched_op(int cmd, unsigned long arg)
23 * @cmd == SCHEDOP_??? (scheduler operation).
24 * @arg == 0 (SCHEDOP_yield and SCHEDOP_block)
25 * == SHUTDOWN_* code (SCHEDOP_shutdown)
26 * This legacy version is available to new guests as sched_op_compat().
27 */
29 /*
30 * Voluntarily yield the CPU.
31 * @arg == NULL.
32 */
33 #define SCHEDOP_yield 0
35 /*
36 * Block execution of this VCPU until an event is received for processing.
37 * If called with event upcalls masked, this operation will atomically
38 * reenable event delivery and check for pending events before blocking the
39 * VCPU. This avoids a "wakeup waiting" race.
40 * @arg == NULL.
41 */
42 #define SCHEDOP_block 1
44 /*
45 * Halt execution of this domain (all VCPUs) and notify the system controller.
46 * @arg == pointer to sched_shutdown structure.
47 */
48 #define SCHEDOP_shutdown 2
49 typedef struct sched_shutdown {
50 unsigned int reason; /* SHUTDOWN_* */
51 } sched_shutdown_t;
52 DEFINE_GUEST_HANDLE(sched_shutdown_t);
54 /*
55 * Poll a set of event-channel ports. Return when one or more are pending. An
56 * optional timeout may be specified.
57 * @arg == pointer to sched_poll structure.
58 */
59 #define SCHEDOP_poll 3
60 typedef struct sched_poll {
61 GUEST_HANDLE(evtchn_port_t) ports;
62 unsigned int nr_ports;
63 uint64_t timeout;
64 } sched_poll_t;
65 DEFINE_GUEST_HANDLE(sched_poll_t);
67 /*
68 * Reason codes for SCHEDOP_shutdown. These may be interpreted by control
69 * software to determine the appropriate action. For the most part, Xen does
70 * not care about the shutdown code.
71 */
72 #define SHUTDOWN_poweroff 0 /* Domain exited normally. Clean up and kill. */
73 #define SHUTDOWN_reboot 1 /* Clean up, kill, and then restart. */
74 #define SHUTDOWN_suspend 2 /* Clean up, save suspend info, kill. */
75 #define SHUTDOWN_crash 3 /* Tell controller we've crashed. */
77 #endif /* __XEN_PUBLIC_SCHED_H__ */
79 /*
80 * Local variables:
81 * mode: C
82 * c-set-style: "BSD"
83 * c-basic-offset: 4
84 * tab-width: 4
85 * indent-tabs-mode: nil
86 * End:
87 */