Patchwork [qom-cpu,2/4] memory_mapping: Change cpu_get_memory_mapping() argument to CPUState

login
register
mail settings
Submitter Andreas Färber
Date May 22, 2013, 1:09 p.m.
Message ID <1369228150-5428-3-git-send-email-afaerber@suse.de>
Download mbox | patch
Permalink /patch/245617/
State New
Headers show

Comments

Andreas Färber - May 22, 2013, 1:09 p.m.
Eliminates an occurrence of CPUArchState from sysemu/memory_mapping.h.

Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 include/sysemu/memory_mapping.h   | 2 +-
 memory_mapping.c                  | 2 +-
 target-i386/arch_memory_mapping.c | 5 ++++-
 3 files changed, 6 insertions(+), 3 deletions(-)

Patch

diff --git a/include/sysemu/memory_mapping.h b/include/sysemu/memory_mapping.h
index 0a418a7..2e2893a 100644
--- a/include/sysemu/memory_mapping.h
+++ b/include/sysemu/memory_mapping.h
@@ -30,7 +30,7 @@  typedef struct MemoryMappingList {
     QTAILQ_HEAD(, MemoryMapping) head;
 } MemoryMappingList;
 
-int cpu_get_memory_mapping(MemoryMappingList *list, CPUArchState *env);
+int cpu_get_memory_mapping(MemoryMappingList *list, CPUState *cpu);
 bool cpu_paging_enabled(CPUArchState *env);
 
 /*
diff --git a/memory_mapping.c b/memory_mapping.c
index 4867ae4..fe8e0ff 100644
--- a/memory_mapping.c
+++ b/memory_mapping.c
@@ -138,7 +138,7 @@  int qemu_get_guest_memory_mapping(MemoryMappingList *list)
     first_paging_enabled_cpu = find_paging_enabled_cpu(first_cpu);
     if (first_paging_enabled_cpu) {
         for (env = first_paging_enabled_cpu; env != NULL; env = env->next_cpu) {
-            ret = cpu_get_memory_mapping(list, env);
+            ret = cpu_get_memory_mapping(list, ENV_GET_CPU(env));
             if (ret < 0) {
                 return -1;
             }
diff --git a/target-i386/arch_memory_mapping.c b/target-i386/arch_memory_mapping.c
index a2eb7e7..187c3df 100644
--- a/target-i386/arch_memory_mapping.c
+++ b/target-i386/arch_memory_mapping.c
@@ -237,8 +237,11 @@  static void walk_pml4e(MemoryMappingList *list,
 }
 #endif
 
-int cpu_get_memory_mapping(MemoryMappingList *list, CPUArchState *env)
+int cpu_get_memory_mapping(MemoryMappingList *list, CPUState *cs)
 {
+    X86CPU *cpu = X86_CPU(cs);
+    CPUX86State *env = &cpu->env;
+
     if (!cpu_paging_enabled(env)) {
         /* paging is disabled */
         return 0;