]> git.proxmox.com Git - qemu.git/blame - target-ppc/kvm_ppc.h
target-ppc: Drop cpu_ppc_close()
[qemu.git] / target-ppc / kvm_ppc.h
CommitLineData
d76d1650
AJ
1/*
2 * Copyright 2008 IBM Corporation.
3 * Authors: Hollis Blanchard <hollisb@us.ibm.com>
4 *
5 * This work is licensed under the GNU GPL license version 2 or later.
6 *
7 */
8
9#ifndef __KVM_PPC_H__
10#define __KVM_PPC_H__
11
354ac20a
DG
12#include "memory.h"
13
d76d1650 14void kvmppc_init(void);
d76d1650 15
921e28db
AG
16#ifdef CONFIG_KVM
17
dc333cd6 18uint32_t kvmppc_get_tbfreq(void);
eadaada1 19uint64_t kvmppc_get_clockfreq(void);
6659394f
DG
20uint32_t kvmppc_get_vmx(void);
21uint32_t kvmppc_get_dfp(void);
1328c2bf
AF
22int kvmppc_get_hypercall(CPUPPCState *env, uint8_t *buf, int buf_len);
23int kvmppc_set_interrupt(CPUPPCState *env, int irq, int level);
24void kvmppc_set_papr(CPUPPCState *env);
e97c3636 25int kvmppc_smt_threads(void);
98efaf75 26#ifndef CONFIG_USER_ONLY
354ac20a 27off_t kvmppc_alloc_rma(const char *name, MemoryRegion *sysmem);
0f5cb298
DG
28void *kvmppc_create_spapr_tce(uint32_t liobn, uint32_t window_size, int *pfd);
29int kvmppc_remove_spapr_tce(void *table, int pfd, uint32_t window_size);
98efaf75 30#endif /* !CONFIG_USER_ONLY */
a1e98583 31const ppc_def_t *kvmppc_host_cpu_def(void);
fc87e185 32
921e28db
AG
33#else
34
35static inline uint32_t kvmppc_get_tbfreq(void)
36{
37 return 0;
38}
39
40static inline uint64_t kvmppc_get_clockfreq(void)
41{
42 return 0;
43}
44
6659394f
DG
45static inline uint32_t kvmppc_get_vmx(void)
46{
47 return 0;
48}
49
50static inline uint32_t kvmppc_get_dfp(void)
51{
52 return 0;
53}
54
1328c2bf 55static inline int kvmppc_get_hypercall(CPUPPCState *env, uint8_t *buf, int buf_len)
921e28db
AG
56{
57 return -1;
58}
59
1328c2bf 60static inline int kvmppc_set_interrupt(CPUPPCState *env, int irq, int level)
921e28db
AG
61{
62 return -1;
63}
64
1328c2bf 65static inline void kvmppc_set_papr(CPUPPCState *env)
f61b4bed
AG
66{
67}
68
e97c3636
DG
69static inline int kvmppc_smt_threads(void)
70{
71 return 1;
72}
73
98efaf75 74#ifndef CONFIG_USER_ONLY
354ac20a
DG
75static inline off_t kvmppc_alloc_rma(const char *name, MemoryRegion *sysmem)
76{
77 return 0;
78}
79
0f5cb298
DG
80static inline void *kvmppc_create_spapr_tce(uint32_t liobn,
81 uint32_t window_size, int *fd)
82{
83 return NULL;
84}
85
86static inline int kvmppc_remove_spapr_tce(void *table, int pfd,
87 uint32_t window_size)
88{
89 return -1;
90}
98efaf75 91#endif /* !CONFIG_USER_ONLY */
0f5cb298 92
a1e98583
DG
93static inline const ppc_def_t *kvmppc_host_cpu_def(void)
94{
95 return NULL;
96}
97
921e28db
AG
98#endif
99
b45d63b6
BH
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"); \
107 } \
108 } while (0)
109#endif
110
fc87e185
AG
111#ifndef KVM_INTERRUPT_SET
112#define KVM_INTERRUPT_SET -1
113#endif
114
115#ifndef KVM_INTERRUPT_UNSET
116#define KVM_INTERRUPT_UNSET -2
117#endif
118
119#ifndef KVM_INTERRUPT_SET_LEVEL
120#define KVM_INTERRUPT_SET_LEVEL -3
121#endif
dc333cd6 122
d76d1650 123#endif /* __KVM_PPC_H__ */