]>
Commit | Line | Data |
---|---|---|
d76d1650 AJ |
1 | /* |
2 | * Copyright 2008 IBM Corporation. | |
3 | * Authors: Hollis Blanchard <[email protected]> | |
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 | 14 | void kvmppc_init(void); |
d76d1650 | 15 | |
921e28db AG |
16 | #ifdef CONFIG_KVM |
17 | ||
dc333cd6 | 18 | uint32_t kvmppc_get_tbfreq(void); |
eadaada1 | 19 | uint64_t kvmppc_get_clockfreq(void); |
6659394f DG |
20 | uint32_t kvmppc_get_vmx(void); |
21 | uint32_t kvmppc_get_dfp(void); | |
1328c2bf AF |
22 | int kvmppc_get_hypercall(CPUPPCState *env, uint8_t *buf, int buf_len); |
23 | int kvmppc_set_interrupt(CPUPPCState *env, int irq, int level); | |
24 | void kvmppc_set_papr(CPUPPCState *env); | |
e97c3636 | 25 | int kvmppc_smt_threads(void); |
98efaf75 | 26 | #ifndef CONFIG_USER_ONLY |
354ac20a | 27 | off_t kvmppc_alloc_rma(const char *name, MemoryRegion *sysmem); |
0f5cb298 DG |
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); | |
98efaf75 | 30 | #endif /* !CONFIG_USER_ONLY */ |
a1e98583 | 31 | const ppc_def_t *kvmppc_host_cpu_def(void); |
12b1143b | 32 | int kvmppc_fixup_cpu(CPUPPCState *env); |
fc87e185 | 33 | |
921e28db AG |
34 | #else |
35 | ||
36 | static inline uint32_t kvmppc_get_tbfreq(void) | |
37 | { | |
38 | return 0; | |
39 | } | |
40 | ||
41 | static inline uint64_t kvmppc_get_clockfreq(void) | |
42 | { | |
43 | return 0; | |
44 | } | |
45 | ||
6659394f DG |
46 | static inline uint32_t kvmppc_get_vmx(void) |
47 | { | |
48 | return 0; | |
49 | } | |
50 | ||
51 | static inline uint32_t kvmppc_get_dfp(void) | |
52 | { | |
53 | return 0; | |
54 | } | |
55 | ||
1328c2bf | 56 | static inline int kvmppc_get_hypercall(CPUPPCState *env, uint8_t *buf, int buf_len) |
921e28db AG |
57 | { |
58 | return -1; | |
59 | } | |
60 | ||
4656e1f0 BH |
61 | static inline int kvmppc_read_segment_page_sizes(uint32_t *prop, int maxcells) |
62 | { | |
63 | return -1; | |
64 | } | |
65 | ||
1328c2bf | 66 | static inline int kvmppc_set_interrupt(CPUPPCState *env, int irq, int level) |
921e28db AG |
67 | { |
68 | return -1; | |
69 | } | |
70 | ||
1328c2bf | 71 | static inline void kvmppc_set_papr(CPUPPCState *env) |
f61b4bed AG |
72 | { |
73 | } | |
74 | ||
e97c3636 DG |
75 | static inline int kvmppc_smt_threads(void) |
76 | { | |
77 | return 1; | |
78 | } | |
79 | ||
98efaf75 | 80 | #ifndef CONFIG_USER_ONLY |
354ac20a DG |
81 | static inline off_t kvmppc_alloc_rma(const char *name, MemoryRegion *sysmem) |
82 | { | |
83 | return 0; | |
84 | } | |
85 | ||
0f5cb298 DG |
86 | static inline void *kvmppc_create_spapr_tce(uint32_t liobn, |
87 | uint32_t window_size, int *fd) | |
88 | { | |
89 | return NULL; | |
90 | } | |
91 | ||
92 | static inline int kvmppc_remove_spapr_tce(void *table, int pfd, | |
93 | uint32_t window_size) | |
94 | { | |
95 | return -1; | |
96 | } | |
98efaf75 | 97 | #endif /* !CONFIG_USER_ONLY */ |
0f5cb298 | 98 | |
a1e98583 DG |
99 | static inline const ppc_def_t *kvmppc_host_cpu_def(void) |
100 | { | |
101 | return NULL; | |
102 | } | |
103 | ||
12b1143b DG |
104 | static inline int kvmppc_fixup_cpu(CPUPPCState *env) |
105 | { | |
106 | return -1; | |
107 | } | |
921e28db AG |
108 | #endif |
109 | ||
b45d63b6 BH |
110 | #ifndef CONFIG_KVM |
111 | #define kvmppc_eieio() do { } while (0) | |
112 | #else | |
113 | #define kvmppc_eieio() \ | |
114 | do { \ | |
115 | if (kvm_enabled()) { \ | |
116 | asm volatile("eieio" : : : "memory"); \ | |
117 | } \ | |
118 | } while (0) | |
119 | #endif | |
120 | ||
fc87e185 AG |
121 | #ifndef KVM_INTERRUPT_SET |
122 | #define KVM_INTERRUPT_SET -1 | |
123 | #endif | |
124 | ||
125 | #ifndef KVM_INTERRUPT_UNSET | |
126 | #define KVM_INTERRUPT_UNSET -2 | |
127 | #endif | |
128 | ||
129 | #ifndef KVM_INTERRUPT_SET_LEVEL | |
130 | #define KVM_INTERRUPT_SET_LEVEL -3 | |
131 | #endif | |
dc333cd6 | 132 | |
d76d1650 | 133 | #endif /* __KVM_PPC_H__ */ |