diff options
author | Cornelia Huck <cornelia.huck@de.ibm.com> | 2014-05-09 10:06:46 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2014-05-13 13:11:08 +0200 |
commit | ada4135f84adcacd9294269e22113460650ae1ab (patch) | |
tree | 5ed60670851fc64b5c8762fbfb9b9056dacfb615 /include/sysemu | |
parent | 8e03c100a7aeb268a7ebfdd98298591a63df0626 (diff) | |
download | qemu-ada4135f84adcacd9294269e22113460650ae1ab.zip qemu-ada4135f84adcacd9294269e22113460650ae1ab.tar.gz qemu-ada4135f84adcacd9294269e22113460650ae1ab.tar.bz2 |
kvm: make one_reg helpers available for everyone
s390x introduced helper functions for getting/setting one_regs with
commit 860643bc. However, nothing about these is s390-specific.
Alexey Kardashevskiy had already posted a general version, so let's
merge the two patches and massage the code a bit.
CC: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include/sysemu')
-rw-r--r-- | include/sysemu/kvm.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h index 5ad4e0e..a6c2823 100644 --- a/include/sysemu/kvm.h +++ b/include/sysemu/kvm.h @@ -383,4 +383,24 @@ void kvm_init_irq_routing(KVMState *s); * > 0: irq chip was created */ int kvm_arch_irqchip_create(KVMState *s); + +/** + * kvm_set_one_reg - set a register value in KVM via KVM_SET_ONE_REG ioctl + * @id: The register ID + * @source: The pointer to the value to be set. It must point to a variable + * of the correct type/size for the register being accessed. + * + * Returns: 0 on success, or a negative errno on failure. + */ +int kvm_set_one_reg(CPUState *cs, uint64_t id, void *source); + +/** + * kvm_get_one_reg - get a register value from KVM via KVM_GET_ONE_REG ioctl + * @id: The register ID + * @target: The pointer where the value is to be stored. It must point to a + * variable of the correct type/size for the register being accessed. + * + * Returns: 0 on success, or a negative errno on failure. + */ +int kvm_get_one_reg(CPUState *cs, uint64_t id, void *target); #endif |