]>
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 | ||
12 | void kvmppc_init(void); | |
13 | void kvmppc_fdt_update(void *fdt); | |
69577857 DG |
14 | #ifndef CONFIG_KVM |
15 | static inline int kvmppc_read_host_property(const char *node_path, const char *prop, | |
16 | void *val, size_t len) | |
17 | { | |
18 | assert(0); | |
19 | return -ENOSYS; | |
20 | } | |
21 | #else | |
ea23bc20 AJ |
22 | int kvmppc_read_host_property(const char *node_path, const char *prop, |
23 | void *val, size_t len); | |
69577857 | 24 | #endif |
d76d1650 | 25 | |
dc333cd6 | 26 | uint32_t kvmppc_get_tbfreq(void); |
45024f09 | 27 | int kvmppc_get_hypercall(CPUState *env, uint8_t *buf, int buf_len); |
fc87e185 AG |
28 | int kvmppc_set_interrupt(CPUState *env, int irq, int level); |
29 | ||
b45d63b6 BH |
30 | #ifndef CONFIG_KVM |
31 | #define kvmppc_eieio() do { } while (0) | |
32 | #else | |
33 | #define kvmppc_eieio() \ | |
34 | do { \ | |
35 | if (kvm_enabled()) { \ | |
36 | asm volatile("eieio" : : : "memory"); \ | |
37 | } \ | |
38 | } while (0) | |
39 | #endif | |
40 | ||
fc87e185 AG |
41 | #ifndef KVM_INTERRUPT_SET |
42 | #define KVM_INTERRUPT_SET -1 | |
43 | #endif | |
44 | ||
45 | #ifndef KVM_INTERRUPT_UNSET | |
46 | #define KVM_INTERRUPT_UNSET -2 | |
47 | #endif | |
48 | ||
49 | #ifndef KVM_INTERRUPT_SET_LEVEL | |
50 | #define KVM_INTERRUPT_SET_LEVEL -3 | |
51 | #endif | |
dc333cd6 | 52 | |
d76d1650 | 53 | #endif /* __KVM_PPC_H__ */ |