]> git.proxmox.com Git - qemu.git/blame - target-ppc/kvm_ppc.h
S390: ccw firmware: Add main program
[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
2985b86b
AF
12#define TYPE_HOST_POWERPC_CPU "host-" TYPE_POWERPC_CPU
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);
1a61a9ae 22int kvmppc_get_hasidle(CPUPPCState *env);
1328c2bf 23int kvmppc_get_hypercall(CPUPPCState *env, uint8_t *buf, int buf_len);
1bc22652
AF
24int kvmppc_set_interrupt(PowerPCCPU *cpu, int irq, int level);
25void kvmppc_set_papr(PowerPCCPU *cpu);
5b95b8b9 26void kvmppc_set_mpic_proxy(PowerPCCPU *cpu, int mpic_proxy);
e97c3636 27int kvmppc_smt_threads(void);
98efaf75 28#ifndef CONFIG_USER_ONLY
354ac20a 29off_t kvmppc_alloc_rma(const char *name, MemoryRegion *sysmem);
0f5cb298
DG
30void *kvmppc_create_spapr_tce(uint32_t liobn, uint32_t window_size, int *pfd);
31int kvmppc_remove_spapr_tce(void *table, int pfd, uint32_t window_size);
7f763a5d
DG
32int kvmppc_reset_htab(int shift_hint);
33uint64_t kvmppc_rma_size(uint64_t current_size, unsigned int hash_shift);
98efaf75 34#endif /* !CONFIG_USER_ONLY */
55e5c285 35int kvmppc_fixup_cpu(PowerPCCPU *cpu);
fc87e185 36
921e28db
AG
37#else
38
39static inline uint32_t kvmppc_get_tbfreq(void)
40{
41 return 0;
42}
43
44static inline uint64_t kvmppc_get_clockfreq(void)
45{
46 return 0;
47}
48
6659394f
DG
49static inline uint32_t kvmppc_get_vmx(void)
50{
51 return 0;
52}
53
54static inline uint32_t kvmppc_get_dfp(void)
55{
56 return 0;
57}
58
1a61a9ae
SY
59static inline int kvmppc_get_hasidle(CPUPPCState *env)
60{
61 return 0;
62}
63
1328c2bf 64static inline int kvmppc_get_hypercall(CPUPPCState *env, uint8_t *buf, int buf_len)
921e28db
AG
65{
66 return -1;
67}
68
4656e1f0
BH
69static inline int kvmppc_read_segment_page_sizes(uint32_t *prop, int maxcells)
70{
71 return -1;
72}
73
1bc22652 74static inline int kvmppc_set_interrupt(PowerPCCPU *cpu, int irq, int level)
921e28db
AG
75{
76 return -1;
77}
78
1bc22652 79static inline void kvmppc_set_papr(PowerPCCPU *cpu)
f61b4bed
AG
80{
81}
82
5b95b8b9
AG
83static inline void kvmppc_set_mpic_proxy(PowerPCCPU *cpu, int mpic_proxy)
84{
85}
86
e97c3636
DG
87static inline int kvmppc_smt_threads(void)
88{
89 return 1;
90}
91
98efaf75 92#ifndef CONFIG_USER_ONLY
354ac20a
DG
93static inline off_t kvmppc_alloc_rma(const char *name, MemoryRegion *sysmem)
94{
95 return 0;
96}
97
0f5cb298
DG
98static inline void *kvmppc_create_spapr_tce(uint32_t liobn,
99 uint32_t window_size, int *fd)
100{
101 return NULL;
102}
103
104static inline int kvmppc_remove_spapr_tce(void *table, int pfd,
105 uint32_t window_size)
106{
107 return -1;
108}
7f763a5d
DG
109
110static inline int kvmppc_reset_htab(int shift_hint)
111{
112 return -1;
113}
114
115static inline uint64_t kvmppc_rma_size(uint64_t current_size,
116 unsigned int hash_shift)
117{
118 return ram_size;
119}
120
121static inline int kvmppc_update_sdr1(CPUPPCState *env)
122{
123 return 0;
124}
125
98efaf75 126#endif /* !CONFIG_USER_ONLY */
0f5cb298 127
55e5c285 128static inline int kvmppc_fixup_cpu(PowerPCCPU *cpu)
12b1143b
DG
129{
130 return -1;
131}
921e28db
AG
132#endif
133
b45d63b6
BH
134#ifndef CONFIG_KVM
135#define kvmppc_eieio() do { } while (0)
136#else
137#define kvmppc_eieio() \
138 do { \
139 if (kvm_enabled()) { \
140 asm volatile("eieio" : : : "memory"); \
141 } \
142 } while (0)
143#endif
144
fc87e185
AG
145#ifndef KVM_INTERRUPT_SET
146#define KVM_INTERRUPT_SET -1
147#endif
148
149#ifndef KVM_INTERRUPT_UNSET
150#define KVM_INTERRUPT_UNSET -2
151#endif
152
153#ifndef KVM_INTERRUPT_SET_LEVEL
154#define KVM_INTERRUPT_SET_LEVEL -3
155#endif
dc333cd6 156
d76d1650 157#endif /* __KVM_PPC_H__ */