kvm_ppc.h 1.2 KB
Newer Older
A
aurel32 已提交
1 2 3 4 5 6 7 8 9 10 11 12
/*
 * Copyright 2008 IBM Corporation.
 * Authors: Hollis Blanchard <hollisb@us.ibm.com>
 *
 * This work is licensed under the GNU GPL license version 2 or later.
 *
 */

#ifndef __KVM_PPC_H__
#define __KVM_PPC_H__

void kvmppc_init(void);
13 14 15 16 17 18 19 20
#ifndef CONFIG_KVM
static inline int kvmppc_read_host_property(const char *node_path, const char *prop,
                                            void *val, size_t len)
{
    assert(0);
    return -ENOSYS;
}
#else
21 22
int kvmppc_read_host_property(const char *node_path, const char *prop,
                                     void *val, size_t len);
23
#endif
A
aurel32 已提交
24

25
uint32_t kvmppc_get_tbfreq(void);
26
int kvmppc_get_hypercall(CPUState *env, uint8_t *buf, int buf_len);
27 28
int kvmppc_set_interrupt(CPUState *env, int irq, int level);

29 30 31 32 33 34 35 36 37 38 39
#ifndef CONFIG_KVM
#define kvmppc_eieio() do { } while (0)
#else
#define kvmppc_eieio() \
    do {                                          \
        if (kvm_enabled()) {                          \
            asm volatile("eieio" : : : "memory"); \
        } \
    } while (0)
#endif

40 41 42 43 44 45 46 47 48 49 50
#ifndef KVM_INTERRUPT_SET
#define KVM_INTERRUPT_SET -1
#endif

#ifndef KVM_INTERRUPT_UNSET
#define KVM_INTERRUPT_UNSET -2
#endif

#ifndef KVM_INTERRUPT_SET_LEVEL
#define KVM_INTERRUPT_SET_LEVEL -3
#endif
51

A
aurel32 已提交
52
#endif /* __KVM_PPC_H__ */