xref: /openbmc/qemu/target/i386/hvf/hvf-i386.h (revision 37677d7d)
1 /*
2  * QEMU Hypervisor.framework (HVF) support
3  *
4  * Copyright 2017 Google Inc
5  *
6  * Adapted from target-i386/hax-i386.h:
7  * Copyright (c) 2011 Intel Corporation
8  *  Written by:
9  *  Jiang Yunhong<yunhong.jiang@intel.com>
10  *
11  * This work is licensed under the terms of the GNU GPL, version 2 or later.
12  * See the COPYING file in the top-level directory.
13  *
14  */
15 
16 #ifndef HVF_I386_H
17 #define HVF_I386_H
18 
19 #include "sysemu/hvf.h"
20 #include "cpu.h"
21 #include "x86.h"
22 
23 #define HVF_MAX_VCPU 0x10
24 #define MAX_VM_ID 0x40
25 #define MAX_VCPU_ID 0x40
26 
27 extern struct hvf_state hvf_global;
28 
29 struct hvf_vm {
30     int id;
31     struct hvf_vcpu_state *vcpus[HVF_MAX_VCPU];
32 };
33 
34 struct hvf_state {
35     uint32_t version;
36     struct hvf_vm *vm;
37     uint64_t mem_quota;
38 };
39 
40 #ifdef NEED_CPU_H
41 /* Functions exported to host specific mode */
42 
43 /* Host specific functions */
44 int hvf_inject_interrupt(CPUArchState *env, int vector);
45 int hvf_vcpu_run(struct hvf_vcpu_state *vcpu);
46 #endif
47 
48 #endif
49