2007-02-19 19:37:47 +07:00
|
|
|
#ifndef __LINUX_KVM_PARA_H
|
|
|
|
#define __LINUX_KVM_PARA_H
|
|
|
|
|
2007-10-11 20:34:17 +07:00
|
|
|
/*
|
|
|
|
* This header file provides a method for making a hypercall to the host
|
|
|
|
* Architectures should define:
|
|
|
|
* - kvm_hypercall0, kvm_hypercall1...
|
|
|
|
* - kvm_arch_para_features
|
|
|
|
* - kvm_para_available
|
2007-02-19 19:37:47 +07:00
|
|
|
*/
|
|
|
|
|
2007-09-18 02:57:50 +07:00
|
|
|
/* Return values for hypercalls */
|
|
|
|
#define KVM_ENOSYS 1000
|
2008-02-23 00:21:37 +07:00
|
|
|
#define KVM_EFAULT EFAULT
|
|
|
|
#define KVM_E2BIG E2BIG
|
2009-08-03 23:43:28 +07:00
|
|
|
#define KVM_EPERM EPERM
|
2007-02-19 19:37:47 +07:00
|
|
|
|
2008-02-23 00:21:37 +07:00
|
|
|
#define KVM_HC_VAPIC_POLL_IRQ 1
|
|
|
|
#define KVM_HC_MMU_OP 2
|
2007-10-25 21:52:32 +07:00
|
|
|
|
2007-10-11 20:34:17 +07:00
|
|
|
/*
|
|
|
|
* hypercalls use architecture specific
|
2007-02-19 19:37:47 +07:00
|
|
|
*/
|
2007-10-11 20:34:17 +07:00
|
|
|
#include <asm/kvm_para.h>
|
2007-09-18 02:57:50 +07:00
|
|
|
|
2008-01-15 22:10:15 +07:00
|
|
|
#ifdef __KERNEL__
|
2008-02-23 00:21:36 +07:00
|
|
|
#ifdef CONFIG_KVM_GUEST
|
|
|
|
void __init kvm_guest_init(void);
|
|
|
|
#else
|
|
|
|
#define kvm_guest_init() do { } while (0)
|
|
|
|
#endif
|
|
|
|
|
2007-09-18 02:57:50 +07:00
|
|
|
static inline int kvm_para_has_feature(unsigned int feature)
|
|
|
|
{
|
2007-10-11 20:34:17 +07:00
|
|
|
if (kvm_arch_para_features() & (1UL << feature))
|
2007-09-18 02:57:50 +07:00
|
|
|
return 1;
|
|
|
|
return 0;
|
|
|
|
}
|
2007-10-11 20:34:17 +07:00
|
|
|
#endif /* __KERNEL__ */
|
|
|
|
#endif /* __LINUX_KVM_PARA_H */
|
2007-09-18 02:57:50 +07:00
|
|
|
|