]>
Commit | Line | Data |
---|---|---|
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 | ||
12 | void kvmppc_init(void); | |
d76d1650 | 13 | |
921e28db AG |
14 | #ifdef CONFIG_KVM |
15 | ||
dc333cd6 | 16 | uint32_t kvmppc_get_tbfreq(void); |
eadaada1 | 17 | uint64_t kvmppc_get_clockfreq(void); |
45024f09 | 18 | int kvmppc_get_hypercall(CPUState *env, uint8_t *buf, int buf_len); |
fc87e185 | 19 | int kvmppc_set_interrupt(CPUState *env, int irq, int level); |
f61b4bed | 20 | void kvmppc_set_papr(CPUState *env); |
fc87e185 | 21 | |
921e28db AG |
22 | #else |
23 | ||
24 | static inline uint32_t kvmppc_get_tbfreq(void) | |
25 | { | |
26 | return 0; | |
27 | } | |
28 | ||
29 | static inline uint64_t kvmppc_get_clockfreq(void) | |
30 | { | |
31 | return 0; | |
32 | } | |
33 | ||
34 | static inline int kvmppc_get_hypercall(CPUState *env, uint8_t *buf, int buf_len) | |
35 | { | |
36 | return -1; | |
37 | } | |
38 | ||
39 | static inline int kvmppc_set_interrupt(CPUState *env, int irq, int level) | |
40 | { | |
41 | return -1; | |
42 | } | |
43 | ||
f61b4bed AG |
44 | static inline void kvmppc_set_papr(CPUState *env) |
45 | { | |
46 | } | |
47 | ||
921e28db AG |
48 | #endif |
49 | ||
b45d63b6 BH |
50 | #ifndef CONFIG_KVM |
51 | #define kvmppc_eieio() do { } while (0) | |
52 | #else | |
53 | #define kvmppc_eieio() \ | |
54 | do { \ | |
55 | if (kvm_enabled()) { \ | |
56 | asm volatile("eieio" : : : "memory"); \ | |
57 | } \ | |
58 | } while (0) | |
59 | #endif | |
60 | ||
fc87e185 AG |
61 | #ifndef KVM_INTERRUPT_SET |
62 | #define KVM_INTERRUPT_SET -1 | |
63 | #endif | |
64 | ||
65 | #ifndef KVM_INTERRUPT_UNSET | |
66 | #define KVM_INTERRUPT_UNSET -2 | |
67 | #endif | |
68 | ||
69 | #ifndef KVM_INTERRUPT_SET_LEVEL | |
70 | #define KVM_INTERRUPT_SET_LEVEL -3 | |
71 | #endif | |
dc333cd6 | 72 | |
d76d1650 | 73 | #endif /* __KVM_PPC_H__ */ |