kvm_para.h 808 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #ifndef __LINUX_KVM_PARA_H
  2. #define __LINUX_KVM_PARA_H
  3. /*
  4. * This header file provides a method for making a hypercall to the host
  5. * Architectures should define:
  6. * - kvm_hypercall0, kvm_hypercall1...
  7. * - kvm_arch_para_features
  8. * - kvm_para_available
  9. */
  10. /* Return values for hypercalls */
  11. #define KVM_ENOSYS 1000
  12. #define KVM_EFAULT EFAULT
  13. #define KVM_E2BIG E2BIG
  14. #define KVM_EPERM EPERM
  15. #define KVM_HC_VAPIC_POLL_IRQ 1
  16. #define KVM_HC_MMU_OP 2
  17. #define KVM_HC_FEATURES 3
  18. #define KVM_HC_PPC_MAP_MAGIC_PAGE 4
  19. /*
  20. * hypercalls use architecture specific
  21. */
  22. #include <asm/kvm_para.h>
  23. #ifdef __KERNEL__
  24. static inline int kvm_para_has_feature(unsigned int feature)
  25. {
  26. if (kvm_arch_para_features() & (1UL << feature))
  27. return 1;
  28. return 0;
  29. }
  30. #endif /* __KERNEL__ */
  31. #endif /* __LINUX_KVM_PARA_H */