Subject: [PATCH 3/3] Add dcr read/write to the PowerPC kvmctl implementation
From: Christian Ehrhardt <[EMAIL PROTECTED]>

Adds simple functions to catch dcr access while executing testcases printing
information about that access when triggered.

Signed-off-by: Christian Ehrhardt <[EMAIL PROTECTED]>

---
 main-ppc.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+)

diff -r d19893c744fa user/main-ppc.c
--- a/user/main-ppc.c   Wed Jan 09 14:06:38 2008 +0100
+++ b/user/main-ppc.c   Wed Jan 09 14:34:49 2008 +0100
@@ -146,6 +146,19 @@ static int test_mem_write(void *opaque, 
        return 0;
 }
 
+static int test_dcr_read(kvm_context_t kvm, 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)
+{
+       printf("%s: dcrn %04X data %04X\n", __func__, dcrn, data);
+       return 0;
+}
+
 static struct kvm_callbacks test_callbacks = {
        .mmio_read   = test_mem_read,
        .mmio_write  = test_mem_write,
@@ -155,6 +168,8 @@ static struct kvm_callbacks test_callbac
        .try_push_interrupts = test_try_push_interrupts,
        .post_kvm_run = test_post_kvm_run,
        .pre_kvm_run = test_pre_kvm_run,
+       .powerpc_dcr_read = test_dcr_read,
+       .powerpc_dcr_write = test_dcr_write,
 };
 
 static unsigned long load_file(void *mem, const char *fname, int inval_icache)

-------------------------------------------------------------------------
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
_______________________________________________
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel

Reply via email to