qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: qemu-devel@nongnu.org
Cc: "Jens Freimann" <jfrei@linux.vnet.ibm.com>,
	"Vincent Rabin" <rabin@rab.in>,
	"Qiao Nuohan" <qiaonuohan@cn.fujitsu.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Andreas Färber" <afaerber@suse.de>
Subject: [Qemu-devel] [PATCH qom-cpu 3/4] memory_mapping: Change cpu_paging_enabled() argument to CPUState
Date: Wed, 22 May 2013 15:09:08 +0200	[thread overview]
Message-ID: <1369228150-5428-4-git-send-email-afaerber@suse.de> (raw)
In-Reply-To: <1369228150-5428-1-git-send-email-afaerber@suse.de>

Removes the last 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 | 7 +++++--
 3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/include/sysemu/memory_mapping.h b/include/sysemu/memory_mapping.h
index 2e2893a..bfffb6b 100644
--- a/include/sysemu/memory_mapping.h
+++ b/include/sysemu/memory_mapping.h
@@ -31,7 +31,7 @@ typedef struct MemoryMappingList {
 } MemoryMappingList;
 
 int cpu_get_memory_mapping(MemoryMappingList *list, CPUState *cpu);
-bool cpu_paging_enabled(CPUArchState *env);
+bool cpu_paging_enabled(CPUState *cpu);
 
 /*
  * add or merge the memory region [phys_addr, phys_addr + length) into the
diff --git a/memory_mapping.c b/memory_mapping.c
index fe8e0ff..8d14ed8 100644
--- a/memory_mapping.c
+++ b/memory_mapping.c
@@ -120,7 +120,7 @@ static CPUArchState *find_paging_enabled_cpu(CPUArchState *start_cpu)
     CPUArchState *env;
 
     for (env = start_cpu; env != NULL; env = env->next_cpu) {
-        if (cpu_paging_enabled(env)) {
+        if (cpu_paging_enabled(ENV_GET_CPU(env))) {
             return env;
         }
     }
diff --git a/target-i386/arch_memory_mapping.c b/target-i386/arch_memory_mapping.c
index 187c3df..44ed886 100644
--- a/target-i386/arch_memory_mapping.c
+++ b/target-i386/arch_memory_mapping.c
@@ -242,7 +242,7 @@ int cpu_get_memory_mapping(MemoryMappingList *list, CPUState *cs)
     X86CPU *cpu = X86_CPU(cs);
     CPUX86State *env = &cpu->env;
 
-    if (!cpu_paging_enabled(env)) {
+    if (!cpu_paging_enabled(cs)) {
         /* paging is disabled */
         return 0;
     }
@@ -274,7 +274,10 @@ int cpu_get_memory_mapping(MemoryMappingList *list, CPUState *cs)
     return 0;
 }
 
-bool cpu_paging_enabled(CPUArchState *env)
+bool cpu_paging_enabled(CPUState *cs)
 {
+    X86CPU *cpu = X86_CPU(cs);
+    CPUX86State *env = &cpu->env;
+
     return env->cr[0] & CR0_PG_MASK;
 }
-- 
1.8.1.4

  parent reply	other threads:[~2013-05-22 13:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-22 13:09 [Qemu-devel] [PATCH qom-cpu 0/4] memory_mapping: Clean up stubs Andreas Färber
2013-05-22 13:09 ` [Qemu-devel] [PATCH qom-cpu 1/4] memory_mapping: Use hwaddr type for MemoryMapping virt_addr field Andreas Färber
2013-05-22 13:09 ` [Qemu-devel] [PATCH qom-cpu 2/4] memory_mapping: Change cpu_get_memory_mapping() argument to CPUState Andreas Färber
2013-05-22 13:09 ` Andreas Färber [this message]
2013-05-22 13:09 ` [Qemu-devel] [PATCH qom-cpu 4/4] memory_mapping: Move stubs to libqemustub.a Andreas Färber
2013-05-23 10:08   ` Paolo Bonzini
2013-05-28  9:39     ` Andreas Färber
2013-05-28  9:53       ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1369228150-5428-4-git-send-email-afaerber@suse.de \
    --to=afaerber@suse.de \
    --cc=jfrei@linux.vnet.ibm.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qiaonuohan@cn.fujitsu.com \
    --cc=rabin@rab.in \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).