xref: /openbmc/qemu/target/i386/hvf/hvf-i386.h (revision 2261d393)
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 
25 extern struct hvf_state hvf_global;
26 
27 struct hvf_vm {
28     int id;
29     struct hvf_vcpu_state *vcpus[HVF_MAX_VCPU];
30 };
31 
32 struct hvf_state {
33     uint32_t version;
34     struct hvf_vm *vm;
35     uint64_t mem_quota;
36 };
37 
38 #ifdef NEED_CPU_H
39 /* Functions exported to host specific mode */
40 
41 /* Host specific functions */
42 int hvf_inject_interrupt(CPUArchState *env, int vector);
43 int hvf_vcpu_run(struct hvf_vcpu_state *vcpu);
44 #endif
45 
46 #endif
47