11#ifndef __XEN_HYPERVISOR_H__
12#define __XEN_HYPERVISOR_H__
16#include <contrib/xen/xen.h>
17#include <contrib/xen/platform.h>
18#include <contrib/xen/event_channel.h>
19#include <contrib/xen/physdev.h>
20#include <contrib/xen/sched.h>
21#include <contrib/xen/callback.h>
22#include <contrib/xen/memory.h>
23#include <contrib/xen/hvm/dm_op.h>
24#include <machine/xen/hypercall.h>
26extern uint64_t get_system_time(
int ticks);
29HYPERVISOR_console_write(
const char *str,
int count)
31 return HYPERVISOR_console_io(CONSOLEIO_write, count, str);
37 int rc = HYPERVISOR_sched_op(SCHEDOP_yield, NULL);
39#if CONFIG_XEN_COMPAT <= 0x030002
41 rc = HYPERVISOR_sched_op_compat(SCHEDOP_yield, 0);
50 int rc = HYPERVISOR_sched_op(SCHEDOP_block, NULL);
52#if CONFIG_XEN_COMPAT <= 0x030002
54 rc = HYPERVISOR_sched_op_compat(SCHEDOP_block, 0);
60HYPERVISOR_shutdown(
unsigned int reason)
62 struct sched_shutdown sched_shutdown = {
66 HYPERVISOR_sched_op(SCHEDOP_shutdown, &sched_shutdown);
67#if CONFIG_XEN_COMPAT <= 0x030002
68 HYPERVISOR_sched_op_compat(SCHEDOP_shutdown, reason);
75 HYPERVISOR_shutdown(SHUTDOWN_crash);
84 evtchn_port_t *ports,
unsigned int nr_ports,
int ticks)
87 struct sched_poll sched_poll = {
89 .timeout = get_system_time(ticks)
91 set_xen_guest_handle(sched_poll.ports, ports);
93 rc = HYPERVISOR_sched_op(SCHEDOP_poll, &sched_poll);
94#if CONFIG_XEN_COMPAT <= 0x030002
96 rc = HYPERVISOR_sched_op_compat(SCHEDOP_yield, 0);