]> Git Repo - qemu.git/blob - target-ppc/kvm_ppc.h
Merge remote-tracking branch 'upstream' into memory/batch
[qemu.git] / target-ppc / kvm_ppc.h
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
12 void kvmppc_init(void);
13
14 #ifdef CONFIG_KVM
15
16 uint32_t kvmppc_get_tbfreq(void);
17 uint64_t kvmppc_get_clockfreq(void);
18 int kvmppc_get_hypercall(CPUState *env, uint8_t *buf, int buf_len);
19 int kvmppc_set_interrupt(CPUState *env, int irq, int level);
20 void kvmppc_set_papr(CPUState *env);
21
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
44 static inline void kvmppc_set_papr(CPUState *env)
45 {
46 }
47
48 #endif
49
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
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
72
73 #endif /* __KVM_PPC_H__ */
This page took 0.025364 seconds and 4 git commands to generate.