Skip to contentSkip to conversation

Fix PowerPC Qemu CPU initilization when using target-ppc/fake-exec.c

PATCH Applied Jerone Young 3 participants 3 messages Feb 26, 2008 – Feb 27, 2008 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix PowerPC Qemu CPU initilization when using target-ppc/fake-exec.c

# HG changeset patch
# User Jerone Young <[email protected]>
# Date 1204046245 21600
# Branch merge
# Node ID 1980deb2bddff30c2f798d33937759a7ce91c242
# Parent e1260182b60d6d6716870c3bff82f503fad868fb
Fix PowerPC Qemu CPU initilization when using target-ppc/fake-exec.c

qemu/target-ppc/fake-exec.c +30 -1
@@ -19,6 +19,22 @@
 
 #include "cpu.h"
 #include "exec-all.h"
+
+
+struct ppc_def_t {
+    const unsigned char *name;
+    uint32_t pvr;
+    uint32_t svr;
+    uint64_t insns_flags;
+    uint64_t msr_mask;
+    powerpc_mmu_t   mmu_model;
+    powerpc_excp_t  excp_model;
+    powerpc_input_t bus_model;
+    uint32_t flags;
+    int bfd_mach;
+    void (*init_proc)(CPUPPCState *env);
+    int  (*check_pow)(CPUPPCState *env);
+};
 
 int code_copy_enabled = 0;
 
@@ -60,13 +76,26 @@ int cpu_ppc_gen_code(CPUState *env, Tran
     return 0;
 }
 
+void init_proc_ppc440ep_kvm(CPUPPCState *env)
+{
+    ppc40x_irq_init(env);
+}
+
+static ppc_def_t ppc440ep_kvm = {
+    .name = "440EP KVM",
+    .mmu_model = POWERPC_MMU_SOFT_4xx, /*XXX needed for GDB stub */
+    .init_proc = init_proc_ppc440ep_kvm,
+};
+
 const ppc_def_t *cpu_ppc_find_by_name (const unsigned char *name)
 {
-    return NULL;
+    return &ppc440ep_kvm;
 }
 
 int cpu_ppc_register_internal (CPUPPCState *env, const ppc_def_t *def)
 {
+    env->mmu_model = def->mmu_model;
+    (*def->init_proc)(env);
     return 0;
 }
 

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

Acked-by on v1 1/1
#1 lore raw

Avi, please apply.

Signature · 8 lines
Hollis Blanchard
IBM Linux Technology Center


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
Applied
#2 lore raw
In reply to Jerone Young
Quoted 9 lines · Jerone Young

# HG changeset patch
# User Jerone Young <[email protected]>
# Date 1204046245 21600
# Branch merge
# Node ID 1980deb2bddff30c2f798d33937759a7ce91c242
# Parent e1260182b60d6d6716870c3bff82f503fad868fb
Fix PowerPC Qemu CPU initilization when using target-ppc/fake-exec.c

Applied, thanks.

Signature · 7 lines
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/