2008-08-12 15:41:11 -04:00
|
|
|
/******************************************************************************
|
|
|
|
|
* hypervisor.h
|
|
|
|
|
*
|
|
|
|
|
* Linux-specific hypervisor handling.
|
|
|
|
|
*
|
|
|
|
|
* Copyright (c) 2002, K A Fraser
|
2008-12-29 01:31:03 -05:00
|
|
|
*
|
|
|
|
|
* $FreeBSD$
|
2008-08-12 15:41:11 -04:00
|
|
|
*/
|
|
|
|
|
|
2009-03-11 11:30:12 -04:00
|
|
|
#ifndef __XEN_HYPERVISOR_H__
|
|
|
|
|
#define __XEN_HYPERVISOR_H__
|
|
|
|
|
|
2008-08-12 15:41:11 -04:00
|
|
|
#include <sys/cdefs.h>
|
|
|
|
|
#include <sys/systm.h>
|
2021-10-12 22:00:26 -04:00
|
|
|
#include <contrib/xen/xen.h>
|
|
|
|
|
#include <contrib/xen/platform.h>
|
|
|
|
|
#include <contrib/xen/event_channel.h>
|
|
|
|
|
#include <contrib/xen/physdev.h>
|
|
|
|
|
#include <contrib/xen/sched.h>
|
|
|
|
|
#include <contrib/xen/callback.h>
|
|
|
|
|
#include <contrib/xen/memory.h>
|
|
|
|
|
#include <contrib/xen/hvm/dm_op.h>
|
2008-08-12 15:41:11 -04:00
|
|
|
#include <machine/xen/hypercall.h>
|
|
|
|
|
|
|
|
|
|
static inline int
|
2015-10-08 12:39:43 -04:00
|
|
|
HYPERVISOR_console_write(const char *str, int count)
|
2008-08-12 15:41:11 -04:00
|
|
|
{
|
|
|
|
|
return HYPERVISOR_console_io(CONSOLEIO_write, count, str);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline int
|
|
|
|
|
HYPERVISOR_yield(void)
|
|
|
|
|
{
|
|
|
|
|
|
2022-03-27 18:10:24 -04:00
|
|
|
return (HYPERVISOR_sched_op(SCHEDOP_yield, NULL));
|
2008-08-12 15:41:11 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static inline void
|
|
|
|
|
HYPERVISOR_shutdown(unsigned int reason)
|
|
|
|
|
{
|
|
|
|
|
struct sched_shutdown sched_shutdown = {
|
|
|
|
|
.reason = reason
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
HYPERVISOR_sched_op(SCHEDOP_shutdown, &sched_shutdown);
|
|
|
|
|
}
|
|
|
|
|
|
2009-03-11 11:30:12 -04:00
|
|
|
#endif /* __XEN_HYPERVISOR_H__ */
|