kvm: testsuite: rename apic.h to fake-apic.h
[qemu-kvm/fedora.git] / kvm.h
blob0265446ddb1cf07339818995be9c6e462374aee3
1 /*
2 * QEMU KVM support
4 * Copyright IBM, Corp. 2008
6 * Authors:
7 * Anthony Liguori <aliguori@us.ibm.com>
9 * This work is licensed under the terms of the GNU GPL, version 2 or later.
10 * See the COPYING file in the top-level directory.
14 #ifndef QEMU_KVM_H
15 #define QEMU_KVM_H
17 #ifdef KVM_UPSTREAM
19 #include "config.h"
21 #ifdef CONFIG_KVM
22 extern int kvm_allowed;
24 #define kvm_enabled() (kvm_allowed)
25 #else
26 #define kvm_enabled() (0)
27 #endif
29 struct kvm_run;
31 /* external API */
33 int kvm_init(int smp_cpus);
35 int kvm_init_vcpu(CPUState *env);
37 int kvm_cpu_exec(CPUState *env);
39 void kvm_set_phys_mem(target_phys_addr_t start_addr,
40 ram_addr_t size,
41 ram_addr_t phys_offset);
43 /* internal API */
45 struct KVMState;
46 typedef struct KVMState KVMState;
48 int kvm_ioctl(KVMState *s, int type, void *data);
50 int kvm_vm_ioctl(KVMState *s, int type, void *data);
52 int kvm_vcpu_ioctl(CPUState *env, int type, void *data);
54 /* Arch specific hooks */
56 int kvm_arch_post_run(CPUState *env, struct kvm_run *run);
58 int kvm_arch_handle_exit(CPUState *env, struct kvm_run *run);
60 int kvm_arch_pre_run(CPUState *env, struct kvm_run *run);
62 int kvm_arch_get_registers(CPUState *env);
64 int kvm_arch_put_registers(CPUState *env);
66 int kvm_arch_init(KVMState *s, int smp_cpus);
68 int kvm_arch_init_vcpu(CPUState *env);
70 #endif
72 #endif