fill kvm_callback with arch specific dcr_read/dcr_write callbacks v2
PATCH RESEND 1/1 fill kvm_callback with arch specific dcr_read/dcr_write callbacks v2
Subject: [PATCH][RESEND] fill kvm_callback with arch specific dcr_read/dcr_write callbacks v2
From: Christian Ehrhardt <[email protected]>
This Patch adds the callback assignment and handlers for powerpc_dcr_read and ppc_dcr_write which are called from libkvm.
This is the part of the patch that changes already submitted code. Changes in v2:
This is version has the needed changes to main-ppc.c function prototypes merged as discussed.
libkvm/libkvm-powerpc.c | 8 ++++---- libkvm/libkvm.h | 4 ++-- qemu/qemu-kvm.c | 4 ++++ qemu/qemu-kvm.h | 5 +++++ user/main-ppc.c | 4 ++-- 5 files changed, 17 insertions(+), 8 deletions(-)
libkvm/libkvm-powerpc.c +4 -4
@@ -31,11 +31,11 @@ int handle_dcr(struct kvm_run *run, kvmint ret =0 ;if (run->dcr.is_write) - ret = kvm->callbacks->powerpc_dcr_write (kvm, - run->dcr.dcrn,run->dcr.data); + ret = kvm->callbacks->powerpc_dcr_write (run->dcr.dcrn, + run->dcr.data);else - ret = kvm->callbacks->powerpc_dcr_read (kvm, - run->dcr.dcrn, &(run->dcr.data)); + ret = kvm->callbacks->powerpc_dcr_read (run->dcr.dcrn, + &(run->dcr.data));return ret; }
libkvm/libkvm.h +2 -2
@@ -66,8 +66,8 @@ struct kvm_callbacks {int (*pre_kvm_run)(void *opaque,int vcpu);int (*tpr_access)(void *opaque,int vcpu,uint64_t rip,int is_write);#if defined(__powerpc__) -int (*powerpc_dcr_read)(kvm_context_t kvm,uint32_t dcrn,uint32_t *data); -int (*powerpc_dcr_write)(kvm_context_t kvm,uint32_t dcrn,uint32_t data); +int (*powerpc_dcr_read)(uint32_t dcrn,uint32_t *data); +int (*powerpc_dcr_write)(uint32_t dcrn,uint32_t data);#endif };
qemu/qemu-kvm.c +4 -0
@@ -533,6 +533,10 @@ static struct kvm_callbacks qemu_kvm_ops#ifdef TARGET_I386 .tpr_access = handle_tpr_access,#endif +#ifdef TARGET_PPC + .powerpc_dcr_read = handle_powerpc_dcr_read, + .powerpc_dcr_write = handle_powerpc_dcr_write, +#endif };int kvm_qemu_init ()
qemu/qemu-kvm.h +5 -0
@@ -48,6 +48,11 @@ int handle_tpr_access(void *opaque, intint handle_tpr_access (void *opaque,int vcpu,uint64_t rip,int is_write); +#ifdef TARGET_PPC +int handle_powerpc_dcr_read (uint32_t dcrn,uint32_t *data); +int handle_powerpc_dcr_write (uint32_t dcrn,uint32_t data); +#endif +#define ALIGN (x, y) (((x)+(y)-1) & ~((y)-1))#define BITMAP_SIZE (m) (ALIGN(((m)>>TARGET_PAGE_BITS), HOST_LONG_BITS) / 8)
user/main-ppc.c +2 -2
@@ -106,14 +106,14 @@ static int test_mem_write(void *opaque,return 0 ; } -static int test_dcr_read (kvm_context_t kvm,uint32_t dcrn,uint32_t *data) +static int test_dcr_read (uint32_t dcrn,uint32_t *data) {printf ("%s: dcrn %04X\n" , __func__, dcrn); *data =0 ;return 0 ; } -static int test_dcr_write (kvm_context_t kvm,uint32_t dcrn,uint32_t data) +static int test_dcr_write (uint32_t dcrn,uint32_t data) {printf ("%s: dcrn %04X data %04X\n" , __func__, dcrn, data);return 0 ;
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
A message that is not in the archive (sent off-list or not yet received): 12003010341651-git-send-email-ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org
Avi Kivity
AppliedQuoted 10 lines · Christian Ehrhardt
Subject: [PATCH][RESEND] fill
kvm_callbackwith arch specific dcr_read/dcr_write callbacks v2
From: Christian Ehrhardt <[email protected]>This Patch adds the callback assignment and handlers for
powerpc_dcr_readandppc_dcr_writewhich are called from libkvm.
This is the part of the patch that changes already submitted code. Changes in v2:
This is version has the needed changes tomain-ppc.cfunction prototypes merged as discussed.
Applied, thanks.
Signature · 8 lines
error compiling committee.c: too many arguments to function ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace