#ifndef _NVMM_H_
#define _NVMM_H_
#include <sys/cdefs.h>
#include <sys/types.h>
#ifndef _KERNEL
#include <stdbool.h>
#endif
#if defined(__HAIKU__)
#include <stdint.h>
#include <stdbool.h>
#endif
typedef uint64_t gpaddr_t;
typedef uint64_t gvaddr_t;
typedef uint32_t nvmm_machid_t;
typedef uint32_t nvmm_cpuid_t;
#undef CTASSERT
#define CTASSERT(x) NVMM_CTASSERT(x, __LINE__)
#define NVMM_CTASSERT(x, y) NVMM__CTASSERT(x, y)
#if defined(__cplusplus)
#define NVMM__CTASSERT(x, y) static_assert(x, #x)
#else
#define NVMM__CTASSERT(x, y) _Static_assert(x, #x)
#endif
#if defined(__x86_64__)
#if defined(__NetBSD__)
#include <dev/nvmm/x86/nvmm_x86.h>
#elif defined(__DragonFly__)
#include <dev/virtual/nvmm/x86/nvmm_x86.h>
#elif defined(__HAIKU__)
#include "x86/nvmm_x86.h"
#endif
#endif
#define NVMM_KERN_VERSION 3
struct nvmm_capability {
uint32_t version;
uint32_t state_size;
uint32_t comm_size;
uint32_t max_machines;
uint32_t max_vcpus;
uint64_t max_ram;
struct nvmm_cap_md arch;
};
#define NVMM_MACH_CONF_LIBNVMM_BEGIN 0
#define NVMM_MACH_CONF_MI_BEGIN 100
#define NVMM_MACH_CONF_MD_BEGIN 200
#define NVMM_MACH_CONF_MD(op) (op - NVMM_MACH_CONF_MD_BEGIN)
#define NVMM_VCPU_CONF_LIBNVMM_BEGIN 0
#define NVMM_VCPU_CONF_MI_BEGIN 100
#define NVMM_VCPU_CONF_MD_BEGIN 200
#define NVMM_VCPU_CONF_MD(op) (op - NVMM_VCPU_CONF_MD_BEGIN)
struct nvmm_comm_page {
uint64_t state_wanted;
uint64_t state_cached;
uint64_t state_commit;
struct nvmm_vcpu_state state;
bool event_commit;
struct nvmm_vcpu_event event;
};
#endif