|
|
1.1 root 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:
1.1.1.5 root 12: #include "memory.h"
13:
1.1 root 14: void kvmppc_init(void);
1.1.1.5 root 15:
16: #ifdef CONFIG_KVM
1.1 root 17:
1.1.1.2 root 18: uint32_t kvmppc_get_tbfreq(void);
1.1.1.5 root 19: uint64_t kvmppc_get_clockfreq(void);
20: uint32_t kvmppc_get_vmx(void);
21: uint32_t kvmppc_get_dfp(void);
1.1.1.6 ! root 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);
1.1.1.5 root 25: int kvmppc_smt_threads(void);
26: #ifndef CONFIG_USER_ONLY
27: off_t kvmppc_alloc_rma(const char *name, MemoryRegion *sysmem);
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);
30: #endif /* !CONFIG_USER_ONLY */
31: const ppc_def_t *kvmppc_host_cpu_def(void);
1.1.1.6 ! root 32: int kvmppc_fixup_cpu(CPUPPCState *env);
1.1.1.5 root 33:
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:
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:
1.1.1.6 ! root 56: static inline int kvmppc_get_hypercall(CPUPPCState *env, uint8_t *buf, int buf_len)
1.1.1.5 root 57: {
58: return -1;
59: }
60:
1.1.1.6 ! root 61: static inline int kvmppc_set_interrupt(CPUPPCState *env, int irq, int level)
1.1.1.5 root 62: {
63: return -1;
64: }
65:
1.1.1.6 ! root 66: static inline void kvmppc_set_papr(CPUPPCState *env)
1.1.1.5 root 67: {
68: }
69:
70: static inline int kvmppc_smt_threads(void)
71: {
72: return 1;
73: }
74:
75: #ifndef CONFIG_USER_ONLY
76: static inline off_t kvmppc_alloc_rma(const char *name, MemoryRegion *sysmem)
77: {
78: return 0;
79: }
80:
81: static inline void *kvmppc_create_spapr_tce(uint32_t liobn,
82: uint32_t window_size, int *fd)
83: {
84: return NULL;
85: }
86:
87: static inline int kvmppc_remove_spapr_tce(void *table, int pfd,
88: uint32_t window_size)
89: {
90: return -1;
91: }
92: #endif /* !CONFIG_USER_ONLY */
93:
94: static inline const ppc_def_t *kvmppc_host_cpu_def(void)
95: {
96: return NULL;
97: }
98:
1.1.1.6 ! root 99: static inline int kvmppc_fixup_cpu(CPUPPCState *env)
! 100: {
! 101: return -1;
! 102: }
1.1.1.5 root 103: #endif
1.1.1.3 root 104:
1.1.1.4 root 105: #ifndef CONFIG_KVM
106: #define kvmppc_eieio() do { } while (0)
107: #else
108: #define kvmppc_eieio() \
109: do { \
110: if (kvm_enabled()) { \
111: asm volatile("eieio" : : : "memory"); \
112: } \
113: } while (0)
114: #endif
115:
1.1.1.3 root 116: #ifndef KVM_INTERRUPT_SET
117: #define KVM_INTERRUPT_SET -1
118: #endif
119:
120: #ifndef KVM_INTERRUPT_UNSET
121: #define KVM_INTERRUPT_UNSET -2
122: #endif
123:
124: #ifndef KVM_INTERRUPT_SET_LEVEL
125: #define KVM_INTERRUPT_SET_LEVEL -3
126: #endif
1.1.1.2 root 127:
1.1 root 128: #endif /* __KVM_PPC_H__ */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.