vl.c: prohibit simultaneous use of -icount with kvm or xen
[qemu.git] / target-ppc / kvm_ppc.h
blobf9c019831154abb3e76433a15544a54be0e92417
1 /*
2 * Copyright 2008 IBM Corporation.
3 * Authors: Hollis Blanchard <hollisb@us.ibm.com>
5 * This work is licensed under the GNU GPL license version 2 or later.
7 */
9 #ifndef __KVM_PPC_H__
10 #define __KVM_PPC_H__
12 #include "memory.h"
14 void kvmppc_init(void);
16 #ifdef CONFIG_KVM
18 uint32_t kvmppc_get_tbfreq(void);
19 uint64_t kvmppc_get_clockfreq(void);
20 uint32_t kvmppc_get_vmx(void);
21 uint32_t kvmppc_get_dfp(void);
22 int kvmppc_get_hypercall(CPUState *env, uint8_t *buf, int buf_len);
23 int kvmppc_set_interrupt(CPUState *env, int irq, int level);
24 void kvmppc_set_papr(CPUState *env);
25 int kvmppc_smt_threads(void);
26 #ifndef CONFIG_USER_ONLY
27 off_t kvmppc_alloc_rma(const char *name, MemoryRegion *sysmem);
28 void *kvmppc_create_spapr_tce(uint32_t liobn, uint32_t window_size, int *pfd);
29 int kvmppc_remove_spapr_tce(void *table, int pfd, uint32_t window_size);
30 #endif /* !CONFIG_USER_ONLY */
31 const ppc_def_t *kvmppc_host_cpu_def(void);
33 #else
35 static inline uint32_t kvmppc_get_tbfreq(void)
37 return 0;
40 static inline uint64_t kvmppc_get_clockfreq(void)
42 return 0;
45 static inline uint32_t kvmppc_get_vmx(void)
47 return 0;
50 static inline uint32_t kvmppc_get_dfp(void)
52 return 0;
55 static inline int kvmppc_get_hypercall(CPUState *env, uint8_t *buf, int buf_len)
57 return -1;
60 static inline int kvmppc_set_interrupt(CPUState *env, int irq, int level)
62 return -1;
65 static inline void kvmppc_set_papr(CPUState *env)
69 static inline int kvmppc_smt_threads(void)
71 return 1;
74 #ifndef CONFIG_USER_ONLY
75 static inline off_t kvmppc_alloc_rma(const char *name, MemoryRegion *sysmem)
77 return 0;
80 static inline void *kvmppc_create_spapr_tce(uint32_t liobn,
81 uint32_t window_size, int *fd)
83 return NULL;
86 static inline int kvmppc_remove_spapr_tce(void *table, int pfd,
87 uint32_t window_size)
89 return -1;
91 #endif /* !CONFIG_USER_ONLY */
93 static inline const ppc_def_t *kvmppc_host_cpu_def(void)
95 return NULL;
98 #endif
100 #ifndef CONFIG_KVM
101 #define kvmppc_eieio() do { } while (0)
102 #else
103 #define kvmppc_eieio() \
104 do { \
105 if (kvm_enabled()) { \
106 asm volatile("eieio" : : : "memory"); \
108 } while (0)
109 #endif
111 #ifndef KVM_INTERRUPT_SET
112 #define KVM_INTERRUPT_SET -1
113 #endif
115 #ifndef KVM_INTERRUPT_UNSET
116 #define KVM_INTERRUPT_UNSET -2
117 #endif
119 #ifndef KVM_INTERRUPT_SET_LEVEL
120 #define KVM_INTERRUPT_SET_LEVEL -3
121 #endif
123 #endif /* __KVM_PPC_H__ */