]>
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); |
45024f09 | 20 | int kvmppc_get_hypercall(CPUState *env, uint8_t *buf, int buf_len); |
fc87e185 | 21 | int kvmppc_set_interrupt(CPUState *env, int irq, int level); |
f61b4bed | 22 | void kvmppc_set_papr(CPUState *env); |
e97c3636 | 23 | int kvmppc_smt_threads(void); |
354ac20a | 24 | off_t kvmppc_alloc_rma(const char *name, MemoryRegion *sysmem); |
0f5cb298 DG |
25 | void *kvmppc_create_spapr_tce(uint32_t liobn, uint32_t window_size, int *pfd); |
26 | int kvmppc_remove_spapr_tce(void *table, int pfd, uint32_t window_size); | |
fc87e185 | 27 | |
921e28db AG |
28 | #else |
29 | ||
30 | static inline uint32_t kvmppc_get_tbfreq(void) | |
31 | { | |
32 | return 0; | |
33 | } | |
34 | ||
35 | static inline uint64_t kvmppc_get_clockfreq(void) | |
36 | { | |
37 | return 0; | |
38 | } | |
39 | ||
40 | static inline int kvmppc_get_hypercall(CPUState *env, uint8_t *buf, int buf_len) | |
41 | { | |
42 | return -1; | |
43 | } | |
44 | ||
45 | static inline int kvmppc_set_interrupt(CPUState *env, int irq, int level) | |
46 | { | |
47 | return -1; | |
48 | } | |
49 | ||
f61b4bed AG |
50 | static inline void kvmppc_set_papr(CPUState *env) |
51 | { | |
52 | } | |
53 | ||
e97c3636 DG |
54 | static inline int kvmppc_smt_threads(void) |
55 | { | |
56 | return 1; | |
57 | } | |
58 | ||
354ac20a DG |
59 | static inline off_t kvmppc_alloc_rma(const char *name, MemoryRegion *sysmem) |
60 | { | |
61 | return 0; | |
62 | } | |
63 | ||
0f5cb298 DG |
64 | static inline void *kvmppc_create_spapr_tce(uint32_t liobn, |
65 | uint32_t window_size, int *fd) | |
66 | { | |
67 | return NULL; | |
68 | } | |
69 | ||
70 | static inline int kvmppc_remove_spapr_tce(void *table, int pfd, | |
71 | uint32_t window_size) | |
72 | { | |
73 | return -1; | |
74 | } | |
75 | ||
921e28db AG |
76 | #endif |
77 | ||
b45d63b6 BH |
78 | #ifndef CONFIG_KVM |
79 | #define kvmppc_eieio() do { } while (0) | |
80 | #else | |
81 | #define kvmppc_eieio() \ | |
82 | do { \ | |
83 | if (kvm_enabled()) { \ | |
84 | asm volatile("eieio" : : : "memory"); \ | |
85 | } \ | |
86 | } while (0) | |
87 | #endif | |
88 | ||
fc87e185 AG |
89 | #ifndef KVM_INTERRUPT_SET |
90 | #define KVM_INTERRUPT_SET -1 | |
91 | #endif | |
92 | ||
93 | #ifndef KVM_INTERRUPT_UNSET | |
94 | #define KVM_INTERRUPT_UNSET -2 | |
95 | #endif | |
96 | ||
97 | #ifndef KVM_INTERRUPT_SET_LEVEL | |
98 | #define KVM_INTERRUPT_SET_LEVEL -3 | |
99 | #endif | |
dc333cd6 | 100 | |
d76d1650 | 101 | #endif /* __KVM_PPC_H__ */ |